material-components-web.js 968 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661
  1. /*!
  2. Material Components for the Web
  3. Copyright (c) 2018 Google Inc.
  4. License: MIT
  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 = 56);
  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. * Permission is hereby granted, free of charge, to any person obtaining a copy
  92. * of this software and associated documentation files (the "Software"), to deal
  93. * in the Software without restriction, including without limitation the rights
  94. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  95. * copies of the Software, and to permit persons to whom the Software is
  96. * furnished to do so, subject to the following conditions:
  97. *
  98. * The above copyright notice and this permission notice shall be included in
  99. * all copies or substantial portions of the Software.
  100. *
  101. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  102. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  103. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  104. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  105. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  106. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  107. * THE SOFTWARE.
  108. */
  109. /**
  110. * @template A
  111. */
  112. var MDCFoundation = function () {
  113. _createClass(MDCFoundation, null, [{
  114. key: "cssClasses",
  115. /** @return enum{cssClasses} */
  116. get: function get() {
  117. // Classes extending MDCFoundation should implement this method to return an object which exports every
  118. // CSS class the foundation class needs as a property. e.g. {ACTIVE: 'mdc-component--active'}
  119. return {};
  120. }
  121. /** @return enum{strings} */
  122. }, {
  123. key: "strings",
  124. get: function get() {
  125. // Classes extending MDCFoundation should implement this method to return an object which exports all
  126. // semantic strings as constants. e.g. {ARIA_ROLE: 'tablist'}
  127. return {};
  128. }
  129. /** @return enum{numbers} */
  130. }, {
  131. key: "numbers",
  132. get: function get() {
  133. // Classes extending MDCFoundation should implement this method to return an object which exports all
  134. // of its semantic numbers as constants. e.g. {ANIMATION_DELAY_MS: 350}
  135. return {};
  136. }
  137. /** @return {!Object} */
  138. }, {
  139. key: "defaultAdapter",
  140. get: function get() {
  141. // Classes extending MDCFoundation may choose to implement this getter in order to provide a convenient
  142. // way of viewing the necessary methods of an adapter. In the future, this could also be used for adapter
  143. // validation.
  144. return {};
  145. }
  146. /**
  147. * @param {A=} adapter
  148. */
  149. }]);
  150. function MDCFoundation() {
  151. var adapter = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  152. _classCallCheck(this, MDCFoundation);
  153. /** @protected {!A} */
  154. this.adapter_ = adapter;
  155. }
  156. _createClass(MDCFoundation, [{
  157. key: "init",
  158. value: function init() {
  159. // Subclasses should override this method to perform initialization routines (registering events, etc.)
  160. }
  161. }, {
  162. key: "destroy",
  163. value: function destroy() {
  164. // Subclasses should override this method to perform de-initialization routines (de-registering events, etc.)
  165. }
  166. }]);
  167. return MDCFoundation;
  168. }();
  169. /* harmony default export */ __webpack_exports__["a"] = (MDCFoundation);
  170. /***/ }),
  171. /* 1 */
  172. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  173. "use strict";
  174. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation__ = __webpack_require__(0);
  175. 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; }; }();
  176. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  177. /**
  178. * @license
  179. * Copyright 2016 Google Inc.
  180. *
  181. * Permission is hereby granted, free of charge, to any person obtaining a copy
  182. * of this software and associated documentation files (the "Software"), to deal
  183. * in the Software without restriction, including without limitation the rights
  184. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  185. * copies of the Software, and to permit persons to whom the Software is
  186. * furnished to do so, subject to the following conditions:
  187. *
  188. * The above copyright notice and this permission notice shall be included in
  189. * all copies or substantial portions of the Software.
  190. *
  191. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  192. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  193. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  194. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  195. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  196. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  197. * THE SOFTWARE.
  198. */
  199. /**
  200. * @template F
  201. */
  202. var MDCComponent = function () {
  203. _createClass(MDCComponent, null, [{
  204. key: 'attachTo',
  205. /**
  206. * @param {!Element} root
  207. * @return {!MDCComponent}
  208. */
  209. value: function attachTo(root) {
  210. // Subclasses which extend MDCBase should provide an attachTo() method that takes a root element and
  211. // returns an instantiated component with its root set to that element. Also note that in the cases of
  212. // subclasses, an explicit foundation class will not have to be passed in; it will simply be initialized
  213. // from getDefaultFoundation().
  214. return new MDCComponent(root, new __WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */]());
  215. }
  216. /**
  217. * @param {!Element} root
  218. * @param {F=} foundation
  219. * @param {...?} args
  220. */
  221. }]);
  222. function MDCComponent(root) {
  223. var foundation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
  224. _classCallCheck(this, MDCComponent);
  225. /** @protected {!Element} */
  226. this.root_ = root;
  227. for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
  228. args[_key - 2] = arguments[_key];
  229. }
  230. this.initialize.apply(this, args);
  231. // Note that we initialize foundation here and not within the constructor's default param so that
  232. // this.root_ is defined and can be used within the foundation class.
  233. /** @protected {!F} */
  234. this.foundation_ = foundation === undefined ? this.getDefaultFoundation() : foundation;
  235. this.foundation_.init();
  236. this.initialSyncWithDOM();
  237. }
  238. _createClass(MDCComponent, [{
  239. key: 'initialize',
  240. value: function initialize() /* ...args */{}
  241. // Subclasses can override this to do any additional setup work that would be considered part of a
  242. // "constructor". Essentially, it is a hook into the parent constructor before the foundation is
  243. // initialized. Any additional arguments besides root and foundation will be passed in here.
  244. /**
  245. * @return {!F} foundation
  246. */
  247. }, {
  248. key: 'getDefaultFoundation',
  249. value: function getDefaultFoundation() {
  250. // Subclasses must override this method to return a properly configured foundation class for the
  251. // component.
  252. throw new Error('Subclasses must override getDefaultFoundation to return a properly configured ' + 'foundation class');
  253. }
  254. }, {
  255. key: 'initialSyncWithDOM',
  256. value: function initialSyncWithDOM() {
  257. // Subclasses should override this method if they need to perform work to synchronize with a host DOM
  258. // object. An example of this would be a form control wrapper that needs to synchronize its internal state
  259. // to some property or attribute of the host DOM. Please note: this is *not* the place to perform DOM
  260. // reads/writes that would cause layout / paint, as this is called synchronously from within the constructor.
  261. }
  262. }, {
  263. key: 'destroy',
  264. value: function destroy() {
  265. // Subclasses may implement this method to release any resources / deregister any listeners they have
  266. // attached. An example of this might be deregistering a resize event from the window object.
  267. this.foundation_.destroy();
  268. }
  269. /**
  270. * Wrapper method to add an event listener to the component's root element. This is most useful when
  271. * listening for custom events.
  272. * @param {string} evtType
  273. * @param {!Function} handler
  274. */
  275. }, {
  276. key: 'listen',
  277. value: function listen(evtType, handler) {
  278. this.root_.addEventListener(evtType, handler);
  279. }
  280. /**
  281. * Wrapper method to remove an event listener to the component's root element. This is most useful when
  282. * unlistening for custom events.
  283. * @param {string} evtType
  284. * @param {!Function} handler
  285. */
  286. }, {
  287. key: 'unlisten',
  288. value: function unlisten(evtType, handler) {
  289. this.root_.removeEventListener(evtType, handler);
  290. }
  291. /**
  292. * Fires a cross-browser-compatible custom event from the component root of the given type,
  293. * with the given data.
  294. * @param {string} evtType
  295. * @param {!Object} evtData
  296. * @param {boolean=} shouldBubble
  297. */
  298. }, {
  299. key: 'emit',
  300. value: function emit(evtType, evtData) {
  301. var shouldBubble = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  302. var evt = void 0;
  303. if (typeof CustomEvent === 'function') {
  304. evt = new CustomEvent(evtType, {
  305. detail: evtData,
  306. bubbles: shouldBubble
  307. });
  308. } else {
  309. evt = document.createEvent('CustomEvent');
  310. evt.initCustomEvent(evtType, shouldBubble, false, evtData);
  311. }
  312. this.root_.dispatchEvent(evt);
  313. }
  314. }]);
  315. return MDCComponent;
  316. }();
  317. /* harmony default export */ __webpack_exports__["a"] = (MDCComponent);
  318. /***/ }),
  319. /* 2 */
  320. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  321. "use strict";
  322. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  323. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCRipple", function() { return MDCRipple; });
  324. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RippleCapableSurface", function() { return RippleCapableSurface; });
  325. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  326. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(24);
  327. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(59);
  328. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util__ = __webpack_require__(6);
  329. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCRippleFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  330. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "util", function() { return __WEBPACK_IMPORTED_MODULE_3__util__; });
  331. 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; }; }();
  332. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  333. 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; }
  334. 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; }
  335. /**
  336. * @license
  337. * Copyright 2016 Google Inc.
  338. *
  339. * Permission is hereby granted, free of charge, to any person obtaining a copy
  340. * of this software and associated documentation files (the "Software"), to deal
  341. * in the Software without restriction, including without limitation the rights
  342. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  343. * copies of the Software, and to permit persons to whom the Software is
  344. * furnished to do so, subject to the following conditions:
  345. *
  346. * The above copyright notice and this permission notice shall be included in
  347. * all copies or substantial portions of the Software.
  348. *
  349. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  350. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  351. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  352. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  353. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  354. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  355. * THE SOFTWARE.
  356. */
  357. /**
  358. * @extends MDCComponent<!MDCRippleFoundation>
  359. */
  360. var MDCRipple = function (_MDCComponent) {
  361. _inherits(MDCRipple, _MDCComponent);
  362. /** @param {...?} args */
  363. function MDCRipple() {
  364. var _ref;
  365. _classCallCheck(this, MDCRipple);
  366. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  367. args[_key] = arguments[_key];
  368. }
  369. /** @type {boolean} */
  370. var _this = _possibleConstructorReturn(this, (_ref = MDCRipple.__proto__ || Object.getPrototypeOf(MDCRipple)).call.apply(_ref, [this].concat(args)));
  371. _this.disabled = false;
  372. /** @private {boolean} */
  373. _this.unbounded_;
  374. return _this;
  375. }
  376. /**
  377. * @param {!Element} root
  378. * @param {{isUnbounded: (boolean|undefined)}=} options
  379. * @return {!MDCRipple}
  380. */
  381. _createClass(MDCRipple, [{
  382. key: 'setUnbounded_',
  383. /**
  384. * Closure Compiler throws an access control error when directly accessing a
  385. * protected or private property inside a getter/setter, like unbounded above.
  386. * By accessing the protected property inside a method, we solve that problem.
  387. * That's why this function exists.
  388. * @private
  389. */
  390. value: function setUnbounded_() {
  391. this.foundation_.setUnbounded(this.unbounded_);
  392. }
  393. }, {
  394. key: 'activate',
  395. value: function activate() {
  396. this.foundation_.activate();
  397. }
  398. }, {
  399. key: 'deactivate',
  400. value: function deactivate() {
  401. this.foundation_.deactivate();
  402. }
  403. }, {
  404. key: 'layout',
  405. value: function layout() {
  406. this.foundation_.layout();
  407. }
  408. /**
  409. * @return {!MDCRippleFoundation}
  410. * @override
  411. */
  412. }, {
  413. key: 'getDefaultFoundation',
  414. value: function getDefaultFoundation() {
  415. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */](MDCRipple.createAdapter(this));
  416. }
  417. /** @override */
  418. }, {
  419. key: 'initialSyncWithDOM',
  420. value: function initialSyncWithDOM() {
  421. this.unbounded = 'mdcRippleIsUnbounded' in this.root_.dataset;
  422. }
  423. }, {
  424. key: 'unbounded',
  425. /** @return {boolean} */
  426. get: function get() {
  427. return this.unbounded_;
  428. }
  429. /** @param {boolean} unbounded */
  430. ,
  431. set: function set(unbounded) {
  432. this.unbounded_ = Boolean(unbounded);
  433. this.setUnbounded_();
  434. }
  435. }], [{
  436. key: 'attachTo',
  437. value: function attachTo(root) {
  438. var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  439. _ref2$isUnbounded = _ref2.isUnbounded,
  440. isUnbounded = _ref2$isUnbounded === undefined ? undefined : _ref2$isUnbounded;
  441. var ripple = new MDCRipple(root);
  442. // Only override unbounded behavior if option is explicitly specified
  443. if (isUnbounded !== undefined) {
  444. ripple.unbounded = /** @type {boolean} */isUnbounded;
  445. }
  446. return ripple;
  447. }
  448. /**
  449. * @param {!RippleCapableSurface} instance
  450. * @return {!MDCRippleAdapter}
  451. */
  452. }, {
  453. key: 'createAdapter',
  454. value: function createAdapter(instance) {
  455. var MATCHES = __WEBPACK_IMPORTED_MODULE_3__util__["getMatchesProperty"](HTMLElement.prototype);
  456. return {
  457. browserSupportsCssVars: function browserSupportsCssVars() {
  458. return __WEBPACK_IMPORTED_MODULE_3__util__["supportsCssVariables"](window);
  459. },
  460. isUnbounded: function isUnbounded() {
  461. return instance.unbounded;
  462. },
  463. isSurfaceActive: function isSurfaceActive() {
  464. return instance.root_[MATCHES](':active');
  465. },
  466. isSurfaceDisabled: function isSurfaceDisabled() {
  467. return instance.disabled;
  468. },
  469. addClass: function addClass(className) {
  470. return instance.root_.classList.add(className);
  471. },
  472. removeClass: function removeClass(className) {
  473. return instance.root_.classList.remove(className);
  474. },
  475. containsEventTarget: function containsEventTarget(target) {
  476. return instance.root_.contains(target);
  477. },
  478. registerInteractionHandler: function registerInteractionHandler(evtType, handler) {
  479. return instance.root_.addEventListener(evtType, handler, __WEBPACK_IMPORTED_MODULE_3__util__["applyPassive"]());
  480. },
  481. deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) {
  482. return instance.root_.removeEventListener(evtType, handler, __WEBPACK_IMPORTED_MODULE_3__util__["applyPassive"]());
  483. },
  484. registerDocumentInteractionHandler: function registerDocumentInteractionHandler(evtType, handler) {
  485. return document.documentElement.addEventListener(evtType, handler, __WEBPACK_IMPORTED_MODULE_3__util__["applyPassive"]());
  486. },
  487. deregisterDocumentInteractionHandler: function deregisterDocumentInteractionHandler(evtType, handler) {
  488. return document.documentElement.removeEventListener(evtType, handler, __WEBPACK_IMPORTED_MODULE_3__util__["applyPassive"]());
  489. },
  490. registerResizeHandler: function registerResizeHandler(handler) {
  491. return window.addEventListener('resize', handler);
  492. },
  493. deregisterResizeHandler: function deregisterResizeHandler(handler) {
  494. return window.removeEventListener('resize', handler);
  495. },
  496. updateCssVariable: function updateCssVariable(varName, value) {
  497. return instance.root_.style.setProperty(varName, value);
  498. },
  499. computeBoundingRect: function computeBoundingRect() {
  500. return instance.root_.getBoundingClientRect();
  501. },
  502. getWindowPageOffset: function getWindowPageOffset() {
  503. return { x: window.pageXOffset, y: window.pageYOffset };
  504. }
  505. };
  506. }
  507. }]);
  508. return MDCRipple;
  509. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  510. /**
  511. * See Material Design spec for more details on when to use ripples.
  512. * https://material.io/guidelines/motion/choreography.html#choreography-creation
  513. * @record
  514. */
  515. var RippleCapableSurface = function RippleCapableSurface() {
  516. _classCallCheck(this, RippleCapableSurface);
  517. };
  518. /** @protected {!Element} */
  519. RippleCapableSurface.prototype.root_;
  520. /**
  521. * Whether or not the ripple bleeds out of the bounds of the element.
  522. * @type {boolean|undefined}
  523. */
  524. RippleCapableSurface.prototype.unbounded;
  525. /**
  526. * Whether or not the ripple is attached to a disabled component.
  527. * @type {boolean|undefined}
  528. */
  529. RippleCapableSurface.prototype.disabled;
  530. /***/ }),
  531. /* 3 */
  532. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  533. "use strict";
  534. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  535. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation__ = __webpack_require__(0);
  536. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__component__ = __webpack_require__(1);
  537. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCFoundation", function() { return __WEBPACK_IMPORTED_MODULE_0__foundation__["a"]; });
  538. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCComponent", function() { return __WEBPACK_IMPORTED_MODULE_1__component__["a"]; });
  539. /**
  540. * @license
  541. * Copyright 2016 Google Inc.
  542. *
  543. * Permission is hereby granted, free of charge, to any person obtaining a copy
  544. * of this software and associated documentation files (the "Software"), to deal
  545. * in the Software without restriction, including without limitation the rights
  546. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  547. * copies of the Software, and to permit persons to whom the Software is
  548. * furnished to do so, subject to the following conditions:
  549. *
  550. * The above copyright notice and this permission notice shall be included in
  551. * all copies or substantial portions of the Software.
  552. *
  553. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  554. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  555. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  556. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  557. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  558. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  559. * THE SOFTWARE.
  560. */
  561. /***/ }),
  562. /* 4 */
  563. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  564. "use strict";
  565. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  566. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSelectionControlState", function() { return MDCSelectionControlState; });
  567. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSelectionControl", function() { return MDCSelectionControl; });
  568. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_ripple_index__ = __webpack_require__(2);
  569. 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; }; }();
  570. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  571. /**
  572. * @license
  573. * Copyright 2017 Google Inc.
  574. *
  575. * Permission is hereby granted, free of charge, to any person obtaining a copy
  576. * of this software and associated documentation files (the "Software"), to deal
  577. * in the Software without restriction, including without limitation the rights
  578. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  579. * copies of the Software, and to permit persons to whom the Software is
  580. * furnished to do so, subject to the following conditions:
  581. *
  582. * The above copyright notice and this permission notice shall be included in
  583. * all copies or substantial portions of the Software.
  584. *
  585. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  586. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  587. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  588. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  589. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  590. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  591. * THE SOFTWARE.
  592. */
  593. /* eslint-disable no-unused-vars */
  594. /* eslint-enable no-unused-vars */
  595. /**
  596. * @typedef {{
  597. * checked: boolean,
  598. * indeterminate: boolean,
  599. * disabled: boolean,
  600. * value: ?string
  601. * }}
  602. */
  603. var MDCSelectionControlState = void 0;
  604. /**
  605. * @record
  606. */
  607. var MDCSelectionControl = function () {
  608. function MDCSelectionControl() {
  609. _classCallCheck(this, MDCSelectionControl);
  610. }
  611. _createClass(MDCSelectionControl, [{
  612. key: 'ripple',
  613. /** @return {?MDCRipple} */
  614. get: function get() {}
  615. }]);
  616. return MDCSelectionControl;
  617. }();
  618. /***/ }),
  619. /* 5 */
  620. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  621. "use strict";
  622. /* unused harmony export MDCTabScrollerAnimation */
  623. /* unused harmony export MDCTabScrollerHorizontalEdges */
  624. /* unused harmony export MDCTabScrollerAdapter */
  625. 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; }; }();
  626. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  627. /**
  628. * @license
  629. * Copyright 2018 Google Inc.
  630. *
  631. * Permission is hereby granted, free of charge, to any person obtaining a copy
  632. * of this software and associated documentation files (the "Software"), to deal
  633. * in the Software without restriction, including without limitation the rights
  634. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  635. * copies of the Software, and to permit persons to whom the Software is
  636. * furnished to do so, subject to the following conditions:
  637. *
  638. * The above copyright notice and this permission notice shall be included in
  639. * all copies or substantial portions of the Software.
  640. *
  641. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  642. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  643. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  644. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  645. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  646. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  647. * THE SOFTWARE.
  648. */
  649. /* eslint no-unused-vars: [2, {"args": "none"}] */
  650. /**
  651. * MDCTabScrollerAnimation contains the values required for animating from the
  652. * current scroll position to the new scroll position. The "finalScrollPosition"
  653. * value represents the new scroll position while the "scrollDelta" value is the
  654. * corresponding transformation that is applied to the scroll content. Together,
  655. * they create the animation by first updating the scroll value then applying
  656. * the transformation and animating the transition. Both pieces are necessary
  657. * for the scroll animation to work. The values are used as-is by the tab
  658. * scroller animation method, ensuring that all logic for determining scroll
  659. * position or transformation is abstracted away from the animation method.
  660. * @typedef {{finalScrollPosition: number, scrollDelta: number}}
  661. */
  662. var MDCTabScrollerAnimation = void 0;
  663. /**
  664. * MDCTabScrollerHorizontalEdges represents the left and right edges of the
  665. * scroll content. These values vary depending on how scrolling in RTL is
  666. * implemented by the browser. One value is always 0 and one value is always
  667. * the max scrollable value as either a positive or negative integer.
  668. * @typedef {{left: number, right: number}}
  669. */
  670. var MDCTabScrollerHorizontalEdges = void 0;
  671. /**
  672. * Adapter for MDC Tab Scroller.
  673. *
  674. * Defines the shape of the adapter expected by the foundation. Implement this
  675. * adapter to integrate the Tab into your framework. See
  676. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  677. * for more information.
  678. *
  679. * @record
  680. */
  681. var MDCTabScrollerAdapter = function () {
  682. function MDCTabScrollerAdapter() {
  683. _classCallCheck(this, MDCTabScrollerAdapter);
  684. }
  685. _createClass(MDCTabScrollerAdapter, [{
  686. key: "addClass",
  687. /**
  688. * Adds the given className to the root element.
  689. * @param {string} className The className to add
  690. */
  691. value: function addClass(className) {}
  692. /**
  693. * Removes the given className from the root element.
  694. * @param {string} className The className to remove
  695. */
  696. }, {
  697. key: "removeClass",
  698. value: function removeClass(className) {}
  699. /**
  700. * Adds the given className to the scroll area element.
  701. * @param {string} className The className to add
  702. */
  703. }, {
  704. key: "addScrollAreaClass",
  705. value: function addScrollAreaClass(className) {}
  706. /**
  707. * Returns whether the event target matches given className.
  708. * @param {EventTarget} evtTarget The event target
  709. * @param {string} selector The selector to check
  710. * @return {boolean}
  711. */
  712. }, {
  713. key: "eventTargetMatchesSelector",
  714. value: function eventTargetMatchesSelector(evtTarget, selector) {}
  715. /**
  716. * Sets a style property of the area element to the passed value.
  717. * @param {string} propName The style property name to set
  718. * @param {string} value The style property value
  719. */
  720. }, {
  721. key: "setScrollAreaStyleProperty",
  722. value: function setScrollAreaStyleProperty(propName, value) {}
  723. /**
  724. * Sets a style property of the content element to the passed value.
  725. * @param {string} propName The style property name to set
  726. * @param {string} value The style property value
  727. */
  728. }, {
  729. key: "setScrollContentStyleProperty",
  730. value: function setScrollContentStyleProperty(propName, value) {}
  731. /**
  732. * Returns the scroll content element's computed style value of the given css property `propertyName`.
  733. * We achieve this via `getComputedStyle(...).getPropertyValue(propertyName)`.
  734. * @param {string} propertyName
  735. * @return {string}
  736. */
  737. }, {
  738. key: "getScrollContentStyleValue",
  739. value: function getScrollContentStyleValue(propertyName) {}
  740. /**
  741. * Sets the scrollLeft value of the scroll area element to the passed value.
  742. * @param {number} scrollLeft The new scrollLeft value
  743. */
  744. }, {
  745. key: "setScrollAreaScrollLeft",
  746. value: function setScrollAreaScrollLeft(scrollLeft) {}
  747. /**
  748. * Returns the scrollLeft value of the scroll area element.
  749. * @return {number}
  750. */
  751. }, {
  752. key: "getScrollAreaScrollLeft",
  753. value: function getScrollAreaScrollLeft() {}
  754. /**
  755. * Returns the offsetWidth of the scroll content element.
  756. * @return {number}
  757. */
  758. }, {
  759. key: "getScrollContentOffsetWidth",
  760. value: function getScrollContentOffsetWidth() {}
  761. /**
  762. * Returns the offsetWitdth of the scroll area element.
  763. * @return {number}
  764. */
  765. }, {
  766. key: "getScrollAreaOffsetWidth",
  767. value: function getScrollAreaOffsetWidth() {}
  768. /**
  769. * Returns the bounding client rect of the scroll area element.
  770. * @return {!ClientRect}
  771. */
  772. }, {
  773. key: "computeScrollAreaClientRect",
  774. value: function computeScrollAreaClientRect() {}
  775. /**
  776. * Returns the bounding client rect of the scroll content element.
  777. * @return {!ClientRect}
  778. */
  779. }, {
  780. key: "computeScrollContentClientRect",
  781. value: function computeScrollContentClientRect() {}
  782. /**
  783. * Returns the height of the browser's horizontal scrollbars (in px).
  784. * @return {number}
  785. */
  786. }, {
  787. key: "computeHorizontalScrollbarHeight",
  788. value: function computeHorizontalScrollbarHeight() {}
  789. }]);
  790. return MDCTabScrollerAdapter;
  791. }();
  792. /***/ }),
  793. /* 6 */
  794. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  795. "use strict";
  796. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  797. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "supportsCssVariables", function() { return supportsCssVariables; });
  798. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "applyPassive", function() { return applyPassive; });
  799. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getMatchesProperty", function() { return getMatchesProperty; });
  800. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNormalizedEventCoords", function() { return getNormalizedEventCoords; });
  801. /**
  802. * @license
  803. * Copyright 2016 Google Inc.
  804. *
  805. * Permission is hereby granted, free of charge, to any person obtaining a copy
  806. * of this software and associated documentation files (the "Software"), to deal
  807. * in the Software without restriction, including without limitation the rights
  808. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  809. * copies of the Software, and to permit persons to whom the Software is
  810. * furnished to do so, subject to the following conditions:
  811. *
  812. * The above copyright notice and this permission notice shall be included in
  813. * all copies or substantial portions of the Software.
  814. *
  815. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  816. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  817. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  818. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  819. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  820. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  821. * THE SOFTWARE.
  822. */
  823. /**
  824. * Stores result from supportsCssVariables to avoid redundant processing to detect CSS custom variable support.
  825. * @private {boolean|undefined}
  826. */
  827. var supportsCssVariables_ = void 0;
  828. /**
  829. * Stores result from applyPassive to avoid redundant processing to detect passive event listener support.
  830. * @private {boolean|undefined}
  831. */
  832. var supportsPassive_ = void 0;
  833. /**
  834. * @param {!Window} windowObj
  835. * @return {boolean}
  836. */
  837. function detectEdgePseudoVarBug(windowObj) {
  838. // Detect versions of Edge with buggy var() support
  839. // See: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/11495448/
  840. var document = windowObj.document;
  841. var node = document.createElement('div');
  842. node.className = 'mdc-ripple-surface--test-edge-var-bug';
  843. document.body.appendChild(node);
  844. // The bug exists if ::before style ends up propagating to the parent element.
  845. // Additionally, getComputedStyle returns null in iframes with display: "none" in Firefox,
  846. // but Firefox is known to support CSS custom properties correctly.
  847. // See: https://bugzilla.mozilla.org/show_bug.cgi?id=548397
  848. var computedStyle = windowObj.getComputedStyle(node);
  849. var hasPseudoVarBug = computedStyle !== null && computedStyle.borderTopStyle === 'solid';
  850. node.remove();
  851. return hasPseudoVarBug;
  852. }
  853. /**
  854. * @param {!Window} windowObj
  855. * @param {boolean=} forceRefresh
  856. * @return {boolean|undefined}
  857. */
  858. function supportsCssVariables(windowObj) {
  859. var forceRefresh = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  860. var supportsCssVariables = supportsCssVariables_;
  861. if (typeof supportsCssVariables_ === 'boolean' && !forceRefresh) {
  862. return supportsCssVariables;
  863. }
  864. var supportsFunctionPresent = windowObj.CSS && typeof windowObj.CSS.supports === 'function';
  865. if (!supportsFunctionPresent) {
  866. return;
  867. }
  868. var explicitlySupportsCssVars = windowObj.CSS.supports('--css-vars', 'yes');
  869. // See: https://bugs.webkit.org/show_bug.cgi?id=154669
  870. // See: README section on Safari
  871. var weAreFeatureDetectingSafari10plus = windowObj.CSS.supports('(--css-vars: yes)') && windowObj.CSS.supports('color', '#00000000');
  872. if (explicitlySupportsCssVars || weAreFeatureDetectingSafari10plus) {
  873. supportsCssVariables = !detectEdgePseudoVarBug(windowObj);
  874. } else {
  875. supportsCssVariables = false;
  876. }
  877. if (!forceRefresh) {
  878. supportsCssVariables_ = supportsCssVariables;
  879. }
  880. return supportsCssVariables;
  881. }
  882. //
  883. /**
  884. * Determine whether the current browser supports passive event listeners, and if so, use them.
  885. * @param {!Window=} globalObj
  886. * @param {boolean=} forceRefresh
  887. * @return {boolean|{passive: boolean}}
  888. */
  889. function applyPassive() {
  890. var globalObj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window;
  891. var forceRefresh = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  892. if (supportsPassive_ === undefined || forceRefresh) {
  893. var isSupported = false;
  894. try {
  895. globalObj.document.addEventListener('test', null, { get passive() {
  896. isSupported = true;
  897. } });
  898. } catch (e) {}
  899. supportsPassive_ = isSupported;
  900. }
  901. return supportsPassive_ ? { passive: true } : false;
  902. }
  903. /**
  904. * @param {!Object} HTMLElementPrototype
  905. * @return {!Array<string>}
  906. */
  907. function getMatchesProperty(HTMLElementPrototype) {
  908. return ['webkitMatchesSelector', 'msMatchesSelector', 'matches'].filter(function (p) {
  909. return p in HTMLElementPrototype;
  910. }).pop();
  911. }
  912. /**
  913. * @param {!Event} ev
  914. * @param {{x: number, y: number}} pageOffset
  915. * @param {!ClientRect} clientRect
  916. * @return {{x: number, y: number}}
  917. */
  918. function getNormalizedEventCoords(ev, pageOffset, clientRect) {
  919. var x = pageOffset.x,
  920. y = pageOffset.y;
  921. var documentX = x + clientRect.left;
  922. var documentY = y + clientRect.top;
  923. var normalizedX = void 0;
  924. var normalizedY = void 0;
  925. // Determine touch point relative to the ripple container.
  926. if (ev.type === 'touchstart') {
  927. normalizedX = ev.changedTouches[0].pageX - documentX;
  928. normalizedY = ev.changedTouches[0].pageY - documentY;
  929. } else {
  930. normalizedX = ev.pageX - documentX;
  931. normalizedY = ev.pageY - documentY;
  932. }
  933. return { x: normalizedX, y: normalizedY };
  934. }
  935. /***/ }),
  936. /* 7 */
  937. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  938. "use strict";
  939. 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; }; }();
  940. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  941. /**
  942. * @license
  943. * Copyright 2018 Google Inc.
  944. *
  945. * Permission is hereby granted, free of charge, to any person obtaining a copy
  946. * of this software and associated documentation files (the "Software"), to deal
  947. * in the Software without restriction, including without limitation the rights
  948. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  949. * copies of the Software, and to permit persons to whom the Software is
  950. * furnished to do so, subject to the following conditions:
  951. *
  952. * The above copyright notice and this permission notice shall be included in
  953. * all copies or substantial portions of the Software.
  954. *
  955. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  956. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  957. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  958. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  959. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  960. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  961. * THE SOFTWARE.
  962. */
  963. /* eslint no-unused-vars: [2, {"args": "none"}] */
  964. /**
  965. * Adapter for MDC Top App Bar
  966. *
  967. * Defines the shape of the adapter expected by the foundation. Implement this
  968. * adapter to integrate the Top App Bar into your framework. See
  969. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  970. * for more information.
  971. *
  972. * @record
  973. */
  974. var MDCTopAppBarAdapter = function () {
  975. function MDCTopAppBarAdapter() {
  976. _classCallCheck(this, MDCTopAppBarAdapter);
  977. }
  978. _createClass(MDCTopAppBarAdapter, [{
  979. key: "addClass",
  980. /**
  981. * Adds a class to the root Element.
  982. * @param {string} className
  983. */
  984. value: function addClass(className) {}
  985. /**
  986. * Removes a class from the root Element.
  987. * @param {string} className
  988. */
  989. }, {
  990. key: "removeClass",
  991. value: function removeClass(className) {}
  992. /**
  993. * Returns true if the root Element contains the given class.
  994. * @param {string} className
  995. * @return {boolean}
  996. */
  997. }, {
  998. key: "hasClass",
  999. value: function hasClass(className) {}
  1000. /**
  1001. * Sets the specified inline style property on the root Element to the given value.
  1002. * @param {string} property
  1003. * @param {string} value
  1004. */
  1005. }, {
  1006. key: "setStyle",
  1007. value: function setStyle(property, value) {}
  1008. /**
  1009. * Gets the height of the top app bar.
  1010. * @return {number}
  1011. */
  1012. }, {
  1013. key: "getTopAppBarHeight",
  1014. value: function getTopAppBarHeight() {}
  1015. /**
  1016. * Registers an event handler on the navigation icon element for a given event.
  1017. * @param {string} type
  1018. * @param {function(!Event): undefined} handler
  1019. */
  1020. }, {
  1021. key: "registerNavigationIconInteractionHandler",
  1022. value: function registerNavigationIconInteractionHandler(type, handler) {}
  1023. /**
  1024. * Deregisters an event handler on the navigation icon element for a given event.
  1025. * @param {string} type
  1026. * @param {function(!Event): undefined} handler
  1027. */
  1028. }, {
  1029. key: "deregisterNavigationIconInteractionHandler",
  1030. value: function deregisterNavigationIconInteractionHandler(type, handler) {}
  1031. /**
  1032. * Emits an event when the navigation icon is clicked.
  1033. */
  1034. }, {
  1035. key: "notifyNavigationIconClicked",
  1036. value: function notifyNavigationIconClicked() {}
  1037. /** @param {function(!Event)} handler */
  1038. }, {
  1039. key: "registerScrollHandler",
  1040. value: function registerScrollHandler(handler) {}
  1041. /** @param {function(!Event)} handler */
  1042. }, {
  1043. key: "deregisterScrollHandler",
  1044. value: function deregisterScrollHandler(handler) {}
  1045. /** @param {function(!Event)} handler */
  1046. }, {
  1047. key: "registerResizeHandler",
  1048. value: function registerResizeHandler(handler) {}
  1049. /** @param {function(!Event)} handler */
  1050. }, {
  1051. key: "deregisterResizeHandler",
  1052. value: function deregisterResizeHandler(handler) {}
  1053. /** @return {number} */
  1054. }, {
  1055. key: "getViewportScrollY",
  1056. value: function getViewportScrollY() {}
  1057. /** @return {number} */
  1058. }, {
  1059. key: "getTotalActionItems",
  1060. value: function getTotalActionItems() {}
  1061. }]);
  1062. return MDCTopAppBarAdapter;
  1063. }();
  1064. /* unused harmony default export */ var _unused_webpack_default_export = (MDCTopAppBarAdapter);
  1065. /***/ }),
  1066. /* 8 */
  1067. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1068. "use strict";
  1069. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; });
  1070. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  1071. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; });
  1072. /**
  1073. * @license
  1074. * Copyright 2018 Google Inc.
  1075. *
  1076. * Permission is hereby granted, free of charge, to any person obtaining a copy
  1077. * of this software and associated documentation files (the "Software"), to deal
  1078. * in the Software without restriction, including without limitation the rights
  1079. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  1080. * copies of the Software, and to permit persons to whom the Software is
  1081. * furnished to do so, subject to the following conditions:
  1082. *
  1083. * The above copyright notice and this permission notice shall be included in
  1084. * all copies or substantial portions of the Software.
  1085. *
  1086. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  1087. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  1088. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  1089. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  1090. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  1091. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  1092. * THE SOFTWARE.
  1093. */
  1094. /** @enum {string} */
  1095. var cssClasses = {
  1096. FIXED_CLASS: 'mdc-top-app-bar--fixed',
  1097. FIXED_SCROLLED_CLASS: 'mdc-top-app-bar--fixed-scrolled',
  1098. SHORT_CLASS: 'mdc-top-app-bar--short',
  1099. SHORT_HAS_ACTION_ITEM_CLASS: 'mdc-top-app-bar--short-has-action-item',
  1100. SHORT_COLLAPSED_CLASS: 'mdc-top-app-bar--short-collapsed'
  1101. };
  1102. /** @enum {number} */
  1103. var numbers = {
  1104. DEBOUNCE_THROTTLE_RESIZE_TIME_MS: 100,
  1105. MAX_TOP_APP_BAR_HEIGHT: 128
  1106. };
  1107. /** @enum {string} */
  1108. var strings = {
  1109. ACTION_ITEM_SELECTOR: '.mdc-top-app-bar__action-item',
  1110. NAVIGATION_EVENT: 'MDCTopAppBar:nav',
  1111. NAVIGATION_ICON_SELECTOR: '.mdc-top-app-bar__navigation-icon',
  1112. ROOT_SELECTOR: '.mdc-top-app-bar',
  1113. TITLE_SELECTOR: '.mdc-top-app-bar__title'
  1114. };
  1115. /***/ }),
  1116. /* 9 */
  1117. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1118. "use strict";
  1119. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return transformStyleProperties; });
  1120. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getCorrectEventName; });
  1121. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getCorrectPropertyName; });
  1122. /**
  1123. * @license
  1124. * Copyright 2016 Google Inc.
  1125. *
  1126. * Permission is hereby granted, free of charge, to any person obtaining a copy
  1127. * of this software and associated documentation files (the "Software"), to deal
  1128. * in the Software without restriction, including without limitation the rights
  1129. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  1130. * copies of the Software, and to permit persons to whom the Software is
  1131. * furnished to do so, subject to the following conditions:
  1132. *
  1133. * The above copyright notice and this permission notice shall be included in
  1134. * all copies or substantial portions of the Software.
  1135. *
  1136. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  1137. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  1138. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  1139. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  1140. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  1141. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  1142. * THE SOFTWARE.
  1143. */
  1144. /**
  1145. * @typedef {{
  1146. * noPrefix: string,
  1147. * webkitPrefix: string,
  1148. * styleProperty: string
  1149. * }}
  1150. */
  1151. var VendorPropertyMapType = void 0;
  1152. /** @const {Object<string, !VendorPropertyMapType>} */
  1153. var eventTypeMap = {
  1154. 'animationstart': {
  1155. noPrefix: 'animationstart',
  1156. webkitPrefix: 'webkitAnimationStart',
  1157. styleProperty: 'animation'
  1158. },
  1159. 'animationend': {
  1160. noPrefix: 'animationend',
  1161. webkitPrefix: 'webkitAnimationEnd',
  1162. styleProperty: 'animation'
  1163. },
  1164. 'animationiteration': {
  1165. noPrefix: 'animationiteration',
  1166. webkitPrefix: 'webkitAnimationIteration',
  1167. styleProperty: 'animation'
  1168. },
  1169. 'transitionend': {
  1170. noPrefix: 'transitionend',
  1171. webkitPrefix: 'webkitTransitionEnd',
  1172. styleProperty: 'transition'
  1173. }
  1174. };
  1175. /** @const {Object<string, !VendorPropertyMapType>} */
  1176. var cssPropertyMap = {
  1177. 'animation': {
  1178. noPrefix: 'animation',
  1179. webkitPrefix: '-webkit-animation'
  1180. },
  1181. 'transform': {
  1182. noPrefix: 'transform',
  1183. webkitPrefix: '-webkit-transform'
  1184. },
  1185. 'transition': {
  1186. noPrefix: 'transition',
  1187. webkitPrefix: '-webkit-transition'
  1188. }
  1189. };
  1190. /**
  1191. * @param {!Object} windowObj
  1192. * @return {boolean}
  1193. */
  1194. function hasProperShape(windowObj) {
  1195. return windowObj['document'] !== undefined && typeof windowObj['document']['createElement'] === 'function';
  1196. }
  1197. /**
  1198. * @param {string} eventType
  1199. * @return {boolean}
  1200. */
  1201. function eventFoundInMaps(eventType) {
  1202. return eventType in eventTypeMap || eventType in cssPropertyMap;
  1203. }
  1204. /**
  1205. * @param {string} eventType
  1206. * @param {!Object<string, !VendorPropertyMapType>} map
  1207. * @param {!Element} el
  1208. * @return {string}
  1209. */
  1210. function getJavaScriptEventName(eventType, map, el) {
  1211. return map[eventType].styleProperty in el.style ? map[eventType].noPrefix : map[eventType].webkitPrefix;
  1212. }
  1213. /**
  1214. * Helper function to determine browser prefix for CSS3 animation events
  1215. * and property names.
  1216. * @param {!Object} windowObj
  1217. * @param {string} eventType
  1218. * @return {string}
  1219. */
  1220. function getAnimationName(windowObj, eventType) {
  1221. if (!hasProperShape(windowObj) || !eventFoundInMaps(eventType)) {
  1222. return eventType;
  1223. }
  1224. var map = /** @type {!Object<string, !VendorPropertyMapType>} */eventType in eventTypeMap ? eventTypeMap : cssPropertyMap;
  1225. var el = windowObj['document']['createElement']('div');
  1226. var eventName = '';
  1227. if (map === eventTypeMap) {
  1228. eventName = getJavaScriptEventName(eventType, map, el);
  1229. } else {
  1230. eventName = map[eventType].noPrefix in el.style ? map[eventType].noPrefix : map[eventType].webkitPrefix;
  1231. }
  1232. return eventName;
  1233. }
  1234. // Public functions to access getAnimationName() for JavaScript events or CSS
  1235. // property names.
  1236. var transformStyleProperties = ['transform', 'WebkitTransform', 'MozTransform', 'OTransform', 'MSTransform'];
  1237. /**
  1238. * @param {!Object} windowObj
  1239. * @param {string} eventType
  1240. * @return {string}
  1241. */
  1242. function getCorrectEventName(windowObj, eventType) {
  1243. return getAnimationName(windowObj, eventType);
  1244. }
  1245. /**
  1246. * @param {!Object} windowObj
  1247. * @param {string} eventType
  1248. * @return {string}
  1249. */
  1250. function getCorrectPropertyName(windowObj, eventType) {
  1251. return getAnimationName(windowObj, eventType);
  1252. }
  1253. /***/ }),
  1254. /* 10 */
  1255. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1256. "use strict";
  1257. /* unused harmony export MDCTabDimensions */
  1258. /* unused harmony export MDCTabAdapter */
  1259. 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; }; }();
  1260. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1261. /**
  1262. * @license
  1263. * Copyright 2018 Google Inc.
  1264. *
  1265. * Permission is hereby granted, free of charge, to any person obtaining a copy
  1266. * of this software and associated documentation files (the "Software"), to deal
  1267. * in the Software without restriction, including without limitation the rights
  1268. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  1269. * copies of the Software, and to permit persons to whom the Software is
  1270. * furnished to do so, subject to the following conditions:
  1271. *
  1272. * The above copyright notice and this permission notice shall be included in
  1273. * all copies or substantial portions of the Software.
  1274. *
  1275. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  1276. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  1277. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  1278. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  1279. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  1280. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  1281. * THE SOFTWARE.
  1282. */
  1283. /* eslint no-unused-vars: [2, {"args": "none"}] */
  1284. /**
  1285. * MDCTabDimensions provides details about the left and right edges of the Tab
  1286. * root element and the Tab content element. These values are used to determine
  1287. * the visual position of the Tab with respect it's parent container.
  1288. * @typedef {{rootLeft: number, rootRight: number, contentLeft: number, contentRight: number}}
  1289. */
  1290. var MDCTabDimensions = void 0;
  1291. /**
  1292. * Adapter for MDC Tab.
  1293. *
  1294. * Defines the shape of the adapter expected by the foundation. Implement this
  1295. * adapter to integrate the Tab into your framework. See
  1296. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  1297. * for more information.
  1298. *
  1299. * @record
  1300. */
  1301. var MDCTabAdapter = function () {
  1302. function MDCTabAdapter() {
  1303. _classCallCheck(this, MDCTabAdapter);
  1304. }
  1305. _createClass(MDCTabAdapter, [{
  1306. key: "addClass",
  1307. /**
  1308. * Adds the given className to the root element.
  1309. * @param {string} className The className to add
  1310. */
  1311. value: function addClass(className) {}
  1312. /**
  1313. * Removes the given className from the root element.
  1314. * @param {string} className The className to remove
  1315. */
  1316. }, {
  1317. key: "removeClass",
  1318. value: function removeClass(className) {}
  1319. /**
  1320. * Returns whether the root element has the given className.
  1321. * @param {string} className The className to remove
  1322. * @return {boolean}
  1323. */
  1324. }, {
  1325. key: "hasClass",
  1326. value: function hasClass(className) {}
  1327. /**
  1328. * Sets the given attrName of the root element to the given value.
  1329. * @param {string} attr The attribute name to set
  1330. * @param {string} value The value so give the attribute
  1331. */
  1332. }, {
  1333. key: "setAttr",
  1334. value: function setAttr(attr, value) {}
  1335. /**
  1336. * Activates the indicator element.
  1337. * @param {!ClientRect=} previousIndicatorClientRect The client rect of the previously activated indicator
  1338. */
  1339. }, {
  1340. key: "activateIndicator",
  1341. value: function activateIndicator(previousIndicatorClientRect) {}
  1342. /** Deactivates the indicator. */
  1343. }, {
  1344. key: "deactivateIndicator",
  1345. value: function deactivateIndicator() {}
  1346. /**
  1347. * Emits the MDCTab:interacted event for use by parent components
  1348. */
  1349. }, {
  1350. key: "notifyInteracted",
  1351. value: function notifyInteracted() {}
  1352. /**
  1353. * Returns the offsetLeft value of the root element.
  1354. * @return {number}
  1355. */
  1356. }, {
  1357. key: "getOffsetLeft",
  1358. value: function getOffsetLeft() {}
  1359. /**
  1360. * Returns the offsetWidth value of the root element.
  1361. * @return {number}
  1362. */
  1363. }, {
  1364. key: "getOffsetWidth",
  1365. value: function getOffsetWidth() {}
  1366. /**
  1367. * Returns the offsetLeft of the content element.
  1368. * @return {number}
  1369. */
  1370. }, {
  1371. key: "getContentOffsetLeft",
  1372. value: function getContentOffsetLeft() {}
  1373. /**
  1374. * Returns the offsetWidth of the content element.
  1375. * @return {number}
  1376. */
  1377. }, {
  1378. key: "getContentOffsetWidth",
  1379. value: function getContentOffsetWidth() {}
  1380. /**
  1381. * Applies focus to the root element
  1382. */
  1383. }, {
  1384. key: "focus",
  1385. value: function focus() {}
  1386. }]);
  1387. return MDCTabAdapter;
  1388. }();
  1389. /***/ }),
  1390. /* 11 */
  1391. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1392. "use strict";
  1393. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__adapter__ = __webpack_require__(5);
  1394. 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; }; }();
  1395. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1396. /**
  1397. * @license
  1398. * Copyright 2018 Google Inc.
  1399. *
  1400. * Permission is hereby granted, free of charge, to any person obtaining a copy
  1401. * of this software and associated documentation files (the "Software"), to deal
  1402. * in the Software without restriction, including without limitation the rights
  1403. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  1404. * copies of the Software, and to permit persons to whom the Software is
  1405. * furnished to do so, subject to the following conditions:
  1406. *
  1407. * The above copyright notice and this permission notice shall be included in
  1408. * all copies or substantial portions of the Software.
  1409. *
  1410. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  1411. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  1412. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  1413. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  1414. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  1415. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  1416. * THE SOFTWARE.
  1417. */
  1418. /* eslint no-unused-vars: [2, {"args": "none"}] */
  1419. /* eslint-disable no-unused-vars */
  1420. /* eslint-enable no-unused-vars */
  1421. /**
  1422. * @abstract
  1423. */
  1424. var MDCTabScrollerRTL = function () {
  1425. /** @param {!MDCTabScrollerAdapter} adapter */
  1426. function MDCTabScrollerRTL(adapter) {
  1427. _classCallCheck(this, MDCTabScrollerRTL);
  1428. /** @private */
  1429. this.adapter_ = adapter;
  1430. }
  1431. /**
  1432. * @param {number} translateX The current translateX position
  1433. * @return {number}
  1434. * @abstract
  1435. */
  1436. _createClass(MDCTabScrollerRTL, [{
  1437. key: 'getScrollPositionRTL',
  1438. value: function getScrollPositionRTL(translateX) {}
  1439. /**
  1440. * @param {number} scrollX
  1441. * @return {!MDCTabScrollerAnimation}
  1442. * @abstract
  1443. */
  1444. }, {
  1445. key: 'scrollToRTL',
  1446. value: function scrollToRTL(scrollX) {}
  1447. /**
  1448. * @param {number} scrollX
  1449. * @return {!MDCTabScrollerAnimation}
  1450. * @abstract
  1451. */
  1452. }, {
  1453. key: 'incrementScrollRTL',
  1454. value: function incrementScrollRTL(scrollX) {}
  1455. /**
  1456. * @param {number} scrollX The current scrollX position
  1457. * @param {number} translateX The current translateX position
  1458. * @return {number}
  1459. * @abstract
  1460. */
  1461. }, {
  1462. key: 'getAnimatingScrollPosition',
  1463. value: function getAnimatingScrollPosition(scrollX, translateX) {}
  1464. }]);
  1465. return MDCTabScrollerRTL;
  1466. }();
  1467. /* harmony default export */ __webpack_exports__["a"] = (MDCTabScrollerRTL);
  1468. /***/ }),
  1469. /* 12 */
  1470. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1471. "use strict";
  1472. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__constants__ = __webpack_require__(8);
  1473. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(7);
  1474. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_base_foundation__ = __webpack_require__(0);
  1475. 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; };
  1476. 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; }; }();
  1477. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1478. 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; }
  1479. 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; }
  1480. /**
  1481. * @license
  1482. * Copyright 2018 Google Inc.
  1483. *
  1484. * Permission is hereby granted, free of charge, to any person obtaining a copy
  1485. * of this software and associated documentation files (the "Software"), to deal
  1486. * in the Software without restriction, including without limitation the rights
  1487. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  1488. * copies of the Software, and to permit persons to whom the Software is
  1489. * furnished to do so, subject to the following conditions:
  1490. *
  1491. * The above copyright notice and this permission notice shall be included in
  1492. * all copies or substantial portions of the Software.
  1493. *
  1494. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  1495. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  1496. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  1497. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  1498. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  1499. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  1500. * THE SOFTWARE.
  1501. */
  1502. /**
  1503. * @extends {MDCFoundation<!MDCTopAppBarAdapter>}
  1504. */
  1505. var MDCTopAppBarBaseFoundation = function (_MDCFoundation) {
  1506. _inherits(MDCTopAppBarBaseFoundation, _MDCFoundation);
  1507. _createClass(MDCTopAppBarBaseFoundation, null, [{
  1508. key: 'strings',
  1509. /** @return enum {string} */
  1510. get: function get() {
  1511. return __WEBPACK_IMPORTED_MODULE_0__constants__["c" /* strings */];
  1512. }
  1513. /** @return enum {string} */
  1514. }, {
  1515. key: 'cssClasses',
  1516. get: function get() {
  1517. return __WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */];
  1518. }
  1519. /** @return enum {number} */
  1520. }, {
  1521. key: 'numbers',
  1522. get: function get() {
  1523. return __WEBPACK_IMPORTED_MODULE_0__constants__["b" /* numbers */];
  1524. }
  1525. /**
  1526. * {@see MDCTopAppBarAdapter} for typing information on parameters and return
  1527. * types.
  1528. * @return {!MDCTopAppBarAdapter}
  1529. */
  1530. }, {
  1531. key: 'defaultAdapter',
  1532. get: function get() {
  1533. return (/** @type {!MDCTopAppBarAdapter} */{
  1534. hasClass: function hasClass() /* className: string */{},
  1535. addClass: function addClass() /* className: string */{},
  1536. removeClass: function removeClass() /* className: string */{},
  1537. setStyle: function setStyle() /* property: string, value: string */{},
  1538. getTopAppBarHeight: function getTopAppBarHeight() {},
  1539. registerNavigationIconInteractionHandler: function registerNavigationIconInteractionHandler() /* type: string, handler: EventListener */{},
  1540. deregisterNavigationIconInteractionHandler: function deregisterNavigationIconInteractionHandler() /* type: string, handler: EventListener */{},
  1541. notifyNavigationIconClicked: function notifyNavigationIconClicked() {},
  1542. registerScrollHandler: function registerScrollHandler() /* handler: EventListener */{},
  1543. deregisterScrollHandler: function deregisterScrollHandler() /* handler: EventListener */{},
  1544. registerResizeHandler: function registerResizeHandler() /* handler: EventListener */{},
  1545. deregisterResizeHandler: function deregisterResizeHandler() /* handler: EventListener */{},
  1546. getViewportScrollY: function getViewportScrollY() {
  1547. return (/* number */0
  1548. );
  1549. },
  1550. getTotalActionItems: function getTotalActionItems() {
  1551. return (/* number */0
  1552. );
  1553. }
  1554. }
  1555. );
  1556. }
  1557. /**
  1558. * @param {!MDCTopAppBarAdapter} adapter
  1559. */
  1560. }]);
  1561. function MDCTopAppBarBaseFoundation( /** @type {!MDCTopAppBarAdapter} */adapter) {
  1562. _classCallCheck(this, MDCTopAppBarBaseFoundation);
  1563. var _this = _possibleConstructorReturn(this, (MDCTopAppBarBaseFoundation.__proto__ || Object.getPrototypeOf(MDCTopAppBarBaseFoundation)).call(this, _extends(MDCTopAppBarBaseFoundation.defaultAdapter, adapter)));
  1564. _this.navClickHandler_ = function () {
  1565. return _this.adapter_.notifyNavigationIconClicked();
  1566. };
  1567. _this.scrollHandler_ = function () {};
  1568. return _this;
  1569. }
  1570. _createClass(MDCTopAppBarBaseFoundation, [{
  1571. key: 'init',
  1572. value: function init() {
  1573. this.adapter_.registerNavigationIconInteractionHandler('click', this.navClickHandler_);
  1574. }
  1575. }, {
  1576. key: 'destroy',
  1577. value: function destroy() {
  1578. this.adapter_.deregisterNavigationIconInteractionHandler('click', this.navClickHandler_);
  1579. }
  1580. }, {
  1581. key: 'initScrollHandler',
  1582. value: function initScrollHandler() {
  1583. this.adapter_.registerScrollHandler(this.scrollHandler_);
  1584. }
  1585. }, {
  1586. key: 'destroyScrollHandler',
  1587. value: function destroyScrollHandler() {
  1588. this.adapter_.deregisterScrollHandler(this.scrollHandler_);
  1589. }
  1590. }]);
  1591. return MDCTopAppBarBaseFoundation;
  1592. }(__WEBPACK_IMPORTED_MODULE_2__material_base_foundation__["a" /* default */]);
  1593. /* harmony default export */ __webpack_exports__["a"] = (MDCTopAppBarBaseFoundation);
  1594. /***/ }),
  1595. /* 13 */
  1596. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1597. "use strict";
  1598. 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; }; }();
  1599. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1600. /**
  1601. * @license
  1602. * Copyright 2018 Google Inc.
  1603. *
  1604. * Permission is hereby granted, free of charge, to any person obtaining a copy
  1605. * of this software and associated documentation files (the "Software"), to deal
  1606. * in the Software without restriction, including without limitation the rights
  1607. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  1608. * copies of the Software, and to permit persons to whom the Software is
  1609. * furnished to do so, subject to the following conditions:
  1610. *
  1611. * The above copyright notice and this permission notice shall be included in
  1612. * all copies or substantial portions of the Software.
  1613. *
  1614. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  1615. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  1616. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  1617. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  1618. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  1619. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  1620. * THE SOFTWARE.
  1621. */
  1622. /* eslint no-unused-vars: [2, {"args": "none"}] */
  1623. /**
  1624. * Adapter for MDC Drawer
  1625. *
  1626. * Defines the shape of the adapter expected by the foundation. Implement this
  1627. * adapter to integrate the Drawer into your framework. See
  1628. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  1629. * for more information.
  1630. *
  1631. * @record
  1632. */
  1633. var MDCDrawerAdapter = function () {
  1634. function MDCDrawerAdapter() {
  1635. _classCallCheck(this, MDCDrawerAdapter);
  1636. }
  1637. _createClass(MDCDrawerAdapter, [{
  1638. key: "addClass",
  1639. /**
  1640. * Adds a class to the root Element.
  1641. * @param {string} className
  1642. */
  1643. value: function addClass(className) {}
  1644. /**
  1645. * Removes a class from the root Element.
  1646. * @param {string} className
  1647. */
  1648. }, {
  1649. key: "removeClass",
  1650. value: function removeClass(className) {}
  1651. /**
  1652. * Returns true if the root Element contains the given class.
  1653. * @param {string} className
  1654. * @return {boolean}
  1655. */
  1656. }, {
  1657. key: "hasClass",
  1658. value: function hasClass(className) {}
  1659. /**
  1660. * @param {!Element} element target element to verify class name
  1661. * @param {string} className class name
  1662. */
  1663. }, {
  1664. key: "elementHasClass",
  1665. value: function elementHasClass(element, className) {}
  1666. /** @return {!ClientRect} */
  1667. }, {
  1668. key: "computeBoundingRect",
  1669. value: function computeBoundingRect() {}
  1670. /**
  1671. * Saves the focus of currently active element.
  1672. */
  1673. }, {
  1674. key: "saveFocus",
  1675. value: function saveFocus() {}
  1676. /**
  1677. * Restores focus to element previously saved with 'saveFocus'.
  1678. */
  1679. }, {
  1680. key: "restoreFocus",
  1681. value: function restoreFocus() {}
  1682. /**
  1683. * Focuses the active / selected navigation item.
  1684. */
  1685. }, {
  1686. key: "focusActiveNavigationItem",
  1687. value: function focusActiveNavigationItem() {}
  1688. /**
  1689. * Emits a custom event "MDCDrawer:closed" denoting the drawer has closed.
  1690. */
  1691. }, {
  1692. key: "notifyClose",
  1693. value: function notifyClose() {}
  1694. /**
  1695. * Emits a custom event "MDCDrawer:opened" denoting the drawer has opened.
  1696. */
  1697. }, {
  1698. key: "notifyOpen",
  1699. value: function notifyOpen() {}
  1700. /**
  1701. * Traps focus on root element and focuses the active navigation element.
  1702. */
  1703. }, {
  1704. key: "trapFocus",
  1705. value: function trapFocus() {}
  1706. /**
  1707. * Releases focus trap from root element which was set by `trapFocus`
  1708. * and restores focus to where it was prior to calling `trapFocus`.
  1709. */
  1710. }, {
  1711. key: "releaseFocus",
  1712. value: function releaseFocus() {}
  1713. }]);
  1714. return MDCDrawerAdapter;
  1715. }();
  1716. /* unused harmony default export */ var _unused_webpack_default_export = (MDCDrawerAdapter);
  1717. /***/ }),
  1718. /* 14 */
  1719. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1720. "use strict";
  1721. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  1722. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCList", function() { return MDCList; });
  1723. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  1724. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(15);
  1725. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__adapter__ = __webpack_require__(32);
  1726. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__constants__ = __webpack_require__(33);
  1727. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCListFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__foundation__["a"]; });
  1728. 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; };
  1729. 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; }; }();
  1730. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1731. 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; }
  1732. 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; }
  1733. /**
  1734. * @license
  1735. * Copyright 2018 Google Inc.
  1736. *
  1737. * Permission is hereby granted, free of charge, to any person obtaining a copy
  1738. * of this software and associated documentation files (the "Software"), to deal
  1739. * in the Software without restriction, including without limitation the rights
  1740. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  1741. * copies of the Software, and to permit persons to whom the Software is
  1742. * furnished to do so, subject to the following conditions:
  1743. *
  1744. * The above copyright notice and this permission notice shall be included in
  1745. * all copies or substantial portions of the Software.
  1746. *
  1747. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  1748. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  1749. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  1750. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  1751. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  1752. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  1753. * THE SOFTWARE.
  1754. */
  1755. /**
  1756. * @extends MDCComponent<!MDCListFoundation>
  1757. */
  1758. var MDCList = function (_MDCComponent) {
  1759. _inherits(MDCList, _MDCComponent);
  1760. /** @param {...?} args */
  1761. function MDCList() {
  1762. var _ref;
  1763. _classCallCheck(this, MDCList);
  1764. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  1765. args[_key] = arguments[_key];
  1766. }
  1767. /** @private {!Function} */
  1768. var _this = _possibleConstructorReturn(this, (_ref = MDCList.__proto__ || Object.getPrototypeOf(MDCList)).call.apply(_ref, [this].concat(args)));
  1769. _this.handleKeydown_;
  1770. /** @private {!Function} */
  1771. _this.handleClick_;
  1772. /** @private {!Function} */
  1773. _this.focusInEventListener_;
  1774. /** @private {!Function} */
  1775. _this.focusOutEventListener_;
  1776. return _this;
  1777. }
  1778. /**
  1779. * @param {!Element} root
  1780. * @return {!MDCList}
  1781. */
  1782. _createClass(MDCList, [{
  1783. key: 'destroy',
  1784. value: function destroy() {
  1785. this.root_.removeEventListener('keydown', this.handleKeydown_);
  1786. this.root_.removeEventListener('click', this.handleClick_);
  1787. this.root_.removeEventListener('focusin', this.focusInEventListener_);
  1788. this.root_.removeEventListener('focusout', this.focusOutEventListener_);
  1789. }
  1790. }, {
  1791. key: 'initialSyncWithDOM',
  1792. value: function initialSyncWithDOM() {
  1793. this.handleClick_ = this.foundation_.handleClick.bind(this.foundation_);
  1794. this.handleKeydown_ = this.handleKeydownEvent_.bind(this);
  1795. this.focusInEventListener_ = this.handleFocusInEvent_.bind(this);
  1796. this.focusOutEventListener_ = this.handleFocusOutEvent_.bind(this);
  1797. this.root_.addEventListener('keydown', this.handleKeydown_);
  1798. this.root_.addEventListener('focusin', this.focusInEventListener_);
  1799. this.root_.addEventListener('focusout', this.focusOutEventListener_);
  1800. this.layout();
  1801. this.initializeListType();
  1802. }
  1803. }, {
  1804. key: 'layout',
  1805. value: function layout() {
  1806. var direction = this.root_.getAttribute(__WEBPACK_IMPORTED_MODULE_3__constants__["b" /* strings */].ARIA_ORIENTATION);
  1807. this.vertical = direction !== __WEBPACK_IMPORTED_MODULE_3__constants__["b" /* strings */].ARIA_ORIENTATION_HORIZONTAL;
  1808. // List items need to have at least tabindex=-1 to be focusable.
  1809. [].slice.call(this.root_.querySelectorAll('.mdc-list-item:not([tabindex])')).forEach(function (ele) {
  1810. ele.setAttribute('tabindex', -1);
  1811. });
  1812. // Child button/a elements are not tabbable until the list item is focused.
  1813. [].slice.call(this.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_3__constants__["b" /* strings */].FOCUSABLE_CHILD_ELEMENTS)).forEach(function (ele) {
  1814. return ele.setAttribute('tabindex', -1);
  1815. });
  1816. }
  1817. /**
  1818. * Used to figure out which list item this event is targetting. Or returns -1 if
  1819. * there is no list item
  1820. * @param {Event} evt
  1821. * @private
  1822. */
  1823. }, {
  1824. key: 'getListItemIndex_',
  1825. value: function getListItemIndex_(evt) {
  1826. var eventTarget = /** @type {HTMLElement} */evt.target;
  1827. var index = -1;
  1828. // Find the first ancestor that is a list item or the list.
  1829. while (!eventTarget.classList.contains(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].LIST_ITEM_CLASS) && !eventTarget.classList.contains(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].ROOT)) {
  1830. eventTarget = eventTarget.parentElement;
  1831. }
  1832. // Get the index of the element if it is a list item.
  1833. if (eventTarget.classList.contains(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].LIST_ITEM_CLASS)) {
  1834. index = this.listElements.indexOf(eventTarget);
  1835. }
  1836. return index;
  1837. }
  1838. /**
  1839. * Used to figure out which element was clicked before sending the event to the foundation.
  1840. * @param {Event} evt
  1841. * @private
  1842. */
  1843. }, {
  1844. key: 'handleFocusInEvent_',
  1845. value: function handleFocusInEvent_(evt) {
  1846. var index = this.getListItemIndex_(evt);
  1847. this.foundation_.handleFocusIn(evt, index);
  1848. }
  1849. /**
  1850. * Used to figure out which element was clicked before sending the event to the foundation.
  1851. * @param {Event} evt
  1852. * @private
  1853. */
  1854. }, {
  1855. key: 'handleFocusOutEvent_',
  1856. value: function handleFocusOutEvent_(evt) {
  1857. var index = this.getListItemIndex_(evt);
  1858. this.foundation_.handleFocusOut(evt, index);
  1859. }
  1860. /**
  1861. * Used to figure out which element was clicked before sending the event to the foundation.
  1862. * @param {Event} evt
  1863. * @private
  1864. */
  1865. }, {
  1866. key: 'handleKeydownEvent_',
  1867. value: function handleKeydownEvent_(evt) {
  1868. var index = this.getListItemIndex_(evt);
  1869. if (index >= 0) {
  1870. this.foundation_.handleKeydown(evt, evt.target.classList.contains(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].LIST_ITEM_CLASS), index);
  1871. }
  1872. }
  1873. }, {
  1874. key: 'initializeListType',
  1875. value: function initializeListType() {
  1876. // Automatically set single selection if selected/activated classes are present.
  1877. var preselectedElement = this.root_.querySelector('.' + __WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].LIST_ITEM_ACTIVATED_CLASS + ', .' + __WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].LIST_ITEM_SELECTED_CLASS);
  1878. if (preselectedElement) {
  1879. if (preselectedElement.classList.contains(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].LIST_ITEM_ACTIVATED_CLASS)) {
  1880. this.foundation_.setUseActivatedClass(true);
  1881. }
  1882. this.singleSelection = true;
  1883. this.selectedIndex = this.listElements.indexOf(preselectedElement);
  1884. }
  1885. }
  1886. /** @param {boolean} value */
  1887. }, {
  1888. key: 'getDefaultFoundation',
  1889. /** @return {!MDCListFoundation} */
  1890. value: function getDefaultFoundation() {
  1891. var _this2 = this;
  1892. return new __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]( /** @type {!MDCListAdapter} */_extends({
  1893. getListItemCount: function getListItemCount() {
  1894. return _this2.listElements.length;
  1895. },
  1896. getFocusedElementIndex: function getFocusedElementIndex() {
  1897. return _this2.listElements.indexOf(document.activeElement);
  1898. },
  1899. setAttributeForElementIndex: function setAttributeForElementIndex(index, attr, value) {
  1900. var element = _this2.listElements[index];
  1901. if (element) {
  1902. element.setAttribute(attr, value);
  1903. }
  1904. },
  1905. removeAttributeForElementIndex: function removeAttributeForElementIndex(index, attr) {
  1906. var element = _this2.listElements[index];
  1907. if (element) {
  1908. element.removeAttribute(attr);
  1909. }
  1910. },
  1911. addClassForElementIndex: function addClassForElementIndex(index, className) {
  1912. var element = _this2.listElements[index];
  1913. if (element) {
  1914. element.classList.add(className);
  1915. }
  1916. },
  1917. removeClassForElementIndex: function removeClassForElementIndex(index, className) {
  1918. var element = _this2.listElements[index];
  1919. if (element) {
  1920. element.classList.remove(className);
  1921. }
  1922. },
  1923. focusItemAtIndex: function focusItemAtIndex(index) {
  1924. var element = _this2.listElements[index];
  1925. if (element) {
  1926. element.focus();
  1927. }
  1928. },
  1929. setTabIndexForListItemChildren: function setTabIndexForListItemChildren(listItemIndex, tabIndexValue) {
  1930. var element = _this2.listElements[listItemIndex];
  1931. var listItemChildren = [].slice.call(element.querySelectorAll(__WEBPACK_IMPORTED_MODULE_3__constants__["b" /* strings */].FOCUSABLE_CHILD_ELEMENTS));
  1932. listItemChildren.forEach(function (ele) {
  1933. return ele.setAttribute('tabindex', tabIndexValue);
  1934. });
  1935. },
  1936. followHref: function followHref(index) {
  1937. var listItem = _this2.listElements[index];
  1938. if (listItem && listItem.href) {
  1939. listItem.click();
  1940. }
  1941. }
  1942. }));
  1943. }
  1944. }, {
  1945. key: 'vertical',
  1946. set: function set(value) {
  1947. this.foundation_.setVerticalOrientation(value);
  1948. }
  1949. /** @return Array<!Element>*/
  1950. }, {
  1951. key: 'listElements',
  1952. get: function get() {
  1953. return [].slice.call(this.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_3__constants__["b" /* strings */].ENABLED_ITEMS_SELECTOR));
  1954. }
  1955. /** @param {boolean} value */
  1956. }, {
  1957. key: 'wrapFocus',
  1958. set: function set(value) {
  1959. this.foundation_.setWrapFocus(value);
  1960. }
  1961. /** @param {boolean} isSingleSelectionList */
  1962. }, {
  1963. key: 'singleSelection',
  1964. set: function set(isSingleSelectionList) {
  1965. if (isSingleSelectionList) {
  1966. this.root_.addEventListener('click', this.handleClick_);
  1967. } else {
  1968. this.root_.removeEventListener('click', this.handleClick_);
  1969. }
  1970. this.foundation_.setSingleSelection(isSingleSelectionList);
  1971. }
  1972. /** @param {number} index */
  1973. }, {
  1974. key: 'selectedIndex',
  1975. set: function set(index) {
  1976. this.foundation_.setSelectedIndex(index);
  1977. }
  1978. }], [{
  1979. key: 'attachTo',
  1980. value: function attachTo(root) {
  1981. return new MDCList(root);
  1982. }
  1983. }]);
  1984. return MDCList;
  1985. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  1986. /***/ }),
  1987. /* 15 */
  1988. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1989. "use strict";
  1990. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  1991. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(32);
  1992. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(33);
  1993. 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; };
  1994. 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; }; }();
  1995. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1996. 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; }
  1997. 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; }
  1998. /**
  1999. * @license
  2000. * Copyright 2018 Google Inc.
  2001. *
  2002. * Permission is hereby granted, free of charge, to any person obtaining a copy
  2003. * of this software and associated documentation files (the "Software"), to deal
  2004. * in the Software without restriction, including without limitation the rights
  2005. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  2006. * copies of the Software, and to permit persons to whom the Software is
  2007. * furnished to do so, subject to the following conditions:
  2008. *
  2009. * The above copyright notice and this permission notice shall be included in
  2010. * all copies or substantial portions of the Software.
  2011. *
  2012. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  2013. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  2014. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  2015. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  2016. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  2017. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  2018. * THE SOFTWARE.
  2019. */
  2020. var ELEMENTS_KEY_ALLOWED_IN = ['input', 'button', 'textarea', 'select'];
  2021. var MDCListFoundation = function (_MDCFoundation) {
  2022. _inherits(MDCListFoundation, _MDCFoundation);
  2023. _createClass(MDCListFoundation, null, [{
  2024. key: 'strings',
  2025. /** @return enum {string} */
  2026. get: function get() {
  2027. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  2028. }
  2029. /** @return enum {string} */
  2030. }, {
  2031. key: 'cssClasses',
  2032. get: function get() {
  2033. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  2034. }
  2035. /**
  2036. * {@see MDCListAdapter} for typing information on parameters and return
  2037. * types.
  2038. * @return {!MDCListAdapter}
  2039. */
  2040. }, {
  2041. key: 'defaultAdapter',
  2042. get: function get() {
  2043. return (/** @type {!MDCListAdapter} */{
  2044. getListItemCount: function getListItemCount() {},
  2045. getFocusedElementIndex: function getFocusedElementIndex() {},
  2046. setAttributeForElementIndex: function setAttributeForElementIndex() {},
  2047. removeAttributeForElementIndex: function removeAttributeForElementIndex() {},
  2048. addClassForElementIndex: function addClassForElementIndex() {},
  2049. removeClassForElementIndex: function removeClassForElementIndex() {},
  2050. focusItemAtIndex: function focusItemAtIndex() {},
  2051. setTabIndexForListItemChildren: function setTabIndexForListItemChildren() {},
  2052. followHref: function followHref() {}
  2053. }
  2054. );
  2055. }
  2056. /**
  2057. * @param {!MDCListAdapter=} adapter
  2058. */
  2059. }]);
  2060. function MDCListFoundation(adapter) {
  2061. _classCallCheck(this, MDCListFoundation);
  2062. /** {boolean} */
  2063. var _this = _possibleConstructorReturn(this, (MDCListFoundation.__proto__ || Object.getPrototypeOf(MDCListFoundation)).call(this, _extends(MDCListFoundation.defaultAdapter, adapter)));
  2064. _this.wrapFocus_ = false;
  2065. /** {boolean} */
  2066. _this.isVertical_ = true;
  2067. /** {boolean} */
  2068. _this.isSingleSelectionList_ = false;
  2069. /** {number} */
  2070. _this.selectedIndex_ = -1;
  2071. /** {boolean} */
  2072. _this.useActivatedClass_ = false;
  2073. return _this;
  2074. }
  2075. /**
  2076. * Sets the private wrapFocus_ variable.
  2077. * @param {boolean} value
  2078. */
  2079. _createClass(MDCListFoundation, [{
  2080. key: 'setWrapFocus',
  2081. value: function setWrapFocus(value) {
  2082. this.wrapFocus_ = value;
  2083. }
  2084. /**
  2085. * Sets the isVertical_ private variable.
  2086. * @param {boolean} value
  2087. */
  2088. }, {
  2089. key: 'setVerticalOrientation',
  2090. value: function setVerticalOrientation(value) {
  2091. this.isVertical_ = value;
  2092. }
  2093. /**
  2094. * Sets the isSingleSelectionList_ private variable.
  2095. * @param {boolean} value
  2096. */
  2097. }, {
  2098. key: 'setSingleSelection',
  2099. value: function setSingleSelection(value) {
  2100. this.isSingleSelectionList_ = value;
  2101. }
  2102. /**
  2103. * Sets the useActivatedClass_ private variable.
  2104. * @param {boolean} useActivated
  2105. */
  2106. }, {
  2107. key: 'setUseActivatedClass',
  2108. value: function setUseActivatedClass(useActivated) {
  2109. this.useActivatedClass_ = useActivated;
  2110. }
  2111. /** @param {number} index */
  2112. }, {
  2113. key: 'setSelectedIndex',
  2114. value: function setSelectedIndex(index) {
  2115. if (index === this.selectedIndex_) {
  2116. return;
  2117. }
  2118. var className = this.useActivatedClass_ ? __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LIST_ITEM_ACTIVATED_CLASS : __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LIST_ITEM_SELECTED_CLASS;
  2119. if (this.selectedIndex_ >= 0) {
  2120. this.adapter_.removeAttributeForElementIndex(this.selectedIndex_, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_SELECTED);
  2121. this.adapter_.removeClassForElementIndex(this.selectedIndex_, className);
  2122. this.adapter_.setAttributeForElementIndex(this.selectedIndex_, 'tabindex', -1);
  2123. }
  2124. if (index >= 0 && this.adapter_.getListItemCount() > index) {
  2125. this.selectedIndex_ = index;
  2126. this.adapter_.setAttributeForElementIndex(this.selectedIndex_, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_SELECTED, true);
  2127. this.adapter_.addClassForElementIndex(this.selectedIndex_, className);
  2128. this.adapter_.setAttributeForElementIndex(this.selectedIndex_, 'tabindex', 0);
  2129. if (this.selectedIndex_ !== 0) {
  2130. this.adapter_.setAttributeForElementIndex(0, 'tabindex', -1);
  2131. }
  2132. }
  2133. }
  2134. /**
  2135. * Focus in handler for the list items.
  2136. * @param evt
  2137. * @param {number} listItemIndex
  2138. */
  2139. }, {
  2140. key: 'handleFocusIn',
  2141. value: function handleFocusIn(evt, listItemIndex) {
  2142. if (listItemIndex >= 0) {
  2143. this.adapter_.setTabIndexForListItemChildren(listItemIndex, 0);
  2144. }
  2145. }
  2146. /**
  2147. * Focus out handler for the list items.
  2148. * @param {Event} evt
  2149. * @param {number} listItemIndex
  2150. */
  2151. }, {
  2152. key: 'handleFocusOut',
  2153. value: function handleFocusOut(evt, listItemIndex) {
  2154. if (listItemIndex >= 0) {
  2155. this.adapter_.setTabIndexForListItemChildren(listItemIndex, -1);
  2156. }
  2157. }
  2158. /**
  2159. * Key handler for the list.
  2160. * @param {Event} evt
  2161. * @param {boolean} isRootListItem
  2162. * @param {number} listItemIndex
  2163. */
  2164. }, {
  2165. key: 'handleKeydown',
  2166. value: function handleKeydown(evt, isRootListItem, listItemIndex) {
  2167. var arrowLeft = evt.key === 'ArrowLeft' || evt.keyCode === 37;
  2168. var arrowUp = evt.key === 'ArrowUp' || evt.keyCode === 38;
  2169. var arrowRight = evt.key === 'ArrowRight' || evt.keyCode === 39;
  2170. var arrowDown = evt.key === 'ArrowDown' || evt.keyCode === 40;
  2171. var isHome = evt.key === 'Home' || evt.keyCode === 36;
  2172. var isEnd = evt.key === 'End' || evt.keyCode === 35;
  2173. var isEnter = evt.key === 'Enter' || evt.keyCode === 13;
  2174. var isSpace = evt.key === 'Space' || evt.keyCode === 32;
  2175. var currentIndex = this.adapter_.getFocusedElementIndex();
  2176. if (currentIndex === -1) {
  2177. currentIndex = listItemIndex;
  2178. if (currentIndex < 0) {
  2179. // If this event doesn't have a mdc-list-item ancestor from the
  2180. // current list (not from a sublist), return early.
  2181. return;
  2182. }
  2183. }
  2184. if (this.isVertical_ && arrowDown || !this.isVertical_ && arrowRight) {
  2185. this.preventDefaultEvent_(evt);
  2186. this.focusNextElement(currentIndex);
  2187. } else if (this.isVertical_ && arrowUp || !this.isVertical_ && arrowLeft) {
  2188. this.preventDefaultEvent_(evt);
  2189. this.focusPrevElement(currentIndex);
  2190. } else if (isHome) {
  2191. this.preventDefaultEvent_(evt);
  2192. this.focusFirstElement();
  2193. } else if (isEnd) {
  2194. this.preventDefaultEvent_(evt);
  2195. this.focusLastElement();
  2196. } else if (this.isSingleSelectionList_ && (isEnter || isSpace)) {
  2197. this.preventDefaultEvent_(evt);
  2198. // Check if the space key was pressed on the list item or a child element.
  2199. if (isRootListItem) {
  2200. this.setSelectedIndex(currentIndex);
  2201. // Explicitly activate links, since we're preventing default on Enter, and Space doesn't activate them.
  2202. this.adapter_.followHref(currentIndex);
  2203. }
  2204. }
  2205. }
  2206. /**
  2207. * Click handler for the list.
  2208. */
  2209. }, {
  2210. key: 'handleClick',
  2211. value: function handleClick() {
  2212. var currentIndex = this.adapter_.getFocusedElementIndex();
  2213. if (currentIndex === -1) return;
  2214. this.setSelectedIndex(currentIndex);
  2215. }
  2216. /**
  2217. * Ensures that preventDefault is only called if the containing element doesn't
  2218. * consume the event, and it will cause an unintended scroll.
  2219. * @param {Event} evt
  2220. * @private
  2221. */
  2222. }, {
  2223. key: 'preventDefaultEvent_',
  2224. value: function preventDefaultEvent_(evt) {
  2225. var tagName = ('' + evt.target.tagName).toLowerCase();
  2226. if (ELEMENTS_KEY_ALLOWED_IN.indexOf(tagName) === -1) {
  2227. evt.preventDefault();
  2228. }
  2229. }
  2230. /**
  2231. * Focuses the next element on the list.
  2232. * @param {number} index
  2233. */
  2234. }, {
  2235. key: 'focusNextElement',
  2236. value: function focusNextElement(index) {
  2237. var count = this.adapter_.getListItemCount();
  2238. var nextIndex = index + 1;
  2239. if (nextIndex >= count) {
  2240. if (this.wrapFocus_) {
  2241. nextIndex = 0;
  2242. } else {
  2243. // Return early because last item is already focused.
  2244. return;
  2245. }
  2246. }
  2247. this.adapter_.focusItemAtIndex(nextIndex);
  2248. }
  2249. /**
  2250. * Focuses the previous element on the list.
  2251. * @param {number} index
  2252. */
  2253. }, {
  2254. key: 'focusPrevElement',
  2255. value: function focusPrevElement(index) {
  2256. var prevIndex = index - 1;
  2257. if (prevIndex < 0) {
  2258. if (this.wrapFocus_) {
  2259. prevIndex = this.adapter_.getListItemCount() - 1;
  2260. } else {
  2261. // Return early because first item is already focused.
  2262. return;
  2263. }
  2264. }
  2265. this.adapter_.focusItemAtIndex(prevIndex);
  2266. }
  2267. }, {
  2268. key: 'focusFirstElement',
  2269. value: function focusFirstElement() {
  2270. if (this.adapter_.getListItemCount() > 0) {
  2271. this.adapter_.focusItemAtIndex(0);
  2272. }
  2273. }
  2274. }, {
  2275. key: 'focusLastElement',
  2276. value: function focusLastElement() {
  2277. var lastIndex = this.adapter_.getListItemCount() - 1;
  2278. if (lastIndex >= 0) {
  2279. this.adapter_.focusItemAtIndex(lastIndex);
  2280. }
  2281. }
  2282. }]);
  2283. return MDCListFoundation;
  2284. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  2285. /* harmony default export */ __webpack_exports__["a"] = (MDCListFoundation);
  2286. /***/ }),
  2287. /* 16 */
  2288. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2289. "use strict";
  2290. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  2291. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCFloatingLabel", function() { return MDCFloatingLabel; });
  2292. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  2293. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(35);
  2294. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(79);
  2295. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCFloatingLabelFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  2296. 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; }; }();
  2297. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2298. 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; }
  2299. 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; }
  2300. /**
  2301. * @license
  2302. * Copyright 2016 Google Inc.
  2303. *
  2304. * Permission is hereby granted, free of charge, to any person obtaining a copy
  2305. * of this software and associated documentation files (the "Software"), to deal
  2306. * in the Software without restriction, including without limitation the rights
  2307. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  2308. * copies of the Software, and to permit persons to whom the Software is
  2309. * furnished to do so, subject to the following conditions:
  2310. *
  2311. * The above copyright notice and this permission notice shall be included in
  2312. * all copies or substantial portions of the Software.
  2313. *
  2314. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  2315. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  2316. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  2317. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  2318. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  2319. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  2320. * THE SOFTWARE.
  2321. */
  2322. /**
  2323. * @extends {MDCComponent<!MDCFloatingLabelFoundation>}
  2324. * @final
  2325. */
  2326. var MDCFloatingLabel = function (_MDCComponent) {
  2327. _inherits(MDCFloatingLabel, _MDCComponent);
  2328. function MDCFloatingLabel() {
  2329. _classCallCheck(this, MDCFloatingLabel);
  2330. return _possibleConstructorReturn(this, (MDCFloatingLabel.__proto__ || Object.getPrototypeOf(MDCFloatingLabel)).apply(this, arguments));
  2331. }
  2332. _createClass(MDCFloatingLabel, [{
  2333. key: 'shake',
  2334. /**
  2335. * Styles the label to produce the label shake for errors.
  2336. * @param {boolean} shouldShake styles the label to shake by adding shake class
  2337. * if true, otherwise will stop shaking by removing shake class.
  2338. */
  2339. value: function shake(shouldShake) {
  2340. this.foundation_.shake(shouldShake);
  2341. }
  2342. /**
  2343. * Styles label to float/dock.
  2344. * @param {boolean} shouldFloat styles the label to float by adding float class
  2345. * if true, otherwise docks the label by removing the float class.
  2346. */
  2347. }, {
  2348. key: 'float',
  2349. value: function float(shouldFloat) {
  2350. this.foundation_.float(shouldFloat);
  2351. }
  2352. /**
  2353. * @return {number}
  2354. */
  2355. }, {
  2356. key: 'getWidth',
  2357. value: function getWidth() {
  2358. return this.foundation_.getWidth();
  2359. }
  2360. /**
  2361. * @return {!MDCFloatingLabelFoundation}
  2362. */
  2363. }, {
  2364. key: 'getDefaultFoundation',
  2365. value: function getDefaultFoundation() {
  2366. var _this2 = this;
  2367. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]({
  2368. addClass: function addClass(className) {
  2369. return _this2.root_.classList.add(className);
  2370. },
  2371. removeClass: function removeClass(className) {
  2372. return _this2.root_.classList.remove(className);
  2373. },
  2374. getWidth: function getWidth() {
  2375. return _this2.root_.offsetWidth;
  2376. },
  2377. registerInteractionHandler: function registerInteractionHandler(evtType, handler) {
  2378. return _this2.root_.addEventListener(evtType, handler);
  2379. },
  2380. deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) {
  2381. return _this2.root_.removeEventListener(evtType, handler);
  2382. }
  2383. });
  2384. }
  2385. }], [{
  2386. key: 'attachTo',
  2387. /**
  2388. * @param {!Element} root
  2389. * @return {!MDCFloatingLabel}
  2390. */
  2391. value: function attachTo(root) {
  2392. return new MDCFloatingLabel(root);
  2393. }
  2394. }]);
  2395. return MDCFloatingLabel;
  2396. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  2397. /***/ }),
  2398. /* 17 */
  2399. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2400. "use strict";
  2401. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  2402. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCLineRipple", function() { return MDCLineRipple; });
  2403. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  2404. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(36);
  2405. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(99);
  2406. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCLineRippleFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  2407. 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; };
  2408. 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; }; }();
  2409. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2410. 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; }
  2411. 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; }
  2412. /**
  2413. * @license
  2414. * Copyright 2018 Google Inc.
  2415. *
  2416. * Permission is hereby granted, free of charge, to any person obtaining a copy
  2417. * of this software and associated documentation files (the "Software"), to deal
  2418. * in the Software without restriction, including without limitation the rights
  2419. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  2420. * copies of the Software, and to permit persons to whom the Software is
  2421. * furnished to do so, subject to the following conditions:
  2422. *
  2423. * The above copyright notice and this permission notice shall be included in
  2424. * all copies or substantial portions of the Software.
  2425. *
  2426. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  2427. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  2428. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  2429. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  2430. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  2431. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  2432. * THE SOFTWARE.
  2433. */
  2434. /**
  2435. * @extends {MDCComponent<!MDCLineRippleFoundation>}
  2436. * @final
  2437. */
  2438. var MDCLineRipple = function (_MDCComponent) {
  2439. _inherits(MDCLineRipple, _MDCComponent);
  2440. function MDCLineRipple() {
  2441. _classCallCheck(this, MDCLineRipple);
  2442. return _possibleConstructorReturn(this, (MDCLineRipple.__proto__ || Object.getPrototypeOf(MDCLineRipple)).apply(this, arguments));
  2443. }
  2444. _createClass(MDCLineRipple, [{
  2445. key: 'activate',
  2446. /**
  2447. * Activates the line ripple
  2448. */
  2449. value: function activate() {
  2450. this.foundation_.activate();
  2451. }
  2452. /**
  2453. * Deactivates the line ripple
  2454. */
  2455. }, {
  2456. key: 'deactivate',
  2457. value: function deactivate() {
  2458. this.foundation_.deactivate();
  2459. }
  2460. /**
  2461. * Sets the transform origin given a user's click location. The `rippleCenter` is the
  2462. * x-coordinate of the middle of the ripple.
  2463. * @param {number} xCoordinate
  2464. */
  2465. }, {
  2466. key: 'setRippleCenter',
  2467. value: function setRippleCenter(xCoordinate) {
  2468. this.foundation_.setRippleCenter(xCoordinate);
  2469. }
  2470. /**
  2471. * @return {!MDCLineRippleFoundation}
  2472. */
  2473. }, {
  2474. key: 'getDefaultFoundation',
  2475. value: function getDefaultFoundation() {
  2476. var _this2 = this;
  2477. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]( /** @type {!MDCLineRippleAdapter} */_extends({
  2478. addClass: function addClass(className) {
  2479. return _this2.root_.classList.add(className);
  2480. },
  2481. removeClass: function removeClass(className) {
  2482. return _this2.root_.classList.remove(className);
  2483. },
  2484. hasClass: function hasClass(className) {
  2485. return _this2.root_.classList.contains(className);
  2486. },
  2487. setStyle: function setStyle(propertyName, value) {
  2488. return _this2.root_.style[propertyName] = value;
  2489. },
  2490. registerEventHandler: function registerEventHandler(evtType, handler) {
  2491. return _this2.root_.addEventListener(evtType, handler);
  2492. },
  2493. deregisterEventHandler: function deregisterEventHandler(evtType, handler) {
  2494. return _this2.root_.removeEventListener(evtType, handler);
  2495. }
  2496. }));
  2497. }
  2498. }], [{
  2499. key: 'attachTo',
  2500. /**
  2501. * @param {!Element} root
  2502. * @return {!MDCLineRipple}
  2503. */
  2504. value: function attachTo(root) {
  2505. return new MDCLineRipple(root);
  2506. }
  2507. }]);
  2508. return MDCLineRipple;
  2509. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  2510. /***/ }),
  2511. /* 18 */
  2512. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2513. "use strict";
  2514. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return MDCMenuSurfaceFoundation; });
  2515. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AnchorMargin; });
  2516. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  2517. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(38);
  2518. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(39);
  2519. 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; };
  2520. 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; }; }();
  2521. 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; }
  2522. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2523. 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; }
  2524. 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; }
  2525. /**
  2526. * @license
  2527. * Copyright 2018 Google Inc.
  2528. *
  2529. * Permission is hereby granted, free of charge, to any person obtaining a copy
  2530. * of this software and associated documentation files (the "Software"), to deal
  2531. * in the Software without restriction, including without limitation the rights
  2532. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  2533. * copies of the Software, and to permit persons to whom the Software is
  2534. * furnished to do so, subject to the following conditions:
  2535. *
  2536. * The above copyright notice and this permission notice shall be included in
  2537. * all copies or substantial portions of the Software.
  2538. *
  2539. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  2540. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  2541. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  2542. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  2543. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  2544. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  2545. * THE SOFTWARE.
  2546. */
  2547. /**
  2548. * @typedef {{
  2549. * top: number,
  2550. * right: number,
  2551. * bottom: number,
  2552. * left: number
  2553. * }}
  2554. */
  2555. var AnchorMargin = void 0;
  2556. /* eslint-disable no-unused-vars */
  2557. /**
  2558. * @typedef {{
  2559. * viewport: { width: number, height: number },
  2560. * viewportDistance: {top: number, right: number, bottom: number, left: number},
  2561. * anchorHeight: number,
  2562. * anchorWidth: number,
  2563. * surfaceHeight: number,
  2564. * surfaceWidth: number,
  2565. * bodyDimensions,
  2566. * windowScroll,
  2567. * }}
  2568. */
  2569. var AutoLayoutMeasurements = void 0;
  2570. /* eslint-enable no-unused-vars */
  2571. /**
  2572. * @extends {MDCFoundation<!MDCMenuSurfaceAdapter>}
  2573. */
  2574. var MDCMenuSurfaceFoundation = function (_MDCFoundation) {
  2575. _inherits(MDCMenuSurfaceFoundation, _MDCFoundation);
  2576. _createClass(MDCMenuSurfaceFoundation, null, [{
  2577. key: 'cssClasses',
  2578. /** @return enum{cssClasses} */
  2579. get: function get() {
  2580. return __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* cssClasses */];
  2581. }
  2582. /** @return enum{string} */
  2583. }, {
  2584. key: 'strings',
  2585. get: function get() {
  2586. return __WEBPACK_IMPORTED_MODULE_2__constants__["e" /* strings */];
  2587. }
  2588. /** @return enum {number} */
  2589. }, {
  2590. key: 'numbers',
  2591. get: function get() {
  2592. return __WEBPACK_IMPORTED_MODULE_2__constants__["d" /* numbers */];
  2593. }
  2594. /** @return enum{number} */
  2595. }, {
  2596. key: 'Corner',
  2597. get: function get() {
  2598. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* Corner */];
  2599. }
  2600. /**
  2601. * {@see MDCMenuSurfaceAdapter} for typing information on parameters and return
  2602. * types.
  2603. * @return {!MDCMenuSurfaceAdapter}
  2604. */
  2605. }, {
  2606. key: 'defaultAdapter',
  2607. get: function get() {
  2608. return (/** @type {!MDCMenuSurfaceAdapter} */{
  2609. addClass: function addClass() {},
  2610. removeClass: function removeClass() {},
  2611. hasClass: function hasClass() {
  2612. return false;
  2613. },
  2614. hasAnchor: function hasAnchor() {
  2615. return false;
  2616. },
  2617. notifyClose: function notifyClose() {},
  2618. notifyOpen: function notifyOpen() {},
  2619. isElementInContainer: function isElementInContainer() {
  2620. return false;
  2621. },
  2622. isRtl: function isRtl() {
  2623. return false;
  2624. },
  2625. setTransformOrigin: function setTransformOrigin() {},
  2626. isFocused: function isFocused() {
  2627. return false;
  2628. },
  2629. saveFocus: function saveFocus() {},
  2630. restoreFocus: function restoreFocus() {},
  2631. isFirstElementFocused: function isFirstElementFocused() {},
  2632. isLastElementFocused: function isLastElementFocused() {},
  2633. focusFirstElement: function focusFirstElement() {},
  2634. focusLastElement: function focusLastElement() {},
  2635. getInnerDimensions: function getInnerDimensions() {
  2636. return {};
  2637. },
  2638. getAnchorDimensions: function getAnchorDimensions() {
  2639. return {};
  2640. },
  2641. getWindowDimensions: function getWindowDimensions() {
  2642. return {};
  2643. },
  2644. getBodyDimensions: function getBodyDimensions() {
  2645. return {};
  2646. },
  2647. getWindowScroll: function getWindowScroll() {
  2648. return {};
  2649. },
  2650. setPosition: function setPosition() {},
  2651. setMaxHeight: function setMaxHeight() {}
  2652. }
  2653. );
  2654. }
  2655. /** @param {!MDCMenuSurfaceAdapter} adapter */
  2656. }]);
  2657. function MDCMenuSurfaceFoundation(adapter) {
  2658. _classCallCheck(this, MDCMenuSurfaceFoundation);
  2659. /** @private {boolean} */
  2660. var _this = _possibleConstructorReturn(this, (MDCMenuSurfaceFoundation.__proto__ || Object.getPrototypeOf(MDCMenuSurfaceFoundation)).call(this, _extends(MDCMenuSurfaceFoundation.defaultAdapter, adapter)));
  2661. _this.isOpen_ = false;
  2662. /** @private {number} */
  2663. _this.openAnimationEndTimerId_ = 0;
  2664. /** @private {number} */
  2665. _this.closeAnimationEndTimerId_ = 0;
  2666. /** @private {number} */
  2667. _this.animationRequestId_ = 0;
  2668. /** @private {!{ width: number, height: number }} */
  2669. _this.dimensions_;
  2670. /** @private {!Corner} */
  2671. _this.anchorCorner_ = __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* Corner */].TOP_START;
  2672. /** @private {!AnchorMargin} */
  2673. _this.anchorMargin_ = { top: 0, right: 0, bottom: 0, left: 0 };
  2674. /** @private {?AutoLayoutMeasurements} */
  2675. _this.measures_ = null;
  2676. /** @private {boolean} */
  2677. _this.quickOpen_ = false;
  2678. /** @private {boolean} */
  2679. _this.hoistedElement_ = false;
  2680. /** @private {boolean} */
  2681. _this.isFixedPosition_ = false;
  2682. /** @private {!{x: number, y: number}} */
  2683. _this.position_ = { x: 0, y: 0 };
  2684. return _this;
  2685. }
  2686. _createClass(MDCMenuSurfaceFoundation, [{
  2687. key: 'init',
  2688. value: function init() {
  2689. var _MDCMenuSurfaceFounda = MDCMenuSurfaceFoundation.cssClasses,
  2690. ROOT = _MDCMenuSurfaceFounda.ROOT,
  2691. OPEN = _MDCMenuSurfaceFounda.OPEN;
  2692. if (!this.adapter_.hasClass(ROOT)) {
  2693. throw new Error(ROOT + ' class required in root element.');
  2694. }
  2695. if (this.adapter_.hasClass(OPEN)) {
  2696. this.isOpen_ = true;
  2697. }
  2698. }
  2699. }, {
  2700. key: 'destroy',
  2701. value: function destroy() {
  2702. clearTimeout(this.openAnimationEndTimerId_);
  2703. clearTimeout(this.closeAnimationEndTimerId_);
  2704. // Cancel any currently running animations.
  2705. cancelAnimationFrame(this.animationRequestId_);
  2706. }
  2707. /**
  2708. * @param {!Corner} corner Default anchor corner alignment of top-left menu surface corner.
  2709. */
  2710. }, {
  2711. key: 'setAnchorCorner',
  2712. value: function setAnchorCorner(corner) {
  2713. this.anchorCorner_ = corner;
  2714. }
  2715. /**
  2716. * @param {!AnchorMargin} margin set of margin values from anchor.
  2717. */
  2718. }, {
  2719. key: 'setAnchorMargin',
  2720. value: function setAnchorMargin(margin) {
  2721. this.anchorMargin_.top = typeof margin.top === 'number' ? margin.top : 0;
  2722. this.anchorMargin_.right = typeof margin.right === 'number' ? margin.right : 0;
  2723. this.anchorMargin_.bottom = typeof margin.bottom === 'number' ? margin.bottom : 0;
  2724. this.anchorMargin_.left = typeof margin.left === 'number' ? margin.left : 0;
  2725. }
  2726. /**
  2727. * Used to indicate if the menu-surface is hoisted to the body.
  2728. * @param {boolean} isHoisted
  2729. */
  2730. }, {
  2731. key: 'setIsHoisted',
  2732. value: function setIsHoisted(isHoisted) {
  2733. this.hoistedElement_ = isHoisted;
  2734. }
  2735. /**
  2736. * Used to set the menu-surface calculations based on a fixed position menu.
  2737. * @param {boolean} isFixedPosition
  2738. */
  2739. }, {
  2740. key: 'setFixedPosition',
  2741. value: function setFixedPosition(isFixedPosition) {
  2742. this.isFixedPosition_ = isFixedPosition;
  2743. }
  2744. /**
  2745. * Sets the menu-surface position on the page.
  2746. * @param {number} x
  2747. * @param {number} y
  2748. */
  2749. }, {
  2750. key: 'setAbsolutePosition',
  2751. value: function setAbsolutePosition(x, y) {
  2752. this.position_.x = this.typeCheckisFinite_(x) ? x : 0;
  2753. this.position_.y = this.typeCheckisFinite_(y) ? y : 0;
  2754. }
  2755. /** @param {boolean} quickOpen */
  2756. }, {
  2757. key: 'setQuickOpen',
  2758. value: function setQuickOpen(quickOpen) {
  2759. this.quickOpen_ = quickOpen;
  2760. }
  2761. /**
  2762. * Handle clicks and close if not within menu-surface element.
  2763. * @param {!Event} evt
  2764. */
  2765. }, {
  2766. key: 'handleBodyClick',
  2767. value: function handleBodyClick(evt) {
  2768. var el = evt.target;
  2769. if (this.adapter_.isElementInContainer(el)) {
  2770. return;
  2771. }
  2772. this.close();
  2773. }
  2774. }, {
  2775. key: 'handleKeydown',
  2776. /**
  2777. * Handle keys that close the surface.
  2778. * @param {!Event} evt
  2779. */
  2780. value: function handleKeydown(evt) {
  2781. var keyCode = evt.keyCode,
  2782. key = evt.key,
  2783. shiftKey = evt.shiftKey;
  2784. var isEscape = key === 'Escape' || keyCode === 27;
  2785. var isTab = key === 'Tab' || keyCode === 9;
  2786. if (isEscape) {
  2787. this.close();
  2788. } else if (isTab) {
  2789. if (this.adapter_.isLastElementFocused() && !shiftKey) {
  2790. this.adapter_.focusFirstElement();
  2791. evt.preventDefault();
  2792. } else if (this.adapter_.isFirstElementFocused() && shiftKey) {
  2793. this.adapter_.focusLastElement();
  2794. evt.preventDefault();
  2795. }
  2796. }
  2797. }
  2798. /**
  2799. * @return {!AutoLayoutMeasurements} Measurements used to position menu surface popup.
  2800. */
  2801. }, {
  2802. key: 'getAutoLayoutMeasurements_',
  2803. value: function getAutoLayoutMeasurements_() {
  2804. var anchorRect = this.adapter_.getAnchorDimensions();
  2805. var viewport = this.adapter_.getWindowDimensions();
  2806. var bodyDimensions = this.adapter_.getBodyDimensions();
  2807. var windowScroll = this.adapter_.getWindowScroll();
  2808. if (!anchorRect) {
  2809. anchorRect = /** @type {ClientRect} */{
  2810. x: this.position_.x,
  2811. y: this.position_.y,
  2812. top: this.position_.y,
  2813. bottom: this.position_.y,
  2814. left: this.position_.x,
  2815. right: this.position_.x,
  2816. height: 0,
  2817. width: 0
  2818. };
  2819. }
  2820. return {
  2821. viewport: viewport,
  2822. bodyDimensions: bodyDimensions,
  2823. windowScroll: windowScroll,
  2824. viewportDistance: {
  2825. top: anchorRect.top,
  2826. right: viewport.width - anchorRect.right,
  2827. left: anchorRect.left,
  2828. bottom: viewport.height - anchorRect.bottom
  2829. },
  2830. anchorHeight: anchorRect.height,
  2831. anchorWidth: anchorRect.width,
  2832. surfaceHeight: this.dimensions_.height,
  2833. surfaceWidth: this.dimensions_.width
  2834. };
  2835. }
  2836. /**
  2837. * Computes the corner of the anchor from which to animate and position the menu surface.
  2838. * @return {!Corner}
  2839. * @private
  2840. */
  2841. }, {
  2842. key: 'getOriginCorner_',
  2843. value: function getOriginCorner_() {
  2844. // Defaults: open from the top left.
  2845. var corner = __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* Corner */].TOP_LEFT;
  2846. var _measures_ = this.measures_,
  2847. viewportDistance = _measures_.viewportDistance,
  2848. anchorHeight = _measures_.anchorHeight,
  2849. anchorWidth = _measures_.anchorWidth,
  2850. surfaceHeight = _measures_.surfaceHeight,
  2851. surfaceWidth = _measures_.surfaceWidth;
  2852. var isBottomAligned = Boolean(this.anchorCorner_ & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].BOTTOM);
  2853. var availableTop = isBottomAligned ? viewportDistance.top + anchorHeight + this.anchorMargin_.bottom : viewportDistance.top + this.anchorMargin_.top;
  2854. var availableBottom = isBottomAligned ? viewportDistance.bottom - this.anchorMargin_.bottom : viewportDistance.bottom + anchorHeight - this.anchorMargin_.top;
  2855. var topOverflow = surfaceHeight - availableTop;
  2856. var bottomOverflow = surfaceHeight - availableBottom;
  2857. if (bottomOverflow > 0 && topOverflow < bottomOverflow) {
  2858. corner |= __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].BOTTOM;
  2859. }
  2860. var isRtl = this.adapter_.isRtl();
  2861. var isFlipRtl = Boolean(this.anchorCorner_ & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].FLIP_RTL);
  2862. var avoidHorizontalOverlap = Boolean(this.anchorCorner_ & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].RIGHT);
  2863. var isAlignedRight = avoidHorizontalOverlap && !isRtl || !avoidHorizontalOverlap && isFlipRtl && isRtl;
  2864. var availableLeft = isAlignedRight ? viewportDistance.left + anchorWidth + this.anchorMargin_.right : viewportDistance.left + this.anchorMargin_.left;
  2865. var availableRight = isAlignedRight ? viewportDistance.right - this.anchorMargin_.right : viewportDistance.right + anchorWidth - this.anchorMargin_.left;
  2866. var leftOverflow = surfaceWidth - availableLeft;
  2867. var rightOverflow = surfaceWidth - availableRight;
  2868. if (leftOverflow < 0 && isAlignedRight && isRtl || avoidHorizontalOverlap && !isAlignedRight && leftOverflow < 0 || rightOverflow > 0 && leftOverflow < rightOverflow) {
  2869. corner |= __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].RIGHT;
  2870. }
  2871. return (/** @type {Corner} */corner
  2872. );
  2873. }
  2874. /**
  2875. * @param {!Corner} corner Origin corner of the menu surface.
  2876. * @return {number} Horizontal offset of menu surface origin corner from corresponding anchor corner.
  2877. * @private
  2878. */
  2879. }, {
  2880. key: 'getHorizontalOriginOffset_',
  2881. value: function getHorizontalOriginOffset_(corner) {
  2882. var anchorWidth = this.measures_.anchorWidth;
  2883. // isRightAligned corresponds to using the 'right' property on the surface.
  2884. var isRightAligned = Boolean(corner & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].RIGHT);
  2885. var avoidHorizontalOverlap = Boolean(this.anchorCorner_ & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].RIGHT);
  2886. if (isRightAligned) {
  2887. var rightOffset = avoidHorizontalOverlap ? anchorWidth - this.anchorMargin_.left : this.anchorMargin_.right;
  2888. // For hoisted or fixed elements, adjust the offset by the difference between viewport width and body width so
  2889. // when we calculate the right value (`adjustPositionForHoistedElement_`) based on the element position,
  2890. // the right property is correct.
  2891. if (this.hoistedElement_ || this.isFixedPosition_) {
  2892. return rightOffset - (this.measures_.viewport.width - this.measures_.bodyDimensions.width);
  2893. }
  2894. return rightOffset;
  2895. }
  2896. return avoidHorizontalOverlap ? anchorWidth - this.anchorMargin_.right : this.anchorMargin_.left;
  2897. }
  2898. /**
  2899. * @param {!Corner} corner Origin corner of the menu surface.
  2900. * @return {number} Vertical offset of menu surface origin corner from corresponding anchor corner.
  2901. * @private
  2902. */
  2903. }, {
  2904. key: 'getVerticalOriginOffset_',
  2905. value: function getVerticalOriginOffset_(corner) {
  2906. var anchorHeight = this.measures_.anchorHeight;
  2907. var isBottomAligned = Boolean(corner & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].BOTTOM);
  2908. var avoidVerticalOverlap = Boolean(this.anchorCorner_ & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].BOTTOM);
  2909. var y = 0;
  2910. if (isBottomAligned) {
  2911. y = avoidVerticalOverlap ? anchorHeight - this.anchorMargin_.top : -this.anchorMargin_.bottom;
  2912. } else {
  2913. y = avoidVerticalOverlap ? anchorHeight + this.anchorMargin_.bottom : this.anchorMargin_.top;
  2914. }
  2915. return y;
  2916. }
  2917. /**
  2918. * @param {!Corner} corner Origin corner of the menu surface.
  2919. * @return {number} Maximum height of the menu surface, based on available space. 0 indicates should not be set.
  2920. * @private
  2921. */
  2922. }, {
  2923. key: 'getMenuSurfaceMaxHeight_',
  2924. value: function getMenuSurfaceMaxHeight_(corner) {
  2925. var maxHeight = 0;
  2926. var viewportDistance = this.measures_.viewportDistance;
  2927. var isBottomAligned = Boolean(corner & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].BOTTOM);
  2928. var MARGIN_TO_EDGE = MDCMenuSurfaceFoundation.numbers.MARGIN_TO_EDGE;
  2929. // When maximum height is not specified, it is handled from css.
  2930. if (isBottomAligned) {
  2931. maxHeight = viewportDistance.top + this.anchorMargin_.top - MARGIN_TO_EDGE;
  2932. if (!(this.anchorCorner_ & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].BOTTOM)) {
  2933. maxHeight += this.measures_.anchorHeight;
  2934. }
  2935. } else {
  2936. maxHeight = viewportDistance.bottom - this.anchorMargin_.bottom + this.measures_.anchorHeight - MARGIN_TO_EDGE;
  2937. if (this.anchorCorner_ & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].BOTTOM) {
  2938. maxHeight -= this.measures_.anchorHeight;
  2939. }
  2940. }
  2941. return maxHeight;
  2942. }
  2943. /** @private */
  2944. }, {
  2945. key: 'autoPosition_',
  2946. value: function autoPosition_() {
  2947. var _position;
  2948. // Compute measurements for autoposition methods reuse.
  2949. this.measures_ = this.getAutoLayoutMeasurements_();
  2950. var corner = this.getOriginCorner_();
  2951. var maxMenuSurfaceHeight = this.getMenuSurfaceMaxHeight_(corner);
  2952. var verticalAlignment = corner & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].BOTTOM ? 'bottom' : 'top';
  2953. var horizontalAlignment = corner & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].RIGHT ? 'right' : 'left';
  2954. var horizontalOffset = this.getHorizontalOriginOffset_(corner);
  2955. var verticalOffset = this.getVerticalOriginOffset_(corner);
  2956. var position = (_position = {}, _defineProperty(_position, horizontalAlignment, horizontalOffset ? horizontalOffset : '0'), _defineProperty(_position, verticalAlignment, verticalOffset ? verticalOffset : '0'), _position);
  2957. var _measures_2 = this.measures_,
  2958. anchorWidth = _measures_2.anchorWidth,
  2959. surfaceWidth = _measures_2.surfaceWidth;
  2960. // Center align when anchor width is comparable or greater than menu surface, otherwise keep corner.
  2961. if (anchorWidth / surfaceWidth > __WEBPACK_IMPORTED_MODULE_2__constants__["d" /* numbers */].ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO) {
  2962. horizontalAlignment = 'center';
  2963. }
  2964. // If the menu-surface has been hoisted to the body, it's no longer relative to the anchor element
  2965. if (this.hoistedElement_ || this.isFixedPosition_) {
  2966. position = this.adjustPositionForHoistedElement_(position);
  2967. }
  2968. for (var prop in position) {
  2969. if (position.hasOwnProperty(prop) && position[prop] !== '0') {
  2970. position[prop] = parseInt(position[prop], 10) + 'px';
  2971. }
  2972. }
  2973. this.adapter_.setTransformOrigin(horizontalAlignment + ' ' + verticalAlignment);
  2974. this.adapter_.setPosition(position);
  2975. this.adapter_.setMaxHeight(maxMenuSurfaceHeight ? maxMenuSurfaceHeight + 'px' : '');
  2976. // Clear measures after positioning is complete.
  2977. this.measures_ = null;
  2978. }
  2979. /**
  2980. * Calculates the offsets for positioning the menu-surface when the menu-surface has been
  2981. * hoisted to the body.
  2982. * @param {!{
  2983. * top: (string|undefined),
  2984. * right: (string|undefined),
  2985. * bottom: (string|undefined),
  2986. * left: (string|undefined)
  2987. * }} position
  2988. * @return {!{
  2989. * top: (string|undefined),
  2990. * right: (string|undefined),
  2991. * bottom: (string|undefined),
  2992. * left: (string|undefined)
  2993. * }} position
  2994. * @private
  2995. */
  2996. }, {
  2997. key: 'adjustPositionForHoistedElement_',
  2998. value: function adjustPositionForHoistedElement_(position) {
  2999. var _measures_3 = this.measures_,
  3000. bodyDimensions = _measures_3.bodyDimensions,
  3001. windowScroll = _measures_3.windowScroll,
  3002. viewport = _measures_3.viewport,
  3003. viewportDistance = _measures_3.viewportDistance;
  3004. for (var prop in position) {
  3005. if (position.hasOwnProperty(prop)) {
  3006. // Hoisted surfaces need to have the anchor elements location on the page added to the
  3007. // position properties for proper alignment on the body.
  3008. if (viewportDistance.hasOwnProperty(prop)) {
  3009. position[prop] = parseInt(position[prop], 10) + viewportDistance[prop];
  3010. }
  3011. // Surfaces that are absolutely positioned need to have additional calculations for scroll
  3012. // and bottom positioning.
  3013. if (!this.isFixedPosition_ && prop === 'top') {
  3014. position[prop] = parseInt(position[prop], 10) + windowScroll.y;
  3015. } else if (!this.isFixedPosition_ && prop === 'bottom') {
  3016. position[prop] = bodyDimensions.height - (viewport.height + windowScroll.y) + parseInt(position[prop], 10);
  3017. }
  3018. }
  3019. }
  3020. return position;
  3021. }
  3022. /**
  3023. * Open the menu surface.
  3024. */
  3025. }, {
  3026. key: 'open',
  3027. value: function open() {
  3028. var _this2 = this;
  3029. this.adapter_.saveFocus();
  3030. if (!this.quickOpen_) {
  3031. this.adapter_.addClass(MDCMenuSurfaceFoundation.cssClasses.ANIMATING_OPEN);
  3032. }
  3033. this.animationRequestId_ = requestAnimationFrame(function () {
  3034. _this2.adapter_.addClass(MDCMenuSurfaceFoundation.cssClasses.OPEN);
  3035. _this2.dimensions_ = _this2.adapter_.getInnerDimensions();
  3036. _this2.autoPosition_();
  3037. if (_this2.quickOpen_) {
  3038. _this2.adapter_.notifyOpen();
  3039. } else {
  3040. _this2.openAnimationEndTimerId_ = setTimeout(function () {
  3041. _this2.openAnimationEndTimerId_ = 0;
  3042. _this2.adapter_.removeClass(MDCMenuSurfaceFoundation.cssClasses.ANIMATING_OPEN);
  3043. _this2.adapter_.notifyOpen();
  3044. }, __WEBPACK_IMPORTED_MODULE_2__constants__["d" /* numbers */].TRANSITION_OPEN_DURATION);
  3045. }
  3046. });
  3047. this.isOpen_ = true;
  3048. }
  3049. /**
  3050. * Closes the menu surface.
  3051. */
  3052. }, {
  3053. key: 'close',
  3054. value: function close() {
  3055. var _this3 = this;
  3056. if (!this.quickOpen_) {
  3057. this.adapter_.addClass(MDCMenuSurfaceFoundation.cssClasses.ANIMATING_CLOSED);
  3058. }
  3059. requestAnimationFrame(function () {
  3060. _this3.adapter_.removeClass(MDCMenuSurfaceFoundation.cssClasses.OPEN);
  3061. if (_this3.quickOpen_) {
  3062. _this3.adapter_.notifyClose();
  3063. } else {
  3064. _this3.closeAnimationEndTimerId_ = setTimeout(function () {
  3065. _this3.closeAnimationEndTimerId_ = 0;
  3066. _this3.adapter_.removeClass(MDCMenuSurfaceFoundation.cssClasses.ANIMATING_CLOSED);
  3067. _this3.adapter_.notifyClose();
  3068. }, __WEBPACK_IMPORTED_MODULE_2__constants__["d" /* numbers */].TRANSITION_CLOSE_DURATION);
  3069. }
  3070. });
  3071. this.isOpen_ = false;
  3072. this.maybeRestoreFocus_();
  3073. }
  3074. /**
  3075. * The last focused element when the menu surface was opened should regain focus, if the user is
  3076. * focused on or within the menu surface when it is closed.
  3077. * @private
  3078. */
  3079. }, {
  3080. key: 'maybeRestoreFocus_',
  3081. value: function maybeRestoreFocus_() {
  3082. if (this.adapter_.isFocused() || this.adapter_.isElementInContainer(document.activeElement)) {
  3083. this.adapter_.restoreFocus();
  3084. }
  3085. }
  3086. /** @return {boolean} */
  3087. }, {
  3088. key: 'isOpen',
  3089. value: function isOpen() {
  3090. return this.isOpen_;
  3091. }
  3092. /**
  3093. * isFinite that doesn't force conversion to number type.
  3094. * Equivalent to Number.isFinite in ES2015, but is not included in IE11.
  3095. * @param {number} num
  3096. * @return {boolean}
  3097. * @private
  3098. */
  3099. }, {
  3100. key: 'typeCheckisFinite_',
  3101. value: function typeCheckisFinite_(num) {
  3102. return typeof num === 'number' && isFinite(num);
  3103. }
  3104. }]);
  3105. return MDCMenuSurfaceFoundation;
  3106. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  3107. /***/ }),
  3108. /* 19 */
  3109. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3110. "use strict";
  3111. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  3112. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCNotchedOutline", function() { return MDCNotchedOutline; });
  3113. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  3114. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(41);
  3115. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(105);
  3116. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__constants__ = __webpack_require__(42);
  3117. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCNotchedOutlineFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  3118. 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; }; }();
  3119. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3120. 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; }
  3121. 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; }
  3122. /**
  3123. * @license
  3124. * Copyright 2017 Google Inc.
  3125. *
  3126. * Permission is hereby granted, free of charge, to any person obtaining a copy
  3127. * of this software and associated documentation files (the "Software"), to deal
  3128. * in the Software without restriction, including without limitation the rights
  3129. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  3130. * copies of the Software, and to permit persons to whom the Software is
  3131. * furnished to do so, subject to the following conditions:
  3132. *
  3133. * The above copyright notice and this permission notice shall be included in
  3134. * all copies or substantial portions of the Software.
  3135. *
  3136. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  3137. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  3138. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  3139. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  3140. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  3141. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  3142. * THE SOFTWARE.
  3143. */
  3144. /**
  3145. * @extends {MDCComponent<!MDCNotchedOutlineFoundation>}
  3146. * @final
  3147. */
  3148. var MDCNotchedOutline = function (_MDCComponent) {
  3149. _inherits(MDCNotchedOutline, _MDCComponent);
  3150. function MDCNotchedOutline() {
  3151. _classCallCheck(this, MDCNotchedOutline);
  3152. return _possibleConstructorReturn(this, (MDCNotchedOutline.__proto__ || Object.getPrototypeOf(MDCNotchedOutline)).apply(this, arguments));
  3153. }
  3154. _createClass(MDCNotchedOutline, [{
  3155. key: 'notch',
  3156. /**
  3157. * Updates outline selectors and SVG path to open notch.
  3158. * @param {number} notchWidth The notch width in the outline.
  3159. * @param {boolean=} isRtl Determines if outline is rtl. If rtl is true, notch
  3160. * will be right justified in outline path, otherwise left justified.
  3161. */
  3162. value: function notch(notchWidth, isRtl) {
  3163. this.foundation_.notch(notchWidth, isRtl);
  3164. }
  3165. /**
  3166. * Updates the outline selectors to close notch and return it to idle state.
  3167. */
  3168. }, {
  3169. key: 'closeNotch',
  3170. value: function closeNotch() {
  3171. this.foundation_.closeNotch();
  3172. }
  3173. /**
  3174. * @return {!MDCNotchedOutlineFoundation}
  3175. */
  3176. }, {
  3177. key: 'getDefaultFoundation',
  3178. value: function getDefaultFoundation() {
  3179. var _this2 = this;
  3180. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]({
  3181. getWidth: function getWidth() {
  3182. return _this2.root_.offsetWidth;
  3183. },
  3184. getHeight: function getHeight() {
  3185. return _this2.root_.offsetHeight;
  3186. },
  3187. addClass: function addClass(className) {
  3188. return _this2.root_.classList.add(className);
  3189. },
  3190. removeClass: function removeClass(className) {
  3191. return _this2.root_.classList.remove(className);
  3192. },
  3193. setOutlinePathAttr: function setOutlinePathAttr(value) {
  3194. var path = _this2.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["b" /* strings */].PATH_SELECTOR);
  3195. path.setAttribute('d', value);
  3196. },
  3197. getIdleOutlineStyleValue: function getIdleOutlineStyleValue(propertyName) {
  3198. var idleOutlineElement = _this2.root_.parentNode.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["b" /* strings */].IDLE_OUTLINE_SELECTOR);
  3199. return window.getComputedStyle(idleOutlineElement).getPropertyValue(propertyName);
  3200. }
  3201. });
  3202. }
  3203. }], [{
  3204. key: 'attachTo',
  3205. /**
  3206. * @param {!Element} root
  3207. * @return {!MDCNotchedOutline}
  3208. */
  3209. value: function attachTo(root) {
  3210. return new MDCNotchedOutline(root);
  3211. }
  3212. }]);
  3213. return MDCNotchedOutline;
  3214. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  3215. /***/ }),
  3216. /* 20 */
  3217. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3218. "use strict";
  3219. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  3220. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTab", function() { return MDCTab; });
  3221. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  3222. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__ = __webpack_require__(2);
  3223. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_tab_indicator_index__ = __webpack_require__(47);
  3224. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__adapter__ = __webpack_require__(10);
  3225. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation__ = __webpack_require__(124);
  3226. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTabFoundation", function() { return __WEBPACK_IMPORTED_MODULE_4__foundation__["a"]; });
  3227. 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; };
  3228. 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; }; }();
  3229. 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); } };
  3230. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3231. 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; }
  3232. 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; }
  3233. /**
  3234. * @license
  3235. * Copyright 2018 Google Inc.
  3236. *
  3237. * Permission is hereby granted, free of charge, to any person obtaining a copy
  3238. * of this software and associated documentation files (the "Software"), to deal
  3239. * in the Software without restriction, including without limitation the rights
  3240. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  3241. * copies of the Software, and to permit persons to whom the Software is
  3242. * furnished to do so, subject to the following conditions:
  3243. *
  3244. * The above copyright notice and this permission notice shall be included in
  3245. * all copies or substantial portions of the Software.
  3246. *
  3247. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  3248. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  3249. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  3250. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  3251. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  3252. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  3253. * THE SOFTWARE.
  3254. */
  3255. /* eslint-disable no-unused-vars */
  3256. /* eslint-enable no-unused-vars */
  3257. /**
  3258. * @extends {MDCComponent<!MDCTabFoundation>}
  3259. * @final
  3260. */
  3261. var MDCTab = function (_MDCComponent) {
  3262. _inherits(MDCTab, _MDCComponent);
  3263. /**
  3264. * @param {...?} args
  3265. */
  3266. function MDCTab() {
  3267. var _ref;
  3268. _classCallCheck(this, MDCTab);
  3269. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  3270. args[_key] = arguments[_key];
  3271. }
  3272. /** @private {?MDCRipple} */
  3273. var _this = _possibleConstructorReturn(this, (_ref = MDCTab.__proto__ || Object.getPrototypeOf(MDCTab)).call.apply(_ref, [this].concat(args)));
  3274. _this.ripple_;
  3275. /** @private {?MDCTabIndicator} */
  3276. _this.tabIndicator_;
  3277. /** @private {?Element} */
  3278. _this.content_;
  3279. /** @private {?Function} */
  3280. _this.handleClick_;
  3281. return _this;
  3282. }
  3283. /**
  3284. * @param {!Element} root
  3285. * @return {!MDCTab}
  3286. */
  3287. _createClass(MDCTab, [{
  3288. key: 'initialize',
  3289. value: function initialize() {
  3290. var rippleFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (el, foundation) {
  3291. return new __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRipple"](el, foundation);
  3292. };
  3293. var tabIndicatorFactory = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (el) {
  3294. return new __WEBPACK_IMPORTED_MODULE_2__material_tab_indicator_index__["MDCTabIndicator"](el);
  3295. };
  3296. var rippleSurface = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* default */].strings.RIPPLE_SELECTOR);
  3297. var rippleAdapter = _extends(__WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRipple"].createAdapter( /** @type {!RippleCapableSurface} */this), {
  3298. addClass: function addClass(className) {
  3299. return rippleSurface.classList.add(className);
  3300. },
  3301. removeClass: function removeClass(className) {
  3302. return rippleSurface.classList.remove(className);
  3303. },
  3304. updateCssVariable: function updateCssVariable(varName, value) {
  3305. return rippleSurface.style.setProperty(varName, value);
  3306. }
  3307. });
  3308. var rippleFoundation = new __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRippleFoundation"](rippleAdapter);
  3309. this.ripple_ = rippleFactory(this.root_, rippleFoundation);
  3310. var tabIndicatorElement = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* default */].strings.TAB_INDICATOR_SELECTOR);
  3311. this.tabIndicator_ = tabIndicatorFactory(tabIndicatorElement);
  3312. this.content_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* default */].strings.CONTENT_SELECTOR);
  3313. }
  3314. }, {
  3315. key: 'initialSyncWithDOM',
  3316. value: function initialSyncWithDOM() {
  3317. this.handleClick_ = this.foundation_.handleClick.bind(this.foundation_);
  3318. this.listen('click', this.handleClick_);
  3319. }
  3320. }, {
  3321. key: 'destroy',
  3322. value: function destroy() {
  3323. this.unlisten('click', /** @type {!Function} */this.handleClick_);
  3324. this.ripple_.destroy();
  3325. _get(MDCTab.prototype.__proto__ || Object.getPrototypeOf(MDCTab.prototype), 'destroy', this).call(this);
  3326. }
  3327. /**
  3328. * @return {!MDCTabFoundation}
  3329. */
  3330. }, {
  3331. key: 'getDefaultFoundation',
  3332. value: function getDefaultFoundation() {
  3333. var _this2 = this;
  3334. return new __WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* default */](
  3335. /** @type {!MDCTabAdapter} */{
  3336. setAttr: function setAttr(attr, value) {
  3337. return _this2.root_.setAttribute(attr, value);
  3338. },
  3339. addClass: function addClass(className) {
  3340. return _this2.root_.classList.add(className);
  3341. },
  3342. removeClass: function removeClass(className) {
  3343. return _this2.root_.classList.remove(className);
  3344. },
  3345. hasClass: function hasClass(className) {
  3346. return _this2.root_.classList.contains(className);
  3347. },
  3348. activateIndicator: function activateIndicator(previousIndicatorClientRect) {
  3349. return _this2.tabIndicator_.activate(previousIndicatorClientRect);
  3350. },
  3351. deactivateIndicator: function deactivateIndicator() {
  3352. return _this2.tabIndicator_.deactivate();
  3353. },
  3354. notifyInteracted: function notifyInteracted() {
  3355. return _this2.emit(__WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* default */].strings.INTERACTED_EVENT, { tab: _this2 }, true /* bubble */);
  3356. },
  3357. getOffsetLeft: function getOffsetLeft() {
  3358. return _this2.root_.offsetLeft;
  3359. },
  3360. getOffsetWidth: function getOffsetWidth() {
  3361. return _this2.root_.offsetWidth;
  3362. },
  3363. getContentOffsetLeft: function getContentOffsetLeft() {
  3364. return _this2.content_.offsetLeft;
  3365. },
  3366. getContentOffsetWidth: function getContentOffsetWidth() {
  3367. return _this2.content_.offsetWidth;
  3368. },
  3369. focus: function focus() {
  3370. return _this2.root_.focus();
  3371. }
  3372. });
  3373. }
  3374. /**
  3375. * Getter for the active state of the tab
  3376. * @return {boolean}
  3377. */
  3378. }, {
  3379. key: 'activate',
  3380. /**
  3381. * Activates the tab
  3382. * @param {!ClientRect=} computeIndicatorClientRect
  3383. */
  3384. value: function activate(computeIndicatorClientRect) {
  3385. this.foundation_.activate(computeIndicatorClientRect);
  3386. }
  3387. /**
  3388. * Deactivates the tab
  3389. */
  3390. }, {
  3391. key: 'deactivate',
  3392. value: function deactivate() {
  3393. this.foundation_.deactivate();
  3394. }
  3395. /**
  3396. * Returns the indicator's client rect
  3397. * @return {!ClientRect}
  3398. */
  3399. }, {
  3400. key: 'computeIndicatorClientRect',
  3401. value: function computeIndicatorClientRect() {
  3402. return this.tabIndicator_.computeContentClientRect();
  3403. }
  3404. /**
  3405. * @return {!MDCTabDimensions}
  3406. */
  3407. }, {
  3408. key: 'computeDimensions',
  3409. value: function computeDimensions() {
  3410. return this.foundation_.computeDimensions();
  3411. }
  3412. /**
  3413. * Focuses the tab
  3414. */
  3415. }, {
  3416. key: 'focus',
  3417. value: function focus() {
  3418. this.root_.focus();
  3419. }
  3420. }, {
  3421. key: 'active',
  3422. get: function get() {
  3423. return this.foundation_.isActive();
  3424. }
  3425. }], [{
  3426. key: 'attachTo',
  3427. value: function attachTo(root) {
  3428. return new MDCTab(root);
  3429. }
  3430. }]);
  3431. return MDCTab;
  3432. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  3433. /***/ }),
  3434. /* 21 */
  3435. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3436. "use strict";
  3437. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  3438. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(48);
  3439. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(121);
  3440. 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; };
  3441. 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; }; }();
  3442. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3443. 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; }
  3444. 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; }
  3445. /**
  3446. * @license
  3447. * Copyright 2018 Google Inc.
  3448. *
  3449. * Permission is hereby granted, free of charge, to any person obtaining a copy
  3450. * of this software and associated documentation files (the "Software"), to deal
  3451. * in the Software without restriction, including without limitation the rights
  3452. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  3453. * copies of the Software, and to permit persons to whom the Software is
  3454. * furnished to do so, subject to the following conditions:
  3455. *
  3456. * The above copyright notice and this permission notice shall be included in
  3457. * all copies or substantial portions of the Software.
  3458. *
  3459. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  3460. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  3461. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  3462. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  3463. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  3464. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  3465. * THE SOFTWARE.
  3466. */
  3467. /**
  3468. * @extends {MDCFoundation<!MDCTabIndicatorAdapter>}
  3469. * @abstract
  3470. */
  3471. var MDCTabIndicatorFoundation = function (_MDCFoundation) {
  3472. _inherits(MDCTabIndicatorFoundation, _MDCFoundation);
  3473. _createClass(MDCTabIndicatorFoundation, null, [{
  3474. key: 'cssClasses',
  3475. /** @return enum {string} */
  3476. get: function get() {
  3477. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  3478. }
  3479. /** @return enum {string} */
  3480. }, {
  3481. key: 'strings',
  3482. get: function get() {
  3483. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  3484. }
  3485. /**
  3486. * @see MDCTabIndicatorAdapter for typing information
  3487. * @return {!MDCTabIndicatorAdapter}
  3488. */
  3489. }, {
  3490. key: 'defaultAdapter',
  3491. get: function get() {
  3492. return (/** @type {!MDCTabIndicatorAdapter} */{
  3493. addClass: function addClass() {},
  3494. removeClass: function removeClass() {},
  3495. computeContentClientRect: function computeContentClientRect() {},
  3496. setContentStyleProperty: function setContentStyleProperty() {}
  3497. }
  3498. );
  3499. }
  3500. /** @param {!MDCTabIndicatorAdapter} adapter */
  3501. }]);
  3502. function MDCTabIndicatorFoundation(adapter) {
  3503. _classCallCheck(this, MDCTabIndicatorFoundation);
  3504. return _possibleConstructorReturn(this, (MDCTabIndicatorFoundation.__proto__ || Object.getPrototypeOf(MDCTabIndicatorFoundation)).call(this, _extends(MDCTabIndicatorFoundation.defaultAdapter, adapter)));
  3505. }
  3506. /** @return {!ClientRect} */
  3507. _createClass(MDCTabIndicatorFoundation, [{
  3508. key: 'computeContentClientRect',
  3509. value: function computeContentClientRect() {
  3510. return this.adapter_.computeContentClientRect();
  3511. }
  3512. /**
  3513. * Activates the indicator
  3514. * @param {!ClientRect=} previousIndicatorClientRect
  3515. * @abstract
  3516. */
  3517. }, {
  3518. key: 'activate',
  3519. value: function activate(previousIndicatorClientRect) {} // eslint-disable-line no-unused-vars
  3520. /** @abstract */
  3521. }, {
  3522. key: 'deactivate',
  3523. value: function deactivate() {}
  3524. }]);
  3525. return MDCTabIndicatorFoundation;
  3526. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  3527. /* harmony default export */ __webpack_exports__["a"] = (MDCTabIndicatorFoundation);
  3528. /***/ }),
  3529. /* 22 */
  3530. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3531. "use strict";
  3532. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  3533. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(54);
  3534. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(135);
  3535. 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; };
  3536. 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; }; }();
  3537. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3538. 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; }
  3539. 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; }
  3540. /**
  3541. * @license
  3542. * Copyright 2017 Google Inc.
  3543. *
  3544. * Permission is hereby granted, free of charge, to any person obtaining a copy
  3545. * of this software and associated documentation files (the "Software"), to deal
  3546. * in the Software without restriction, including without limitation the rights
  3547. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  3548. * copies of the Software, and to permit persons to whom the Software is
  3549. * furnished to do so, subject to the following conditions:
  3550. *
  3551. * The above copyright notice and this permission notice shall be included in
  3552. * all copies or substantial portions of the Software.
  3553. *
  3554. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  3555. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  3556. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  3557. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  3558. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  3559. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  3560. * THE SOFTWARE.
  3561. */
  3562. /**
  3563. * @extends {MDCFoundation<!MDCTextFieldHelperTextAdapter>}
  3564. * @final
  3565. */
  3566. var MDCTextFieldHelperTextFoundation = function (_MDCFoundation) {
  3567. _inherits(MDCTextFieldHelperTextFoundation, _MDCFoundation);
  3568. _createClass(MDCTextFieldHelperTextFoundation, null, [{
  3569. key: 'cssClasses',
  3570. /** @return enum {string} */
  3571. get: function get() {
  3572. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  3573. }
  3574. /** @return enum {string} */
  3575. }, {
  3576. key: 'strings',
  3577. get: function get() {
  3578. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  3579. }
  3580. /**
  3581. * {@see MDCTextFieldHelperTextAdapter} for typing information on parameters and return
  3582. * types.
  3583. * @return {!MDCTextFieldHelperTextAdapter}
  3584. */
  3585. }, {
  3586. key: 'defaultAdapter',
  3587. get: function get() {
  3588. return (/** @type {!MDCTextFieldHelperTextAdapter} */{
  3589. addClass: function addClass() {},
  3590. removeClass: function removeClass() {},
  3591. hasClass: function hasClass() {},
  3592. setAttr: function setAttr() {},
  3593. removeAttr: function removeAttr() {},
  3594. setContent: function setContent() {}
  3595. }
  3596. );
  3597. }
  3598. /**
  3599. * @param {!MDCTextFieldHelperTextAdapter} adapter
  3600. */
  3601. }]);
  3602. function MDCTextFieldHelperTextFoundation(adapter) {
  3603. _classCallCheck(this, MDCTextFieldHelperTextFoundation);
  3604. return _possibleConstructorReturn(this, (MDCTextFieldHelperTextFoundation.__proto__ || Object.getPrototypeOf(MDCTextFieldHelperTextFoundation)).call(this, _extends(MDCTextFieldHelperTextFoundation.defaultAdapter, adapter)));
  3605. }
  3606. /**
  3607. * Sets the content of the helper text field.
  3608. * @param {string} content
  3609. */
  3610. _createClass(MDCTextFieldHelperTextFoundation, [{
  3611. key: 'setContent',
  3612. value: function setContent(content) {
  3613. this.adapter_.setContent(content);
  3614. }
  3615. /** @param {boolean} isPersistent Sets the persistency of the helper text. */
  3616. }, {
  3617. key: 'setPersistent',
  3618. value: function setPersistent(isPersistent) {
  3619. if (isPersistent) {
  3620. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_PERSISTENT);
  3621. } else {
  3622. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_PERSISTENT);
  3623. }
  3624. }
  3625. /**
  3626. * @param {boolean} isValidation True to make the helper text act as an
  3627. * error validation message.
  3628. */
  3629. }, {
  3630. key: 'setValidation',
  3631. value: function setValidation(isValidation) {
  3632. if (isValidation) {
  3633. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_VALIDATION_MSG);
  3634. } else {
  3635. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_VALIDATION_MSG);
  3636. }
  3637. }
  3638. /** Makes the helper text visible to the screen reader. */
  3639. }, {
  3640. key: 'showToScreenReader',
  3641. value: function showToScreenReader() {
  3642. this.adapter_.removeAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_HIDDEN);
  3643. }
  3644. /**
  3645. * Sets the validity of the helper text based on the input validity.
  3646. * @param {boolean} inputIsValid
  3647. */
  3648. }, {
  3649. key: 'setValidity',
  3650. value: function setValidity(inputIsValid) {
  3651. var helperTextIsPersistent = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_PERSISTENT);
  3652. var helperTextIsValidationMsg = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_VALIDATION_MSG);
  3653. var validationMsgNeedsDisplay = helperTextIsValidationMsg && !inputIsValid;
  3654. if (validationMsgNeedsDisplay) {
  3655. this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ROLE, 'alert');
  3656. } else {
  3657. this.adapter_.removeAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ROLE);
  3658. }
  3659. if (!helperTextIsPersistent && !validationMsgNeedsDisplay) {
  3660. this.hide_();
  3661. }
  3662. }
  3663. /**
  3664. * Hides the help text from screen readers.
  3665. * @private
  3666. */
  3667. }, {
  3668. key: 'hide_',
  3669. value: function hide_() {
  3670. this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_HIDDEN, 'true');
  3671. }
  3672. }]);
  3673. return MDCTextFieldHelperTextFoundation;
  3674. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  3675. /* harmony default export */ __webpack_exports__["a"] = (MDCTextFieldHelperTextFoundation);
  3676. /***/ }),
  3677. /* 23 */
  3678. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3679. "use strict";
  3680. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  3681. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(55);
  3682. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(136);
  3683. 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; };
  3684. 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; }; }();
  3685. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3686. 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; }
  3687. 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; }
  3688. /**
  3689. * @license
  3690. * Copyright 2017 Google Inc.
  3691. *
  3692. * Permission is hereby granted, free of charge, to any person obtaining a copy
  3693. * of this software and associated documentation files (the "Software"), to deal
  3694. * in the Software without restriction, including without limitation the rights
  3695. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  3696. * copies of the Software, and to permit persons to whom the Software is
  3697. * furnished to do so, subject to the following conditions:
  3698. *
  3699. * The above copyright notice and this permission notice shall be included in
  3700. * all copies or substantial portions of the Software.
  3701. *
  3702. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  3703. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  3704. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  3705. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  3706. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  3707. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  3708. * THE SOFTWARE.
  3709. */
  3710. /**
  3711. * @extends {MDCFoundation<!MDCTextFieldIconAdapter>}
  3712. * @final
  3713. */
  3714. var MDCTextFieldIconFoundation = function (_MDCFoundation) {
  3715. _inherits(MDCTextFieldIconFoundation, _MDCFoundation);
  3716. _createClass(MDCTextFieldIconFoundation, null, [{
  3717. key: 'strings',
  3718. /** @return enum {string} */
  3719. get: function get() {
  3720. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* strings */];
  3721. }
  3722. /**
  3723. * {@see MDCTextFieldIconAdapter} for typing information on parameters and return
  3724. * types.
  3725. * @return {!MDCTextFieldIconAdapter}
  3726. */
  3727. }, {
  3728. key: 'defaultAdapter',
  3729. get: function get() {
  3730. return (/** @type {!MDCTextFieldIconAdapter} */{
  3731. getAttr: function getAttr() {},
  3732. setAttr: function setAttr() {},
  3733. removeAttr: function removeAttr() {},
  3734. setContent: function setContent() {},
  3735. registerInteractionHandler: function registerInteractionHandler() {},
  3736. deregisterInteractionHandler: function deregisterInteractionHandler() {},
  3737. notifyIconAction: function notifyIconAction() {}
  3738. }
  3739. );
  3740. }
  3741. /**
  3742. * @param {!MDCTextFieldIconAdapter} adapter
  3743. */
  3744. }]);
  3745. function MDCTextFieldIconFoundation(adapter) {
  3746. _classCallCheck(this, MDCTextFieldIconFoundation);
  3747. /** @private {string?} */
  3748. var _this = _possibleConstructorReturn(this, (MDCTextFieldIconFoundation.__proto__ || Object.getPrototypeOf(MDCTextFieldIconFoundation)).call(this, _extends(MDCTextFieldIconFoundation.defaultAdapter, adapter)));
  3749. _this.savedTabIndex_ = null;
  3750. /** @private {function(!Event): undefined} */
  3751. _this.interactionHandler_ = function (evt) {
  3752. return _this.handleInteraction(evt);
  3753. };
  3754. return _this;
  3755. }
  3756. _createClass(MDCTextFieldIconFoundation, [{
  3757. key: 'init',
  3758. value: function init() {
  3759. var _this2 = this;
  3760. this.savedTabIndex_ = this.adapter_.getAttr('tabindex');
  3761. ['click', 'keydown'].forEach(function (evtType) {
  3762. _this2.adapter_.registerInteractionHandler(evtType, _this2.interactionHandler_);
  3763. });
  3764. }
  3765. }, {
  3766. key: 'destroy',
  3767. value: function destroy() {
  3768. var _this3 = this;
  3769. ['click', 'keydown'].forEach(function (evtType) {
  3770. _this3.adapter_.deregisterInteractionHandler(evtType, _this3.interactionHandler_);
  3771. });
  3772. }
  3773. /** @param {boolean} disabled */
  3774. }, {
  3775. key: 'setDisabled',
  3776. value: function setDisabled(disabled) {
  3777. if (!this.savedTabIndex_) {
  3778. return;
  3779. }
  3780. if (disabled) {
  3781. this.adapter_.setAttr('tabindex', '-1');
  3782. this.adapter_.removeAttr('role');
  3783. } else {
  3784. this.adapter_.setAttr('tabindex', this.savedTabIndex_);
  3785. this.adapter_.setAttr('role', __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* strings */].ICON_ROLE);
  3786. }
  3787. }
  3788. /** @param {string} label */
  3789. }, {
  3790. key: 'setAriaLabel',
  3791. value: function setAriaLabel(label) {
  3792. this.adapter_.setAttr('aria-label', label);
  3793. }
  3794. /** @param {string} content */
  3795. }, {
  3796. key: 'setContent',
  3797. value: function setContent(content) {
  3798. this.adapter_.setContent(content);
  3799. }
  3800. /**
  3801. * Handles an interaction event
  3802. * @param {!Event} evt
  3803. */
  3804. }, {
  3805. key: 'handleInteraction',
  3806. value: function handleInteraction(evt) {
  3807. if (evt.type === 'click' || evt.key === 'Enter' || evt.keyCode === 13) {
  3808. this.adapter_.notifyIconAction();
  3809. }
  3810. }
  3811. }]);
  3812. return MDCTextFieldIconFoundation;
  3813. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  3814. /* harmony default export */ __webpack_exports__["a"] = (MDCTextFieldIconFoundation);
  3815. /***/ }),
  3816. /* 24 */
  3817. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3818. "use strict";
  3819. 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; }; }();
  3820. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3821. /**
  3822. * @license
  3823. * Copyright 2016 Google Inc.
  3824. *
  3825. * Permission is hereby granted, free of charge, to any person obtaining a copy
  3826. * of this software and associated documentation files (the "Software"), to deal
  3827. * in the Software without restriction, including without limitation the rights
  3828. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  3829. * copies of the Software, and to permit persons to whom the Software is
  3830. * furnished to do so, subject to the following conditions:
  3831. *
  3832. * The above copyright notice and this permission notice shall be included in
  3833. * all copies or substantial portions of the Software.
  3834. *
  3835. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  3836. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  3837. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  3838. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  3839. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  3840. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  3841. * THE SOFTWARE.
  3842. */
  3843. /* eslint no-unused-vars: [2, {"args": "none"}] */
  3844. /**
  3845. * Adapter for MDC Ripple. Provides an interface for managing
  3846. * - classes
  3847. * - dom
  3848. * - CSS variables
  3849. * - position
  3850. * - dimensions
  3851. * - scroll position
  3852. * - event handlers
  3853. * - unbounded, active and disabled states
  3854. *
  3855. * Additionally, provides type information for the adapter to the Closure
  3856. * compiler.
  3857. *
  3858. * Implement this adapter for your framework of choice to delegate updates to
  3859. * the component in your framework of choice. See architecture documentation
  3860. * for more details.
  3861. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  3862. *
  3863. * @record
  3864. */
  3865. var MDCRippleAdapter = function () {
  3866. function MDCRippleAdapter() {
  3867. _classCallCheck(this, MDCRippleAdapter);
  3868. }
  3869. _createClass(MDCRippleAdapter, [{
  3870. key: "browserSupportsCssVars",
  3871. /** @return {boolean} */
  3872. value: function browserSupportsCssVars() {}
  3873. /** @return {boolean} */
  3874. }, {
  3875. key: "isUnbounded",
  3876. value: function isUnbounded() {}
  3877. /** @return {boolean} */
  3878. }, {
  3879. key: "isSurfaceActive",
  3880. value: function isSurfaceActive() {}
  3881. /** @return {boolean} */
  3882. }, {
  3883. key: "isSurfaceDisabled",
  3884. value: function isSurfaceDisabled() {}
  3885. /** @param {string} className */
  3886. }, {
  3887. key: "addClass",
  3888. value: function addClass(className) {}
  3889. /** @param {string} className */
  3890. }, {
  3891. key: "removeClass",
  3892. value: function removeClass(className) {}
  3893. /** @param {!EventTarget} target */
  3894. }, {
  3895. key: "containsEventTarget",
  3896. value: function containsEventTarget(target) {}
  3897. /**
  3898. * @param {string} evtType
  3899. * @param {!Function} handler
  3900. */
  3901. }, {
  3902. key: "registerInteractionHandler",
  3903. value: function registerInteractionHandler(evtType, handler) {}
  3904. /**
  3905. * @param {string} evtType
  3906. * @param {!Function} handler
  3907. */
  3908. }, {
  3909. key: "deregisterInteractionHandler",
  3910. value: function deregisterInteractionHandler(evtType, handler) {}
  3911. /**
  3912. * @param {string} evtType
  3913. * @param {!Function} handler
  3914. */
  3915. }, {
  3916. key: "registerDocumentInteractionHandler",
  3917. value: function registerDocumentInteractionHandler(evtType, handler) {}
  3918. /**
  3919. * @param {string} evtType
  3920. * @param {!Function} handler
  3921. */
  3922. }, {
  3923. key: "deregisterDocumentInteractionHandler",
  3924. value: function deregisterDocumentInteractionHandler(evtType, handler) {}
  3925. /**
  3926. * @param {!Function} handler
  3927. */
  3928. }, {
  3929. key: "registerResizeHandler",
  3930. value: function registerResizeHandler(handler) {}
  3931. /**
  3932. * @param {!Function} handler
  3933. */
  3934. }, {
  3935. key: "deregisterResizeHandler",
  3936. value: function deregisterResizeHandler(handler) {}
  3937. /**
  3938. * @param {string} varName
  3939. * @param {?number|string} value
  3940. */
  3941. }, {
  3942. key: "updateCssVariable",
  3943. value: function updateCssVariable(varName, value) {}
  3944. /** @return {!ClientRect} */
  3945. }, {
  3946. key: "computeBoundingRect",
  3947. value: function computeBoundingRect() {}
  3948. /** @return {{x: number, y: number}} */
  3949. }, {
  3950. key: "getWindowPageOffset",
  3951. value: function getWindowPageOffset() {}
  3952. }]);
  3953. return MDCRippleAdapter;
  3954. }();
  3955. /* unused harmony default export */ var _unused_webpack_default_export = (MDCRippleAdapter);
  3956. /***/ }),
  3957. /* 25 */
  3958. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3959. "use strict";
  3960. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCChip; });
  3961. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  3962. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__ = __webpack_require__(2);
  3963. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__adapter__ = __webpack_require__(26);
  3964. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation__ = __webpack_require__(27);
  3965. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__constants__ = __webpack_require__(28);
  3966. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_3__foundation__["a"]; });
  3967. 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; };
  3968. 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; }; }();
  3969. 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); } };
  3970. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3971. 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; }
  3972. 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; }
  3973. /**
  3974. * @license
  3975. * Copyright 2016 Google Inc.
  3976. *
  3977. * Permission is hereby granted, free of charge, to any person obtaining a copy
  3978. * of this software and associated documentation files (the "Software"), to deal
  3979. * in the Software without restriction, including without limitation the rights
  3980. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  3981. * copies of the Software, and to permit persons to whom the Software is
  3982. * furnished to do so, subject to the following conditions:
  3983. *
  3984. * The above copyright notice and this permission notice shall be included in
  3985. * all copies or substantial portions of the Software.
  3986. *
  3987. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  3988. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  3989. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  3990. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  3991. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  3992. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  3993. * THE SOFTWARE.
  3994. */
  3995. var INTERACTION_EVENTS = ['click', 'keydown'];
  3996. /**
  3997. * @extends {MDCComponent<!MDCChipFoundation>}
  3998. * @final
  3999. */
  4000. var MDCChip = function (_MDCComponent) {
  4001. _inherits(MDCChip, _MDCComponent);
  4002. /**
  4003. * @param {...?} args
  4004. */
  4005. function MDCChip() {
  4006. var _ref;
  4007. _classCallCheck(this, MDCChip);
  4008. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  4009. args[_key] = arguments[_key];
  4010. }
  4011. /** @type {string} */
  4012. var _this = _possibleConstructorReturn(this, (_ref = MDCChip.__proto__ || Object.getPrototypeOf(MDCChip)).call.apply(_ref, [this].concat(args)));
  4013. _this.id;
  4014. /** @private {?Element} */
  4015. _this.leadingIcon_;
  4016. /** @private {?Element} */
  4017. _this.trailingIcon_;
  4018. /** @private {!MDCRipple} */
  4019. _this.ripple_;
  4020. /** @private {?function(?Event): undefined} */
  4021. _this.handleInteraction_;
  4022. /** @private {?function(!Event): undefined} */
  4023. _this.handleTransitionEnd_;
  4024. /** @private {function(!Event): undefined} */
  4025. _this.handleTrailingIconInteraction_;
  4026. return _this;
  4027. }
  4028. /**
  4029. * @param {!Element} root
  4030. * @return {!MDCChip}
  4031. */
  4032. _createClass(MDCChip, [{
  4033. key: 'initialize',
  4034. value: function initialize() {
  4035. var _this2 = this;
  4036. var rippleFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (el, foundation) {
  4037. return new __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRipple"](el, foundation);
  4038. };
  4039. this.id = this.root_.id;
  4040. this.leadingIcon_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].LEADING_ICON_SELECTOR);
  4041. this.trailingIcon_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].TRAILING_ICON_SELECTOR);
  4042. // Adjust ripple size for chips with animated growing width. This applies when filter chips without
  4043. // a leading icon are selected, and a leading checkmark will cause the chip width to expand.
  4044. var checkmarkEl = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].CHECKMARK_SELECTOR);
  4045. if (checkmarkEl && !this.leadingIcon_) {
  4046. var adapter = _extends(__WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRipple"].createAdapter(this), {
  4047. computeBoundingRect: function computeBoundingRect() {
  4048. var height = _this2.root_.getBoundingClientRect().height;
  4049. // The checkmark's width is initially set to 0, so use the checkmark's height as a proxy since the
  4050. // checkmark should always be square.
  4051. var width = _this2.root_.getBoundingClientRect().width + checkmarkEl.getBoundingClientRect().height;
  4052. return { height: height, width: width };
  4053. }
  4054. });
  4055. this.ripple_ = rippleFactory(this.root_, new __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRippleFoundation"](adapter));
  4056. } else {
  4057. this.ripple_ = rippleFactory(this.root_);
  4058. }
  4059. }
  4060. }, {
  4061. key: 'initialSyncWithDOM',
  4062. value: function initialSyncWithDOM() {
  4063. var _this3 = this;
  4064. this.handleInteraction_ = function (evt) {
  4065. return _this3.foundation_.handleInteraction(evt);
  4066. };
  4067. this.handleTransitionEnd_ = function (evt) {
  4068. return _this3.foundation_.handleTransitionEnd(evt);
  4069. };
  4070. this.handleTrailingIconInteraction_ = function (evt) {
  4071. return _this3.foundation_.handleTrailingIconInteraction(evt);
  4072. };
  4073. INTERACTION_EVENTS.forEach(function (evtType) {
  4074. _this3.root_.addEventListener(evtType, _this3.handleInteraction_);
  4075. });
  4076. this.root_.addEventListener('transitionend', this.handleTransitionEnd_);
  4077. if (this.trailingIcon_) {
  4078. INTERACTION_EVENTS.forEach(function (evtType) {
  4079. _this3.trailingIcon_.addEventListener(evtType, _this3.handleTrailingIconInteraction_);
  4080. });
  4081. }
  4082. }
  4083. }, {
  4084. key: 'destroy',
  4085. value: function destroy() {
  4086. var _this4 = this;
  4087. this.ripple_.destroy();
  4088. INTERACTION_EVENTS.forEach(function (evtType) {
  4089. _this4.root_.removeEventListener(evtType, _this4.handleInteraction_);
  4090. });
  4091. this.root_.removeEventListener('transitionend', this.handleTransitionEnd_);
  4092. if (this.trailingIcon_) {
  4093. INTERACTION_EVENTS.forEach(function (evtType) {
  4094. _this4.trailingIcon_.removeEventListener(evtType, _this4.handleTrailingIconInteraction_);
  4095. });
  4096. }
  4097. _get(MDCChip.prototype.__proto__ || Object.getPrototypeOf(MDCChip.prototype), 'destroy', this).call(this);
  4098. }
  4099. /**
  4100. * Returns whether the chip is selected.
  4101. * @return {boolean}
  4102. */
  4103. }, {
  4104. key: 'beginExit',
  4105. /**
  4106. * Begins the exit animation which leads to removal of the chip.
  4107. */
  4108. value: function beginExit() {
  4109. this.foundation_.beginExit();
  4110. }
  4111. /**
  4112. * @return {!MDCChipFoundation}
  4113. */
  4114. }, {
  4115. key: 'getDefaultFoundation',
  4116. value: function getDefaultFoundation() {
  4117. var _this5 = this;
  4118. return new __WEBPACK_IMPORTED_MODULE_3__foundation__["a" /* MDCChipFoundation */]( /** @type {!MDCChipAdapter} */_extends({
  4119. addClass: function addClass(className) {
  4120. return _this5.root_.classList.add(className);
  4121. },
  4122. removeClass: function removeClass(className) {
  4123. return _this5.root_.classList.remove(className);
  4124. },
  4125. hasClass: function hasClass(className) {
  4126. return _this5.root_.classList.contains(className);
  4127. },
  4128. addClassToLeadingIcon: function addClassToLeadingIcon(className) {
  4129. if (_this5.leadingIcon_) {
  4130. _this5.leadingIcon_.classList.add(className);
  4131. }
  4132. },
  4133. removeClassFromLeadingIcon: function removeClassFromLeadingIcon(className) {
  4134. if (_this5.leadingIcon_) {
  4135. _this5.leadingIcon_.classList.remove(className);
  4136. }
  4137. },
  4138. eventTargetHasClass: function eventTargetHasClass(target, className) {
  4139. return target.classList.contains(className);
  4140. },
  4141. notifyInteraction: function notifyInteraction() {
  4142. return _this5.emit(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].INTERACTION_EVENT, { chipId: _this5.id }, true /* shouldBubble */);
  4143. },
  4144. notifyTrailingIconInteraction: function notifyTrailingIconInteraction() {
  4145. return _this5.emit(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].TRAILING_ICON_INTERACTION_EVENT, { chipId: _this5.id }, true /* shouldBubble */);
  4146. },
  4147. notifyRemoval: function notifyRemoval() {
  4148. return _this5.emit(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].REMOVAL_EVENT, { chipId: _this5.id, root: _this5.root_ }, true /* shouldBubble */);
  4149. },
  4150. getComputedStyleValue: function getComputedStyleValue(propertyName) {
  4151. return window.getComputedStyle(_this5.root_).getPropertyValue(propertyName);
  4152. },
  4153. setStyleProperty: function setStyleProperty(propertyName, value) {
  4154. return _this5.root_.style.setProperty(propertyName, value);
  4155. }
  4156. }));
  4157. }
  4158. /** @return {!MDCRipple} */
  4159. }, {
  4160. key: 'selected',
  4161. get: function get() {
  4162. return this.foundation_.isSelected();
  4163. }
  4164. /**
  4165. * Sets selected state on the chip.
  4166. * @param {boolean} selected
  4167. */
  4168. ,
  4169. set: function set(selected) {
  4170. this.foundation_.setSelected(selected);
  4171. }
  4172. /**
  4173. * Returns whether a trailing icon click should trigger exit/removal of the chip.
  4174. * @return {boolean}
  4175. */
  4176. }, {
  4177. key: 'shouldRemoveOnTrailingIconClick',
  4178. get: function get() {
  4179. return this.foundation_.getShouldRemoveOnTrailingIconClick();
  4180. }
  4181. /**
  4182. * Sets whether a trailing icon click should trigger exit/removal of the chip.
  4183. * @param {boolean} shouldRemove
  4184. */
  4185. ,
  4186. set: function set(shouldRemove) {
  4187. this.foundation_.setShouldRemoveOnTrailingIconClick(shouldRemove);
  4188. }
  4189. }, {
  4190. key: 'ripple',
  4191. get: function get() {
  4192. return this.ripple_;
  4193. }
  4194. }], [{
  4195. key: 'attachTo',
  4196. value: function attachTo(root) {
  4197. return new MDCChip(root);
  4198. }
  4199. }]);
  4200. return MDCChip;
  4201. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  4202. /***/ }),
  4203. /* 26 */
  4204. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4205. "use strict";
  4206. 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; }; }();
  4207. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4208. /**
  4209. * @license
  4210. * Copyright 2017 Google Inc.
  4211. *
  4212. * Permission is hereby granted, free of charge, to any person obtaining a copy
  4213. * of this software and associated documentation files (the "Software"), to deal
  4214. * in the Software without restriction, including without limitation the rights
  4215. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  4216. * copies of the Software, and to permit persons to whom the Software is
  4217. * furnished to do so, subject to the following conditions:
  4218. *
  4219. * The above copyright notice and this permission notice shall be included in
  4220. * all copies or substantial portions of the Software.
  4221. *
  4222. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  4223. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  4224. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  4225. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  4226. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  4227. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  4228. * THE SOFTWARE.
  4229. */
  4230. /* eslint no-unused-vars: [2, {"args": "none"}] */
  4231. /**
  4232. * Adapter for MDC Chip.
  4233. *
  4234. * Defines the shape of the adapter expected by the foundation. Implement this
  4235. * adapter to integrate the Chip into your framework. See
  4236. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  4237. * for more information.
  4238. *
  4239. * @record
  4240. */
  4241. var MDCChipAdapter = function () {
  4242. function MDCChipAdapter() {
  4243. _classCallCheck(this, MDCChipAdapter);
  4244. }
  4245. _createClass(MDCChipAdapter, [{
  4246. key: "addClass",
  4247. /**
  4248. * Adds a class to the root element.
  4249. * @param {string} className
  4250. */
  4251. value: function addClass(className) {}
  4252. /**
  4253. * Removes a class from the root element.
  4254. * @param {string} className
  4255. */
  4256. }, {
  4257. key: "removeClass",
  4258. value: function removeClass(className) {}
  4259. /**
  4260. * Returns true if the root element contains the given class.
  4261. * @param {string} className
  4262. * @return {boolean}
  4263. */
  4264. }, {
  4265. key: "hasClass",
  4266. value: function hasClass(className) {}
  4267. /**
  4268. * Adds a class to the leading icon element.
  4269. * @param {string} className
  4270. */
  4271. }, {
  4272. key: "addClassToLeadingIcon",
  4273. value: function addClassToLeadingIcon(className) {}
  4274. /**
  4275. * Removes a class from the leading icon element.
  4276. * @param {string} className
  4277. */
  4278. }, {
  4279. key: "removeClassFromLeadingIcon",
  4280. value: function removeClassFromLeadingIcon(className) {}
  4281. /**
  4282. * Returns true if target has className, false otherwise.
  4283. * @param {!EventTarget} target
  4284. * @param {string} className
  4285. * @return {boolean}
  4286. */
  4287. }, {
  4288. key: "eventTargetHasClass",
  4289. value: function eventTargetHasClass(target, className) {}
  4290. /**
  4291. * Emits a custom "MDCChip:interaction" event denoting the chip has been
  4292. * interacted with (typically on click or keydown).
  4293. */
  4294. }, {
  4295. key: "notifyInteraction",
  4296. value: function notifyInteraction() {}
  4297. /**
  4298. * Emits a custom "MDCChip:trailingIconInteraction" event denoting the trailing icon has been
  4299. * interacted with (typically on click or keydown).
  4300. */
  4301. }, {
  4302. key: "notifyTrailingIconInteraction",
  4303. value: function notifyTrailingIconInteraction() {}
  4304. /**
  4305. * Emits a custom event "MDCChip:removal" denoting the chip will be removed.
  4306. */
  4307. }, {
  4308. key: "notifyRemoval",
  4309. value: function notifyRemoval() {}
  4310. /**
  4311. * Returns the computed property value of the given style property on the root element.
  4312. * @param {string} propertyName
  4313. * @return {string}
  4314. */
  4315. }, {
  4316. key: "getComputedStyleValue",
  4317. value: function getComputedStyleValue(propertyName) {}
  4318. /**
  4319. * Sets the property value of the given style property on the root element.
  4320. * @param {string} propertyName
  4321. * @param {string} value
  4322. */
  4323. }, {
  4324. key: "setStyleProperty",
  4325. value: function setStyleProperty(propertyName, value) {}
  4326. }]);
  4327. return MDCChipAdapter;
  4328. }();
  4329. /* unused harmony default export */ var _unused_webpack_default_export = (MDCChipAdapter);
  4330. /***/ }),
  4331. /* 27 */
  4332. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4333. "use strict";
  4334. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCChipFoundation; });
  4335. /* unused harmony export MDCChipInteractionEventType */
  4336. /* unused harmony export MDCChipRemovalEventType */
  4337. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  4338. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(26);
  4339. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(28);
  4340. 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; };
  4341. 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; }; }();
  4342. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4343. 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; }
  4344. 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; }
  4345. /**
  4346. * @license
  4347. * Copyright 2016 Google Inc.
  4348. *
  4349. * Permission is hereby granted, free of charge, to any person obtaining a copy
  4350. * of this software and associated documentation files (the "Software"), to deal
  4351. * in the Software without restriction, including without limitation the rights
  4352. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  4353. * copies of the Software, and to permit persons to whom the Software is
  4354. * furnished to do so, subject to the following conditions:
  4355. *
  4356. * The above copyright notice and this permission notice shall be included in
  4357. * all copies or substantial portions of the Software.
  4358. *
  4359. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  4360. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  4361. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  4362. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  4363. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  4364. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  4365. * THE SOFTWARE.
  4366. */
  4367. /**
  4368. * @extends {MDCFoundation<!MDCChipAdapter>}
  4369. * @final
  4370. */
  4371. var MDCChipFoundation = function (_MDCFoundation) {
  4372. _inherits(MDCChipFoundation, _MDCFoundation);
  4373. _createClass(MDCChipFoundation, null, [{
  4374. key: 'strings',
  4375. /** @return enum {string} */
  4376. get: function get() {
  4377. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  4378. }
  4379. /** @return enum {string} */
  4380. }, {
  4381. key: 'cssClasses',
  4382. get: function get() {
  4383. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  4384. }
  4385. /**
  4386. * {@see MDCChipAdapter} for typing information on parameters and return
  4387. * types.
  4388. * @return {!MDCChipAdapter}
  4389. */
  4390. }, {
  4391. key: 'defaultAdapter',
  4392. get: function get() {
  4393. return (/** @type {!MDCChipAdapter} */{
  4394. addClass: function addClass() {},
  4395. removeClass: function removeClass() {},
  4396. hasClass: function hasClass() {},
  4397. addClassToLeadingIcon: function addClassToLeadingIcon() {},
  4398. removeClassFromLeadingIcon: function removeClassFromLeadingIcon() {},
  4399. eventTargetHasClass: function eventTargetHasClass() {},
  4400. notifyInteraction: function notifyInteraction() {},
  4401. notifyTrailingIconInteraction: function notifyTrailingIconInteraction() {},
  4402. notifyRemoval: function notifyRemoval() {},
  4403. getComputedStyleValue: function getComputedStyleValue() {},
  4404. setStyleProperty: function setStyleProperty() {}
  4405. }
  4406. );
  4407. }
  4408. /**
  4409. * @param {!MDCChipAdapter} adapter
  4410. */
  4411. }]);
  4412. function MDCChipFoundation(adapter) {
  4413. _classCallCheck(this, MDCChipFoundation);
  4414. /**
  4415. * Whether a trailing icon click should immediately trigger exit/removal of the chip.
  4416. * @private {boolean}
  4417. * */
  4418. var _this = _possibleConstructorReturn(this, (MDCChipFoundation.__proto__ || Object.getPrototypeOf(MDCChipFoundation)).call(this, _extends(MDCChipFoundation.defaultAdapter, adapter)));
  4419. _this.shouldRemoveOnTrailingIconClick_ = true;
  4420. return _this;
  4421. }
  4422. /**
  4423. * @return {boolean}
  4424. */
  4425. _createClass(MDCChipFoundation, [{
  4426. key: 'isSelected',
  4427. value: function isSelected() {
  4428. return this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SELECTED);
  4429. }
  4430. /**
  4431. * @param {boolean} selected
  4432. */
  4433. }, {
  4434. key: 'setSelected',
  4435. value: function setSelected(selected) {
  4436. if (selected) {
  4437. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SELECTED);
  4438. } else {
  4439. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SELECTED);
  4440. }
  4441. }
  4442. /**
  4443. * @return {boolean}
  4444. */
  4445. }, {
  4446. key: 'getShouldRemoveOnTrailingIconClick',
  4447. value: function getShouldRemoveOnTrailingIconClick() {
  4448. return this.shouldRemoveOnTrailingIconClick_;
  4449. }
  4450. /**
  4451. * @param {boolean} shouldRemove
  4452. */
  4453. }, {
  4454. key: 'setShouldRemoveOnTrailingIconClick',
  4455. value: function setShouldRemoveOnTrailingIconClick(shouldRemove) {
  4456. this.shouldRemoveOnTrailingIconClick_ = shouldRemove;
  4457. }
  4458. /**
  4459. * Begins the exit animation which leads to removal of the chip.
  4460. */
  4461. }, {
  4462. key: 'beginExit',
  4463. value: function beginExit() {
  4464. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CHIP_EXIT);
  4465. }
  4466. /**
  4467. * Handles an interaction event on the root element.
  4468. * @param {!Event} evt
  4469. */
  4470. }, {
  4471. key: 'handleInteraction',
  4472. value: function handleInteraction(evt) {
  4473. if (evt.type === 'click' || evt.key === 'Enter' || evt.keyCode === 13) {
  4474. this.adapter_.notifyInteraction();
  4475. }
  4476. }
  4477. /**
  4478. * Handles a transition end event on the root element.
  4479. * @param {!Event} evt
  4480. */
  4481. }, {
  4482. key: 'handleTransitionEnd',
  4483. value: function handleTransitionEnd(evt) {
  4484. var _this2 = this;
  4485. // Handle transition end event on the chip when it is about to be removed.
  4486. if (this.adapter_.eventTargetHasClass( /** @type {!EventTarget} */evt.target, __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CHIP_EXIT)) {
  4487. if (evt.propertyName === 'width') {
  4488. this.adapter_.notifyRemoval();
  4489. } else if (evt.propertyName === 'opacity') {
  4490. // See: https://css-tricks.com/using-css-transitions-auto-dimensions/#article-header-id-5
  4491. var chipWidth = this.adapter_.getComputedStyleValue('width');
  4492. // On the next frame (once we get the computed width), explicitly set the chip's width
  4493. // to its current pixel width, so we aren't transitioning out of 'auto'.
  4494. requestAnimationFrame(function () {
  4495. _this2.adapter_.setStyleProperty('width', chipWidth);
  4496. // To mitigate jitter, start transitioning padding and margin before width.
  4497. _this2.adapter_.setStyleProperty('padding', '0');
  4498. _this2.adapter_.setStyleProperty('margin', '0');
  4499. // On the next frame (once width is explicitly set), transition width to 0.
  4500. requestAnimationFrame(function () {
  4501. _this2.adapter_.setStyleProperty('width', '0');
  4502. });
  4503. });
  4504. }
  4505. return;
  4506. }
  4507. // Handle a transition end event on the leading icon or checkmark, since the transition end event bubbles.
  4508. if (evt.propertyName !== 'opacity') {
  4509. return;
  4510. }
  4511. 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)) {
  4512. this.adapter_.addClassToLeadingIcon(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HIDDEN_LEADING_ICON);
  4513. } 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)) {
  4514. this.adapter_.removeClassFromLeadingIcon(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HIDDEN_LEADING_ICON);
  4515. }
  4516. }
  4517. /**
  4518. * Handles an interaction event on the trailing icon element. This is used to
  4519. * prevent the ripple from activating on interaction with the trailing icon.
  4520. * @param {!Event} evt
  4521. */
  4522. }, {
  4523. key: 'handleTrailingIconInteraction',
  4524. value: function handleTrailingIconInteraction(evt) {
  4525. evt.stopPropagation();
  4526. if (evt.type === 'click' || evt.key === 'Enter' || evt.keyCode === 13) {
  4527. this.adapter_.notifyTrailingIconInteraction();
  4528. if (this.shouldRemoveOnTrailingIconClick_) {
  4529. this.beginExit();
  4530. }
  4531. }
  4532. }
  4533. }]);
  4534. return MDCChipFoundation;
  4535. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  4536. /**
  4537. * @typedef {{
  4538. * detail: {
  4539. * chipId: string,
  4540. * },
  4541. * bubbles: boolean,
  4542. * }}
  4543. */
  4544. var MDCChipInteractionEventType = void 0;
  4545. /**
  4546. * @typedef {{
  4547. * detail: {
  4548. * chipId: string,
  4549. * root: Element,
  4550. * },
  4551. * bubbles: boolean,
  4552. * }}
  4553. */
  4554. var MDCChipRemovalEventType = void 0;
  4555. /***/ }),
  4556. /* 28 */
  4557. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4558. "use strict";
  4559. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  4560. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  4561. /**
  4562. * @license
  4563. * Copyright 2016 Google Inc.
  4564. *
  4565. * Permission is hereby granted, free of charge, to any person obtaining a copy
  4566. * of this software and associated documentation files (the "Software"), to deal
  4567. * in the Software without restriction, including without limitation the rights
  4568. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  4569. * copies of the Software, and to permit persons to whom the Software is
  4570. * furnished to do so, subject to the following conditions:
  4571. *
  4572. * The above copyright notice and this permission notice shall be included in
  4573. * all copies or substantial portions of the Software.
  4574. *
  4575. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  4576. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  4577. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  4578. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  4579. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  4580. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  4581. * THE SOFTWARE.
  4582. */
  4583. /** @enum {string} */
  4584. var strings = {
  4585. ENTRY_ANIMATION_NAME: 'mdc-chip-entry',
  4586. INTERACTION_EVENT: 'MDCChip:interaction',
  4587. TRAILING_ICON_INTERACTION_EVENT: 'MDCChip:trailingIconInteraction',
  4588. REMOVAL_EVENT: 'MDCChip:removal',
  4589. CHECKMARK_SELECTOR: '.mdc-chip__checkmark',
  4590. LEADING_ICON_SELECTOR: '.mdc-chip__icon--leading',
  4591. TRAILING_ICON_SELECTOR: '.mdc-chip__icon--trailing'
  4592. };
  4593. /** @enum {string} */
  4594. var cssClasses = {
  4595. CHECKMARK: 'mdc-chip__checkmark',
  4596. CHIP_EXIT: 'mdc-chip--exit',
  4597. HIDDEN_LEADING_ICON: 'mdc-chip__icon--leading-hidden',
  4598. LEADING_ICON: 'mdc-chip__icon--leading',
  4599. TRAILING_ICON: 'mdc-chip__icon--trailing',
  4600. SELECTED: 'mdc-chip--selected'
  4601. };
  4602. /***/ }),
  4603. /* 29 */
  4604. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4605. "use strict";
  4606. 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; }; }();
  4607. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4608. /**
  4609. * @license
  4610. * Copyright 2017 Google Inc.
  4611. *
  4612. * Permission is hereby granted, free of charge, to any person obtaining a copy
  4613. * of this software and associated documentation files (the "Software"), to deal
  4614. * in the Software without restriction, including without limitation the rights
  4615. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  4616. * copies of the Software, and to permit persons to whom the Software is
  4617. * furnished to do so, subject to the following conditions:
  4618. *
  4619. * The above copyright notice and this permission notice shall be included in
  4620. * all copies or substantial portions of the Software.
  4621. *
  4622. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  4623. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  4624. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  4625. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  4626. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  4627. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  4628. * THE SOFTWARE.
  4629. */
  4630. /* eslint no-unused-vars: [2, {"args": "none"}] */
  4631. /**
  4632. * Adapter for MDC Chip Set.
  4633. *
  4634. * Defines the shape of the adapter expected by the foundation. Implement this
  4635. * adapter to integrate the Chip Set into your framework. See
  4636. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  4637. * for more information.
  4638. *
  4639. * @record
  4640. */
  4641. var MDCChipSetAdapter = function () {
  4642. function MDCChipSetAdapter() {
  4643. _classCallCheck(this, MDCChipSetAdapter);
  4644. }
  4645. _createClass(MDCChipSetAdapter, [{
  4646. key: "hasClass",
  4647. /**
  4648. * Returns true if the root element contains the given class name.
  4649. * @param {string} className
  4650. * @return {boolean}
  4651. */
  4652. value: function hasClass(className) {}
  4653. /**
  4654. * Removes the chip with the given id from the chip set.
  4655. * @param {string} chipId
  4656. */
  4657. }, {
  4658. key: "removeChip",
  4659. value: function removeChip(chipId) {}
  4660. /**
  4661. * Sets the selected state of the chip with the given id.
  4662. * @param {string} chipId
  4663. * @param {boolean} selected
  4664. */
  4665. }, {
  4666. key: "setSelected",
  4667. value: function setSelected(chipId, selected) {}
  4668. }]);
  4669. return MDCChipSetAdapter;
  4670. }();
  4671. /* unused harmony default export */ var _unused_webpack_default_export = (MDCChipSetAdapter);
  4672. /***/ }),
  4673. /* 30 */
  4674. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4675. "use strict";
  4676. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__adapter__ = __webpack_require__(13);
  4677. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_foundation__ = __webpack_require__(0);
  4678. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(31);
  4679. 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; }; }();
  4680. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4681. 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; }
  4682. 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; }
  4683. /**
  4684. * @license
  4685. * Copyright 2018 Google Inc.
  4686. *
  4687. * Permission is hereby granted, free of charge, to any person obtaining a copy
  4688. * of this software and associated documentation files (the "Software"), to deal
  4689. * in the Software without restriction, including without limitation the rights
  4690. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  4691. * copies of the Software, and to permit persons to whom the Software is
  4692. * furnished to do so, subject to the following conditions:
  4693. *
  4694. * The above copyright notice and this permission notice shall be included in
  4695. * all copies or substantial portions of the Software.
  4696. *
  4697. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  4698. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  4699. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  4700. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  4701. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  4702. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  4703. * THE SOFTWARE.
  4704. */
  4705. /**
  4706. * @extends {MDCFoundation<!MDCDrawerAdapter>}
  4707. */
  4708. var MDCDismissibleDrawerFoundation = function (_MDCFoundation) {
  4709. _inherits(MDCDismissibleDrawerFoundation, _MDCFoundation);
  4710. function MDCDismissibleDrawerFoundation() {
  4711. _classCallCheck(this, MDCDismissibleDrawerFoundation);
  4712. return _possibleConstructorReturn(this, (MDCDismissibleDrawerFoundation.__proto__ || Object.getPrototypeOf(MDCDismissibleDrawerFoundation)).apply(this, arguments));
  4713. }
  4714. _createClass(MDCDismissibleDrawerFoundation, [{
  4715. key: 'open',
  4716. /**
  4717. * Function to open the drawer.
  4718. */
  4719. value: function open() {
  4720. if (this.isOpen() || this.isOpening() || this.isClosing()) {
  4721. return;
  4722. }
  4723. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].OPEN);
  4724. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ANIMATE);
  4725. this.adapter_.computeBoundingRect(); // Force reflow.
  4726. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].OPENING);
  4727. this.adapter_.saveFocus();
  4728. }
  4729. /**
  4730. * Function to close the drawer.
  4731. */
  4732. }, {
  4733. key: 'close',
  4734. value: function close() {
  4735. if (!this.isOpen() || this.isOpening() || this.isClosing()) {
  4736. return;
  4737. }
  4738. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CLOSING);
  4739. }
  4740. /**
  4741. * Extension point for when drawer finishes open animation.
  4742. * @protected
  4743. */
  4744. }, {
  4745. key: 'opened',
  4746. value: function opened() {}
  4747. /**
  4748. * Extension point for when drawer finishes close animation.
  4749. * @protected
  4750. */
  4751. }, {
  4752. key: 'closed',
  4753. value: function closed() {}
  4754. /**
  4755. * Returns true if drawer is in open state.
  4756. * @return {boolean}
  4757. */
  4758. }, {
  4759. key: 'isOpen',
  4760. value: function isOpen() {
  4761. return this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].OPEN);
  4762. }
  4763. /**
  4764. * Returns true if drawer is animating open.
  4765. * @return {boolean}
  4766. */
  4767. }, {
  4768. key: 'isOpening',
  4769. value: function isOpening() {
  4770. return this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].OPENING);
  4771. }
  4772. /**
  4773. * Returns true if drawer is animating closed.
  4774. * @return {boolean}
  4775. */
  4776. }, {
  4777. key: 'isClosing',
  4778. value: function isClosing() {
  4779. return this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CLOSING);
  4780. }
  4781. /**
  4782. * Keydown handler to close drawer when key is escape.
  4783. * @param evt
  4784. */
  4785. }, {
  4786. key: 'handleKeydown',
  4787. value: function handleKeydown(evt) {
  4788. var keyCode = evt.keyCode,
  4789. key = evt.key;
  4790. var isEscape = key === 'Escape' || keyCode === 27;
  4791. if (isEscape) {
  4792. this.close();
  4793. }
  4794. }
  4795. /**
  4796. * Handles a transition end event on the root element.
  4797. * @param {!Event} evt
  4798. */
  4799. }, {
  4800. key: 'handleTransitionEnd',
  4801. value: function handleTransitionEnd(evt) {
  4802. var OPENING = __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].OPENING,
  4803. CLOSING = __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CLOSING,
  4804. OPEN = __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].OPEN,
  4805. ANIMATE = __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ANIMATE,
  4806. ROOT = __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ROOT;
  4807. // In Edge, transitionend on ripple pseudo-elements yields a target without classList, so check for Element first.
  4808. var isElement = evt.target instanceof Element;
  4809. if (!isElement || !this.adapter_.elementHasClass( /** @type {!Element} */evt.target, ROOT)) {
  4810. return;
  4811. }
  4812. if (this.isClosing()) {
  4813. this.adapter_.removeClass(OPEN);
  4814. this.adapter_.restoreFocus();
  4815. this.closed();
  4816. this.adapter_.notifyClose();
  4817. } else {
  4818. this.adapter_.focusActiveNavigationItem();
  4819. this.opened();
  4820. this.adapter_.notifyOpen();
  4821. }
  4822. this.adapter_.removeClass(ANIMATE);
  4823. this.adapter_.removeClass(OPENING);
  4824. this.adapter_.removeClass(CLOSING);
  4825. }
  4826. }], [{
  4827. key: 'strings',
  4828. /** @return enum {string} */
  4829. get: function get() {
  4830. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  4831. }
  4832. /** @return enum {string} */
  4833. }, {
  4834. key: 'cssClasses',
  4835. get: function get() {
  4836. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  4837. }
  4838. }, {
  4839. key: 'defaultAdapter',
  4840. get: function get() {
  4841. return (/** @type {!MDCDrawerAdapter} */{
  4842. addClass: function addClass() /* className: string */{},
  4843. removeClass: function removeClass() /* className: string */{},
  4844. hasClass: function hasClass() /* className: string */{},
  4845. elementHasClass: function elementHasClass() /* element: !Element, className: string */{},
  4846. computeBoundingRect: function computeBoundingRect() {},
  4847. notifyClose: function notifyClose() {},
  4848. notifyOpen: function notifyOpen() {},
  4849. saveFocus: function saveFocus() {},
  4850. restoreFocus: function restoreFocus() {},
  4851. focusActiveNavigationItem: function focusActiveNavigationItem() {},
  4852. trapFocus: function trapFocus() {},
  4853. releaseFocus: function releaseFocus() {}
  4854. }
  4855. );
  4856. }
  4857. }]);
  4858. return MDCDismissibleDrawerFoundation;
  4859. }(__WEBPACK_IMPORTED_MODULE_1__material_base_foundation__["a" /* default */]);
  4860. /* harmony default export */ __webpack_exports__["a"] = (MDCDismissibleDrawerFoundation);
  4861. /***/ }),
  4862. /* 31 */
  4863. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4864. "use strict";
  4865. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  4866. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  4867. /**
  4868. * @license
  4869. * Copyright 2016 Google Inc.
  4870. *
  4871. * Permission is hereby granted, free of charge, to any person obtaining a copy
  4872. * of this software and associated documentation files (the "Software"), to deal
  4873. * in the Software without restriction, including without limitation the rights
  4874. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  4875. * copies of the Software, and to permit persons to whom the Software is
  4876. * furnished to do so, subject to the following conditions:
  4877. *
  4878. * The above copyright notice and this permission notice shall be included in
  4879. * all copies or substantial portions of the Software.
  4880. *
  4881. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  4882. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  4883. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  4884. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  4885. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  4886. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  4887. * THE SOFTWARE.
  4888. */
  4889. /** @enum {string} */
  4890. var cssClasses = {
  4891. ROOT: 'mdc-drawer',
  4892. DISMISSIBLE: 'mdc-drawer--dismissible',
  4893. MODAL: 'mdc-drawer--modal',
  4894. OPEN: 'mdc-drawer--open',
  4895. ANIMATE: 'mdc-drawer--animate',
  4896. OPENING: 'mdc-drawer--opening',
  4897. CLOSING: 'mdc-drawer--closing'
  4898. };
  4899. /** @enum {string} */
  4900. var strings = {
  4901. APP_CONTENT_SELECTOR: '.mdc-drawer-app-content',
  4902. SCRIM_SELECTOR: '.mdc-drawer-scrim',
  4903. CLOSE_EVENT: 'MDCDrawer:closed',
  4904. OPEN_EVENT: 'MDCDrawer:opened'
  4905. };
  4906. /***/ }),
  4907. /* 32 */
  4908. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4909. "use strict";
  4910. 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; }; }();
  4911. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4912. /**
  4913. * @license
  4914. * Copyright 2018 Google Inc.
  4915. *
  4916. * Permission is hereby granted, free of charge, to any person obtaining a copy
  4917. * of this software and associated documentation files (the "Software"), to deal
  4918. * in the Software without restriction, including without limitation the rights
  4919. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  4920. * copies of the Software, and to permit persons to whom the Software is
  4921. * furnished to do so, subject to the following conditions:
  4922. *
  4923. * The above copyright notice and this permission notice shall be included in
  4924. * all copies or substantial portions of the Software.
  4925. *
  4926. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  4927. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  4928. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  4929. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  4930. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  4931. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  4932. * THE SOFTWARE.
  4933. */
  4934. /* eslint no-unused-vars: [2, {"args": "none"}] */
  4935. /**
  4936. * Adapter for MDC List. Provides an interface for managing focus.
  4937. *
  4938. * Additionally, provides type information for the adapter to the Closure
  4939. * compiler.
  4940. *
  4941. * Implement this adapter for your framework of choice to delegate updates to
  4942. * the component in your framework of choice. See architecture documentation
  4943. * for more details.
  4944. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  4945. *
  4946. * @record
  4947. */
  4948. var MDCListAdapter = function () {
  4949. function MDCListAdapter() {
  4950. _classCallCheck(this, MDCListAdapter);
  4951. }
  4952. _createClass(MDCListAdapter, [{
  4953. key: "getListItemCount",
  4954. /** @return {number} */
  4955. value: function getListItemCount() {}
  4956. /**
  4957. * @return {number} */
  4958. }, {
  4959. key: "getFocusedElementIndex",
  4960. value: function getFocusedElementIndex() {}
  4961. /**
  4962. * @param {number} index
  4963. * @param {string} attribute
  4964. * @param {string} value
  4965. */
  4966. }, {
  4967. key: "setAttributeForElementIndex",
  4968. value: function setAttributeForElementIndex(index, attribute, value) {}
  4969. /**
  4970. * @param {number} index
  4971. * @param {string} attribute
  4972. */
  4973. }, {
  4974. key: "removeAttributeForElementIndex",
  4975. value: function removeAttributeForElementIndex(index, attribute) {}
  4976. /**
  4977. * @param {number} index
  4978. * @param {string} className
  4979. */
  4980. }, {
  4981. key: "addClassForElementIndex",
  4982. value: function addClassForElementIndex(index, className) {}
  4983. /**
  4984. * @param {number} index
  4985. * @param {string} className
  4986. */
  4987. }, {
  4988. key: "removeClassForElementIndex",
  4989. value: function removeClassForElementIndex(index, className) {}
  4990. /**
  4991. * Focuses list item at the index specified.
  4992. * @param {number} index
  4993. */
  4994. }, {
  4995. key: "focusItemAtIndex",
  4996. value: function focusItemAtIndex(index) {}
  4997. /**
  4998. * Sets the tabindex to the value specified for all button/a element children of
  4999. * the list item at the index specified.
  5000. * @param {number} listItemIndex
  5001. * @param {number} tabIndexValue
  5002. */
  5003. }, {
  5004. key: "setTabIndexForListItemChildren",
  5005. value: function setTabIndexForListItemChildren(listItemIndex, tabIndexValue) {}
  5006. /**
  5007. * If the given element has an href, follows the link.
  5008. * @param {!Element} ele
  5009. */
  5010. }, {
  5011. key: "followHref",
  5012. value: function followHref(ele) {}
  5013. }]);
  5014. return MDCListAdapter;
  5015. }();
  5016. /* unused harmony default export */ var _unused_webpack_default_export = (MDCListAdapter);
  5017. /***/ }),
  5018. /* 33 */
  5019. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5020. "use strict";
  5021. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  5022. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  5023. /**
  5024. * @license
  5025. * Copyright 2018 Google Inc.
  5026. *
  5027. * Permission is hereby granted, free of charge, to any person obtaining a copy
  5028. * of this software and associated documentation files (the "Software"), to deal
  5029. * in the Software without restriction, including without limitation the rights
  5030. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  5031. * copies of the Software, and to permit persons to whom the Software is
  5032. * furnished to do so, subject to the following conditions:
  5033. *
  5034. * The above copyright notice and this permission notice shall be included in
  5035. * all copies or substantial portions of the Software.
  5036. *
  5037. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  5038. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  5039. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  5040. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  5041. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  5042. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  5043. * THE SOFTWARE.
  5044. */
  5045. /** @enum {string} */
  5046. var cssClasses = {
  5047. ROOT: 'mdc-list',
  5048. LIST_ITEM_CLASS: 'mdc-list-item',
  5049. LIST_ITEM_SELECTED_CLASS: 'mdc-list-item--selected',
  5050. LIST_ITEM_ACTIVATED_CLASS: 'mdc-list-item--activated'
  5051. };
  5052. /** @enum {string} */
  5053. var strings = {
  5054. ARIA_ORIENTATION: 'aria-orientation',
  5055. ARIA_ORIENTATION_HORIZONTAL: 'horizontal',
  5056. ARIA_SELECTED: 'aria-selected',
  5057. FOCUSABLE_CHILD_ELEMENTS: '.' + cssClasses.LIST_ITEM_CLASS + ' button:not(:disabled), .' + cssClasses.LIST_ITEM_CLASS + ' a',
  5058. ENABLED_ITEMS_SELECTOR: '.mdc-list-item:not(.mdc-list-item--disabled)'
  5059. };
  5060. /***/ }),
  5061. /* 34 */
  5062. /***/ (function(module, exports, __webpack_require__) {
  5063. var tabbable = __webpack_require__(77);
  5064. var xtend = __webpack_require__(78);
  5065. var listeningFocusTrap = null;
  5066. function focusTrap(element, userOptions) {
  5067. var doc = document;
  5068. var container =
  5069. typeof element === 'string' ? doc.querySelector(element) : element;
  5070. var config = xtend(
  5071. {
  5072. returnFocusOnDeactivate: true,
  5073. escapeDeactivates: true
  5074. },
  5075. userOptions
  5076. );
  5077. var state = {
  5078. firstTabbableNode: null,
  5079. lastTabbableNode: null,
  5080. nodeFocusedBeforeActivation: null,
  5081. mostRecentlyFocusedNode: null,
  5082. active: false,
  5083. paused: false
  5084. };
  5085. var trap = {
  5086. activate: activate,
  5087. deactivate: deactivate,
  5088. pause: pause,
  5089. unpause: unpause
  5090. };
  5091. return trap;
  5092. function activate(activateOptions) {
  5093. if (state.active) return;
  5094. updateTabbableNodes();
  5095. state.active = true;
  5096. state.paused = false;
  5097. state.nodeFocusedBeforeActivation = doc.activeElement;
  5098. var onActivate =
  5099. activateOptions && activateOptions.onActivate
  5100. ? activateOptions.onActivate
  5101. : config.onActivate;
  5102. if (onActivate) {
  5103. onActivate();
  5104. }
  5105. addListeners();
  5106. return trap;
  5107. }
  5108. function deactivate(deactivateOptions) {
  5109. if (!state.active) return;
  5110. removeListeners();
  5111. state.active = false;
  5112. state.paused = false;
  5113. var onDeactivate =
  5114. deactivateOptions && deactivateOptions.onDeactivate !== undefined
  5115. ? deactivateOptions.onDeactivate
  5116. : config.onDeactivate;
  5117. if (onDeactivate) {
  5118. onDeactivate();
  5119. }
  5120. var returnFocus =
  5121. deactivateOptions && deactivateOptions.returnFocus !== undefined
  5122. ? deactivateOptions.returnFocus
  5123. : config.returnFocusOnDeactivate;
  5124. if (returnFocus) {
  5125. delay(function() {
  5126. tryFocus(state.nodeFocusedBeforeActivation);
  5127. });
  5128. }
  5129. return trap;
  5130. }
  5131. function pause() {
  5132. if (state.paused || !state.active) return;
  5133. state.paused = true;
  5134. removeListeners();
  5135. }
  5136. function unpause() {
  5137. if (!state.paused || !state.active) return;
  5138. state.paused = false;
  5139. addListeners();
  5140. }
  5141. function addListeners() {
  5142. if (!state.active) return;
  5143. // There can be only one listening focus trap at a time
  5144. if (listeningFocusTrap) {
  5145. listeningFocusTrap.pause();
  5146. }
  5147. listeningFocusTrap = trap;
  5148. updateTabbableNodes();
  5149. // Delay ensures that the focused element doesn't capture the event
  5150. // that caused the focus trap activation.
  5151. delay(function() {
  5152. tryFocus(getInitialFocusNode());
  5153. });
  5154. doc.addEventListener('focusin', checkFocusIn, true);
  5155. doc.addEventListener('mousedown', checkPointerDown, true);
  5156. doc.addEventListener('touchstart', checkPointerDown, true);
  5157. doc.addEventListener('click', checkClick, true);
  5158. doc.addEventListener('keydown', checkKey, true);
  5159. return trap;
  5160. }
  5161. function removeListeners() {
  5162. if (!state.active || listeningFocusTrap !== trap) return;
  5163. doc.removeEventListener('focusin', checkFocusIn, true);
  5164. doc.removeEventListener('mousedown', checkPointerDown, true);
  5165. doc.removeEventListener('touchstart', checkPointerDown, true);
  5166. doc.removeEventListener('click', checkClick, true);
  5167. doc.removeEventListener('keydown', checkKey, true);
  5168. listeningFocusTrap = null;
  5169. return trap;
  5170. }
  5171. function getNodeForOption(optionName) {
  5172. var optionValue = config[optionName];
  5173. var node = optionValue;
  5174. if (!optionValue) {
  5175. return null;
  5176. }
  5177. if (typeof optionValue === 'string') {
  5178. node = doc.querySelector(optionValue);
  5179. if (!node) {
  5180. throw new Error('`' + optionName + '` refers to no known node');
  5181. }
  5182. }
  5183. if (typeof optionValue === 'function') {
  5184. node = optionValue();
  5185. if (!node) {
  5186. throw new Error('`' + optionName + '` did not return a node');
  5187. }
  5188. }
  5189. return node;
  5190. }
  5191. function getInitialFocusNode() {
  5192. var node;
  5193. if (getNodeForOption('initialFocus') !== null) {
  5194. node = getNodeForOption('initialFocus');
  5195. } else if (container.contains(doc.activeElement)) {
  5196. node = doc.activeElement;
  5197. } else {
  5198. node = state.firstTabbableNode || getNodeForOption('fallbackFocus');
  5199. }
  5200. if (!node) {
  5201. throw new Error(
  5202. "You can't have a focus-trap without at least one focusable element"
  5203. );
  5204. }
  5205. return node;
  5206. }
  5207. // This needs to be done on mousedown and touchstart instead of click
  5208. // so that it precedes the focus event.
  5209. function checkPointerDown(e) {
  5210. if (container.contains(e.target)) return;
  5211. if (config.clickOutsideDeactivates) {
  5212. deactivate({
  5213. returnFocus: !tabbable.isFocusable(e.target)
  5214. });
  5215. } else {
  5216. e.preventDefault();
  5217. }
  5218. }
  5219. // In case focus escapes the trap for some strange reason, pull it back in.
  5220. function checkFocusIn(e) {
  5221. // In Firefox when you Tab out of an iframe the Document is briefly focused.
  5222. if (container.contains(e.target) || e.target instanceof Document) {
  5223. return;
  5224. }
  5225. e.stopImmediatePropagation();
  5226. tryFocus(state.mostRecentlyFocusedNode || getInitialFocusNode());
  5227. }
  5228. function checkKey(e) {
  5229. if (config.escapeDeactivates !== false && isEscapeEvent(e)) {
  5230. e.preventDefault();
  5231. deactivate();
  5232. return;
  5233. }
  5234. if (isTabEvent(e)) {
  5235. checkTab(e);
  5236. return;
  5237. }
  5238. }
  5239. // Hijack Tab events on the first and last focusable nodes of the trap,
  5240. // in order to prevent focus from escaping. If it escapes for even a
  5241. // moment it can end up scrolling the page and causing confusion so we
  5242. // kind of need to capture the action at the keydown phase.
  5243. function checkTab(e) {
  5244. updateTabbableNodes();
  5245. if (e.shiftKey && e.target === state.firstTabbableNode) {
  5246. e.preventDefault();
  5247. tryFocus(state.lastTabbableNode);
  5248. return;
  5249. }
  5250. if (!e.shiftKey && e.target === state.lastTabbableNode) {
  5251. e.preventDefault();
  5252. tryFocus(state.firstTabbableNode);
  5253. return;
  5254. }
  5255. }
  5256. function checkClick(e) {
  5257. if (config.clickOutsideDeactivates) return;
  5258. if (container.contains(e.target)) return;
  5259. e.preventDefault();
  5260. e.stopImmediatePropagation();
  5261. }
  5262. function updateTabbableNodes() {
  5263. var tabbableNodes = tabbable(container);
  5264. state.firstTabbableNode = tabbableNodes[0] || getInitialFocusNode();
  5265. state.lastTabbableNode =
  5266. tabbableNodes[tabbableNodes.length - 1] || getInitialFocusNode();
  5267. }
  5268. function tryFocus(node) {
  5269. if (node === doc.activeElement) return;
  5270. if (!node || !node.focus) {
  5271. tryFocus(getInitialFocusNode());
  5272. return;
  5273. }
  5274. node.focus();
  5275. state.mostRecentlyFocusedNode = node;
  5276. if (isSelectableInput(node)) {
  5277. node.select();
  5278. }
  5279. }
  5280. }
  5281. function isSelectableInput(node) {
  5282. return (
  5283. node.tagName &&
  5284. node.tagName.toLowerCase() === 'input' &&
  5285. typeof node.select === 'function'
  5286. );
  5287. }
  5288. function isEscapeEvent(e) {
  5289. return e.key === 'Escape' || e.key === 'Esc' || e.keyCode === 27;
  5290. }
  5291. function isTabEvent(e) {
  5292. return e.key === 'Tab' || e.keyCode === 9;
  5293. }
  5294. function delay(fn) {
  5295. return setTimeout(fn, 0);
  5296. }
  5297. module.exports = focusTrap;
  5298. /***/ }),
  5299. /* 35 */
  5300. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5301. "use strict";
  5302. 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; }; }();
  5303. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5304. /**
  5305. * @license
  5306. * Copyright 2017 Google Inc.
  5307. *
  5308. * Permission is hereby granted, free of charge, to any person obtaining a copy
  5309. * of this software and associated documentation files (the "Software"), to deal
  5310. * in the Software without restriction, including without limitation the rights
  5311. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  5312. * copies of the Software, and to permit persons to whom the Software is
  5313. * furnished to do so, subject to the following conditions:
  5314. *
  5315. * The above copyright notice and this permission notice shall be included in
  5316. * all copies or substantial portions of the Software.
  5317. *
  5318. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  5319. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  5320. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  5321. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  5322. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  5323. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  5324. * THE SOFTWARE.
  5325. */
  5326. /* eslint no-unused-vars: [2, {"args": "none"}] */
  5327. /**
  5328. * Adapter for MDC Floating Label.
  5329. *
  5330. * Defines the shape of the adapter expected by the foundation. Implement this
  5331. * adapter to integrate the floating label into your framework. See
  5332. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  5333. * for more information.
  5334. *
  5335. * @record
  5336. */
  5337. var MDCFloatingLabelAdapter = function () {
  5338. function MDCFloatingLabelAdapter() {
  5339. _classCallCheck(this, MDCFloatingLabelAdapter);
  5340. }
  5341. _createClass(MDCFloatingLabelAdapter, [{
  5342. key: "addClass",
  5343. /**
  5344. * Adds a class to the label element.
  5345. * @param {string} className
  5346. */
  5347. value: function addClass(className) {}
  5348. /**
  5349. * Removes a class from the label element.
  5350. * @param {string} className
  5351. */
  5352. }, {
  5353. key: "removeClass",
  5354. value: function removeClass(className) {}
  5355. /**
  5356. * Returns the width of the label element.
  5357. * @return {number}
  5358. */
  5359. }, {
  5360. key: "getWidth",
  5361. value: function getWidth() {}
  5362. /**
  5363. * Registers an event listener on the root element for a given event.
  5364. * @param {string} evtType
  5365. * @param {function(!Event): undefined} handler
  5366. */
  5367. }, {
  5368. key: "registerInteractionHandler",
  5369. value: function registerInteractionHandler(evtType, handler) {}
  5370. /**
  5371. * Deregisters an event listener on the root element for a given event.
  5372. * @param {string} evtType
  5373. * @param {function(!Event): undefined} handler
  5374. */
  5375. }, {
  5376. key: "deregisterInteractionHandler",
  5377. value: function deregisterInteractionHandler(evtType, handler) {}
  5378. }]);
  5379. return MDCFloatingLabelAdapter;
  5380. }();
  5381. /* unused harmony default export */ var _unused_webpack_default_export = (MDCFloatingLabelAdapter);
  5382. /***/ }),
  5383. /* 36 */
  5384. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5385. "use strict";
  5386. 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; }; }();
  5387. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5388. /**
  5389. * @license
  5390. * Copyright 2018 Google Inc.
  5391. *
  5392. * Permission is hereby granted, free of charge, to any person obtaining a copy
  5393. * of this software and associated documentation files (the "Software"), to deal
  5394. * in the Software without restriction, including without limitation the rights
  5395. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  5396. * copies of the Software, and to permit persons to whom the Software is
  5397. * furnished to do so, subject to the following conditions:
  5398. *
  5399. * The above copyright notice and this permission notice shall be included in
  5400. * all copies or substantial portions of the Software.
  5401. *
  5402. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  5403. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  5404. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  5405. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  5406. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  5407. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  5408. * THE SOFTWARE.
  5409. */
  5410. /* eslint no-unused-vars: [2, {"args": "none"}] */
  5411. /**
  5412. * Adapter for MDC TextField Line Ripple.
  5413. *
  5414. * Defines the shape of the adapter expected by the foundation. Implement this
  5415. * adapter to integrate the line ripple into your framework. See
  5416. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  5417. * for more information.
  5418. *
  5419. * @record
  5420. */
  5421. var MDCLineRippleAdapter = function () {
  5422. function MDCLineRippleAdapter() {
  5423. _classCallCheck(this, MDCLineRippleAdapter);
  5424. }
  5425. _createClass(MDCLineRippleAdapter, [{
  5426. key: "addClass",
  5427. /**
  5428. * Adds a class to the line ripple element.
  5429. * @param {string} className
  5430. */
  5431. value: function addClass(className) {}
  5432. /**
  5433. * Removes a class from the line ripple element.
  5434. * @param {string} className
  5435. */
  5436. }, {
  5437. key: "removeClass",
  5438. value: function removeClass(className) {}
  5439. /**
  5440. * @param {string} className
  5441. * @return {boolean}
  5442. */
  5443. }, {
  5444. key: "hasClass",
  5445. value: function hasClass(className) {}
  5446. /**
  5447. * Sets the style property with propertyName to value on the root element.
  5448. * @param {string} propertyName
  5449. * @param {string} value
  5450. */
  5451. }, {
  5452. key: "setStyle",
  5453. value: function setStyle(propertyName, value) {}
  5454. /**
  5455. * Registers an event listener on the line ripple element for a given event.
  5456. * @param {string} evtType
  5457. * @param {function(!Event): undefined} handler
  5458. */
  5459. }, {
  5460. key: "registerEventHandler",
  5461. value: function registerEventHandler(evtType, handler) {}
  5462. /**
  5463. * Deregisters an event listener on the line ripple element for a given event.
  5464. * @param {string} evtType
  5465. * @param {function(!Event): undefined} handler
  5466. */
  5467. }, {
  5468. key: "deregisterEventHandler",
  5469. value: function deregisterEventHandler(evtType, handler) {}
  5470. }]);
  5471. return MDCLineRippleAdapter;
  5472. }();
  5473. /* unused harmony default export */ var _unused_webpack_default_export = (MDCLineRippleAdapter);
  5474. /***/ }),
  5475. /* 37 */
  5476. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5477. "use strict";
  5478. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  5479. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  5480. /**
  5481. * @license
  5482. * Copyright 2018 Google Inc.
  5483. *
  5484. * Permission is hereby granted, free of charge, to any person obtaining a copy
  5485. * of this software and associated documentation files (the "Software"), to deal
  5486. * in the Software without restriction, including without limitation the rights
  5487. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  5488. * copies of the Software, and to permit persons to whom the Software is
  5489. * furnished to do so, subject to the following conditions:
  5490. *
  5491. * The above copyright notice and this permission notice shall be included in
  5492. * all copies or substantial portions of the Software.
  5493. *
  5494. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  5495. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  5496. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  5497. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  5498. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  5499. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  5500. * THE SOFTWARE.
  5501. */
  5502. /** @enum {string} */
  5503. var cssClasses = {
  5504. ROOT: 'mdc-menu',
  5505. MENU_SELECTED_LIST_ITEM: 'mdc-menu-item--selected',
  5506. MENU_SELECTION_GROUP: 'mdc-menu__selection-group'
  5507. };
  5508. /** @enum {string} */
  5509. var strings = {
  5510. SELECTED_EVENT: 'MDCMenu:selected',
  5511. ARIA_SELECTED_ATTR: 'aria-selected',
  5512. LIST_SELECTOR: '.mdc-list',
  5513. CHECKBOX_SELECTOR: 'input[type="checkbox"]'
  5514. };
  5515. /***/ }),
  5516. /* 38 */
  5517. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5518. "use strict";
  5519. /* unused harmony export MDCMenuSurfaceAdapter */
  5520. 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; }; }();
  5521. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5522. /**
  5523. * @license
  5524. * Copyright 2018 Google Inc.
  5525. *
  5526. * Permission is hereby granted, free of charge, to any person obtaining a copy
  5527. * of this software and associated documentation files (the "Software"), to deal
  5528. * in the Software without restriction, including without limitation the rights
  5529. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  5530. * copies of the Software, and to permit persons to whom the Software is
  5531. * furnished to do so, subject to the following conditions:
  5532. *
  5533. * The above copyright notice and this permission notice shall be included in
  5534. * all copies or substantial portions of the Software.
  5535. *
  5536. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  5537. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  5538. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  5539. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  5540. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  5541. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  5542. * THE SOFTWARE.
  5543. */
  5544. /* eslint no-unused-vars: [2, {"args": "none"}] */
  5545. /**
  5546. * Adapter for MDCMenuSurface. Provides an interface for managing
  5547. * - classes
  5548. * - dom
  5549. * - focus
  5550. * - position
  5551. * - dimensions
  5552. * - event handlers
  5553. *
  5554. * Additionally, provides type information for the adapter to the Closure
  5555. * compiler.
  5556. *
  5557. * Implement this adapter for your framework of choice to delegate updates to
  5558. * the component in your framework of choice. See architecture documentation
  5559. * for more details.
  5560. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  5561. *
  5562. * @record
  5563. */
  5564. var MDCMenuSurfaceAdapter = function () {
  5565. function MDCMenuSurfaceAdapter() {
  5566. _classCallCheck(this, MDCMenuSurfaceAdapter);
  5567. }
  5568. _createClass(MDCMenuSurfaceAdapter, [{
  5569. key: "addClass",
  5570. /** @param {string} className */
  5571. value: function addClass(className) {}
  5572. /** @param {string} className */
  5573. }, {
  5574. key: "removeClass",
  5575. value: function removeClass(className) {}
  5576. /**
  5577. * @param {string} className
  5578. * @return {boolean}
  5579. */
  5580. }, {
  5581. key: "hasClass",
  5582. value: function hasClass(className) {}
  5583. /** @return {boolean} */
  5584. }, {
  5585. key: "hasAnchor",
  5586. value: function hasAnchor() {}
  5587. /** Emits an event when the menu surface is closed. */
  5588. }, {
  5589. key: "notifyClose",
  5590. value: function notifyClose() {}
  5591. /** Emits an event when the menu surface is opened. */
  5592. }, {
  5593. key: "notifyOpen",
  5594. value: function notifyOpen() {}
  5595. /**
  5596. * @return {boolean}
  5597. * @param {EventTarget} el
  5598. */
  5599. }, {
  5600. key: "isElementInContainer",
  5601. value: function isElementInContainer(el) {}
  5602. /** @return {boolean} */
  5603. }, {
  5604. key: "isRtl",
  5605. value: function isRtl() {}
  5606. /** @param {string} origin */
  5607. }, {
  5608. key: "setTransformOrigin",
  5609. value: function setTransformOrigin(origin) {}
  5610. /** @return {boolean} */
  5611. }, {
  5612. key: "isFocused",
  5613. value: function isFocused() {}
  5614. /** Saves the element that was focused before the menu surface was opened. */
  5615. }, {
  5616. key: "saveFocus",
  5617. value: function saveFocus() {}
  5618. /** Restores focus to the element that was focused before the menu surface was opened. */
  5619. }, {
  5620. key: "restoreFocus",
  5621. value: function restoreFocus() {}
  5622. /** @return {boolean} */
  5623. }, {
  5624. key: "isFirstElementFocused",
  5625. value: function isFirstElementFocused() {}
  5626. /** @return {boolean} */
  5627. }, {
  5628. key: "isLastElementFocused",
  5629. value: function isLastElementFocused() {}
  5630. /** Focuses the first focusable element in the menu-surface. */
  5631. }, {
  5632. key: "focusFirstElement",
  5633. value: function focusFirstElement() {}
  5634. /** Focuses the first focusable element in the menu-surface. */
  5635. }, {
  5636. key: "focusLastElement",
  5637. value: function focusLastElement() {}
  5638. /** @return {!{width: number, height: number}} */
  5639. }, {
  5640. key: "getInnerDimensions",
  5641. value: function getInnerDimensions() {}
  5642. /** @return {!{width: number, height: number, top: number, right: number, bottom: number, left: number}} */
  5643. }, {
  5644. key: "getAnchorDimensions",
  5645. value: function getAnchorDimensions() {}
  5646. /** @return {!{ width: number, height: number }} */
  5647. }, {
  5648. key: "getWindowDimensions",
  5649. value: function getWindowDimensions() {}
  5650. /** @return {!{ width: number, height: number }} */
  5651. }, {
  5652. key: "getBodyDimensions",
  5653. value: function getBodyDimensions() {}
  5654. /** @return {!{ width: number, height: number }} */
  5655. }, {
  5656. key: "getWindowScroll",
  5657. value: function getWindowScroll() {}
  5658. /** @param {!{
  5659. * top: (string|undefined),
  5660. * right: (string|undefined),
  5661. * bottom: (string|undefined),
  5662. * left: (string|undefined)
  5663. * }} position */
  5664. }, {
  5665. key: "setPosition",
  5666. value: function setPosition(position) {}
  5667. /** @param {string} height */
  5668. }, {
  5669. key: "setMaxHeight",
  5670. value: function setMaxHeight(height) {}
  5671. }]);
  5672. return MDCMenuSurfaceAdapter;
  5673. }();
  5674. /***/ }),
  5675. /* 39 */
  5676. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5677. "use strict";
  5678. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return cssClasses; });
  5679. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return strings; });
  5680. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return numbers; });
  5681. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return CornerBit; });
  5682. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Corner; });
  5683. /**
  5684. * @license
  5685. * Copyright 2018 Google Inc.
  5686. *
  5687. * Permission is hereby granted, free of charge, to any person obtaining a copy
  5688. * of this software and associated documentation files (the "Software"), to deal
  5689. * in the Software without restriction, including without limitation the rights
  5690. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  5691. * copies of the Software, and to permit persons to whom the Software is
  5692. * furnished to do so, subject to the following conditions:
  5693. *
  5694. * The above copyright notice and this permission notice shall be included in
  5695. * all copies or substantial portions of the Software.
  5696. *
  5697. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  5698. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  5699. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  5700. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  5701. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  5702. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  5703. * THE SOFTWARE.
  5704. */
  5705. /** @enum {string} */
  5706. var cssClasses = {
  5707. ANCHOR: 'mdc-menu-surface--anchor',
  5708. ANIMATING_CLOSED: 'mdc-menu-surface--animating-closed',
  5709. ANIMATING_OPEN: 'mdc-menu-surface--animating-open',
  5710. FIXED: 'mdc-menu-surface--fixed',
  5711. OPEN: 'mdc-menu-surface--open',
  5712. ROOT: 'mdc-menu-surface'
  5713. };
  5714. /** @enum {string} */
  5715. var strings = {
  5716. CLOSED_EVENT: 'MDCMenuSurface:closed',
  5717. OPENED_EVENT: 'MDCMenuSurface:opened',
  5718. FOCUSABLE_ELEMENTS: 'button:not(:disabled), [href]:not([aria-disabled="true"]), input:not(:disabled), ' + 'select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex="-1"]):not([aria-disabled="true"])'
  5719. };
  5720. /** @enum {number} */
  5721. var numbers = {
  5722. // Total duration of menu-surface open animation.
  5723. TRANSITION_OPEN_DURATION: 120,
  5724. // Total duration of menu-surface close animation.
  5725. TRANSITION_CLOSE_DURATION: 75,
  5726. // Margin left to the edge of the viewport when menu-surface is at maximum possible height.
  5727. MARGIN_TO_EDGE: 32,
  5728. // Ratio of anchor width to menu-surface width for switching from corner positioning to center positioning.
  5729. ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO: 0.67
  5730. };
  5731. /**
  5732. * Enum for bits in the {@see Corner) bitmap.
  5733. * @enum {number}
  5734. */
  5735. var CornerBit = {
  5736. BOTTOM: 1,
  5737. CENTER: 2,
  5738. RIGHT: 4,
  5739. FLIP_RTL: 8
  5740. };
  5741. /**
  5742. * Enum for representing an element corner for positioning the menu-surface.
  5743. *
  5744. * The START constants map to LEFT if element directionality is left
  5745. * to right and RIGHT if the directionality is right to left.
  5746. * Likewise END maps to RIGHT or LEFT depending on the directionality.
  5747. *
  5748. * @enum {number}
  5749. */
  5750. var Corner = {
  5751. TOP_LEFT: 0,
  5752. TOP_RIGHT: CornerBit.RIGHT,
  5753. BOTTOM_LEFT: CornerBit.BOTTOM,
  5754. BOTTOM_RIGHT: CornerBit.BOTTOM | CornerBit.RIGHT,
  5755. TOP_START: CornerBit.FLIP_RTL,
  5756. TOP_END: CornerBit.FLIP_RTL | CornerBit.RIGHT,
  5757. BOTTOM_START: CornerBit.BOTTOM | CornerBit.FLIP_RTL,
  5758. BOTTOM_END: CornerBit.BOTTOM | CornerBit.RIGHT | CornerBit.FLIP_RTL
  5759. };
  5760. /***/ }),
  5761. /* 40 */
  5762. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5763. "use strict";
  5764. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  5765. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCMenuSurface", function() { return MDCMenuSurface; });
  5766. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  5767. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util__ = __webpack_require__(104);
  5768. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(18);
  5769. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__adapter__ = __webpack_require__(38);
  5770. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__constants__ = __webpack_require__(39);
  5771. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCMenuSurfaceFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["b"]; });
  5772. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "AnchorMargin", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  5773. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Corner", function() { return __WEBPACK_IMPORTED_MODULE_4__constants__["a"]; });
  5774. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "CornerBit", function() { return __WEBPACK_IMPORTED_MODULE_4__constants__["b"]; });
  5775. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "util", function() { return __WEBPACK_IMPORTED_MODULE_1__util__; });
  5776. 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; };
  5777. 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; }; }();
  5778. 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); } };
  5779. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5780. 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; }
  5781. 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; }
  5782. /**
  5783. * @license
  5784. * Copyright 2018 Google Inc.
  5785. *
  5786. * Permission is hereby granted, free of charge, to any person obtaining a copy
  5787. * of this software and associated documentation files (the "Software"), to deal
  5788. * in the Software without restriction, including without limitation the rights
  5789. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  5790. * copies of the Software, and to permit persons to whom the Software is
  5791. * furnished to do so, subject to the following conditions:
  5792. *
  5793. * The above copyright notice and this permission notice shall be included in
  5794. * all copies or substantial portions of the Software.
  5795. *
  5796. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  5797. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  5798. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  5799. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  5800. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  5801. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  5802. * THE SOFTWARE.
  5803. */
  5804. /**
  5805. * @extends MDCComponent<!MDCMenuSurfaceFoundation>
  5806. */
  5807. var MDCMenuSurface = function (_MDCComponent) {
  5808. _inherits(MDCMenuSurface, _MDCComponent);
  5809. /** @param {...?} args */
  5810. function MDCMenuSurface() {
  5811. var _ref;
  5812. _classCallCheck(this, MDCMenuSurface);
  5813. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  5814. args[_key] = arguments[_key];
  5815. }
  5816. /** @private {!Element} */
  5817. var _this = _possibleConstructorReturn(this, (_ref = MDCMenuSurface.__proto__ || Object.getPrototypeOf(MDCMenuSurface)).call.apply(_ref, [this].concat(args)));
  5818. _this.previousFocus_;
  5819. /** @private {!Element} */
  5820. _this.anchorElement;
  5821. /** @private {Element} */
  5822. _this.firstFocusableElement_;
  5823. /** @private {Element} */
  5824. _this.lastFocusableElement_;
  5825. /** @private {!Function} */
  5826. _this.handleKeydown_;
  5827. /** @private {!Function} */
  5828. _this.handleBodyClick_;
  5829. /** @private {!Function} */
  5830. _this.registerBodyClickListener_;
  5831. /** @private {!Function} */
  5832. _this.deregisterBodyClickListener_;
  5833. return _this;
  5834. }
  5835. /**
  5836. * @param {!Element} root
  5837. * @return {!MDCMenuSurface}
  5838. */
  5839. _createClass(MDCMenuSurface, [{
  5840. key: 'initialSyncWithDOM',
  5841. value: function initialSyncWithDOM() {
  5842. var _this2 = this;
  5843. if (this.root_.parentElement && this.root_.parentElement.classList.contains(__WEBPACK_IMPORTED_MODULE_4__constants__["c" /* cssClasses */].ANCHOR)) {
  5844. this.anchorElement = this.root_.parentElement;
  5845. }
  5846. if (this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_4__constants__["c" /* cssClasses */].FIXED)) {
  5847. this.setFixedPosition(true);
  5848. }
  5849. this.handleKeydown_ = function (evt) {
  5850. return _this2.foundation_.handleKeydown(evt);
  5851. };
  5852. this.handleBodyClick_ = function (evt) {
  5853. return _this2.foundation_.handleBodyClick(evt);
  5854. };
  5855. this.registerBodyClickListener_ = function () {
  5856. return document.body.addEventListener('click', _this2.handleBodyClick_);
  5857. };
  5858. this.deregisterBodyClickListener_ = function () {
  5859. return document.body.removeEventListener('click', _this2.handleBodyClick_);
  5860. };
  5861. this.root_.addEventListener('keydown', this.handleKeydown_);
  5862. this.root_.addEventListener(__WEBPACK_IMPORTED_MODULE_4__constants__["e" /* strings */].OPENED_EVENT, this.registerBodyClickListener_);
  5863. this.root_.addEventListener(__WEBPACK_IMPORTED_MODULE_4__constants__["e" /* strings */].CLOSED_EVENT, this.deregisterBodyClickListener_);
  5864. }
  5865. }, {
  5866. key: 'destroy',
  5867. value: function destroy() {
  5868. this.root_.removeEventListener('keydown', this.handleKeydown_);
  5869. this.root_.removeEventListener(__WEBPACK_IMPORTED_MODULE_4__constants__["e" /* strings */].OPENED_EVENT, this.registerBodyClickListener_);
  5870. this.root_.removeEventListener(__WEBPACK_IMPORTED_MODULE_4__constants__["e" /* strings */].CLOSED_EVENT, this.deregisterBodyClickListener_);
  5871. _get(MDCMenuSurface.prototype.__proto__ || Object.getPrototypeOf(MDCMenuSurface.prototype), 'destroy', this).call(this);
  5872. }
  5873. /** @return {boolean} */
  5874. }, {
  5875. key: 'hoistMenuToBody',
  5876. /**
  5877. * Removes the menu-surface from it's current location and appends it to the
  5878. * body to overcome any overflow:hidden issues.
  5879. */
  5880. value: function hoistMenuToBody() {
  5881. document.body.appendChild(this.root_.parentElement.removeChild(this.root_));
  5882. this.setIsHoisted(true);
  5883. }
  5884. /**
  5885. * Sets the foundation to use page offsets for an positioning when the menu
  5886. * is hoisted to the body.
  5887. * @param {boolean} isHoisted
  5888. */
  5889. }, {
  5890. key: 'setIsHoisted',
  5891. value: function setIsHoisted(isHoisted) {
  5892. this.foundation_.setIsHoisted(isHoisted);
  5893. }
  5894. /**
  5895. * Sets the element that the menu-surface is anchored to.
  5896. * @param {!Element} element
  5897. */
  5898. }, {
  5899. key: 'setMenuSurfaceAnchorElement',
  5900. value: function setMenuSurfaceAnchorElement(element) {
  5901. this.anchorElement = element;
  5902. }
  5903. /**
  5904. * Sets the menu-surface to position: fixed.
  5905. * @param {boolean} isFixed
  5906. */
  5907. }, {
  5908. key: 'setFixedPosition',
  5909. value: function setFixedPosition(isFixed) {
  5910. if (isFixed) {
  5911. this.root_.classList.add(__WEBPACK_IMPORTED_MODULE_4__constants__["c" /* cssClasses */].FIXED);
  5912. } else {
  5913. this.root_.classList.remove(__WEBPACK_IMPORTED_MODULE_4__constants__["c" /* cssClasses */].FIXED);
  5914. }
  5915. this.foundation_.setFixedPosition(isFixed);
  5916. }
  5917. /**
  5918. * Sets the absolute x/y position to position based on. Requires the menu to be hoisted.
  5919. * @param {number} x
  5920. * @param {number} y
  5921. */
  5922. }, {
  5923. key: 'setAbsolutePosition',
  5924. value: function setAbsolutePosition(x, y) {
  5925. this.foundation_.setAbsolutePosition(x, y);
  5926. this.setIsHoisted(true);
  5927. }
  5928. /**
  5929. * @param {!Corner} corner Default anchor corner alignment of top-left
  5930. * surface corner.
  5931. */
  5932. }, {
  5933. key: 'setAnchorCorner',
  5934. value: function setAnchorCorner(corner) {
  5935. this.foundation_.setAnchorCorner(corner);
  5936. }
  5937. /**
  5938. * @param {!AnchorMargin} margin
  5939. */
  5940. }, {
  5941. key: 'setAnchorMargin',
  5942. value: function setAnchorMargin(margin) {
  5943. this.foundation_.setAnchorMargin(margin);
  5944. }
  5945. /** @param {boolean} quickOpen */
  5946. }, {
  5947. key: 'getDefaultFoundation',
  5948. /** @return {!MDCMenuSurfaceFoundation} */
  5949. value: function getDefaultFoundation() {
  5950. var _this3 = this;
  5951. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["b" /* MDCMenuSurfaceFoundation */](
  5952. /** @type {!MDCMenuSurfaceAdapter} */_extends({
  5953. addClass: function addClass(className) {
  5954. return _this3.root_.classList.add(className);
  5955. },
  5956. removeClass: function removeClass(className) {
  5957. return _this3.root_.classList.remove(className);
  5958. },
  5959. hasClass: function hasClass(className) {
  5960. return _this3.root_.classList.contains(className);
  5961. },
  5962. hasAnchor: function hasAnchor() {
  5963. return !!_this3.anchorElement;
  5964. },
  5965. notifyClose: function notifyClose() {
  5966. return _this3.emit(__WEBPACK_IMPORTED_MODULE_2__foundation__["b" /* MDCMenuSurfaceFoundation */].strings.CLOSED_EVENT, {});
  5967. },
  5968. notifyOpen: function notifyOpen() {
  5969. return _this3.emit(__WEBPACK_IMPORTED_MODULE_2__foundation__["b" /* MDCMenuSurfaceFoundation */].strings.OPENED_EVENT, {});
  5970. },
  5971. isElementInContainer: function isElementInContainer(el) {
  5972. return _this3.root_ === el || _this3.root_.contains(el);
  5973. },
  5974. isRtl: function isRtl() {
  5975. return getComputedStyle(_this3.root_).getPropertyValue('direction') === 'rtl';
  5976. },
  5977. setTransformOrigin: function setTransformOrigin(origin) {
  5978. _this3.root_.style[__WEBPACK_IMPORTED_MODULE_1__util__["getTransformPropertyName"](window) + '-origin'] = origin;
  5979. }
  5980. }, this.getFocusAdapterMethods_(), this.getDimensionAdapterMethods_()));
  5981. }
  5982. /**
  5983. * @return {!{
  5984. * isFocused: function(): boolean,
  5985. * saveFocus: function(),
  5986. * restoreFocus: function(),
  5987. * isFirstElementFocused: function(): boolean,
  5988. * isLastElementFocused: function(): boolean,
  5989. * focusFirstElement: function(),
  5990. * focusLastElement: function(),
  5991. * }}
  5992. * @private
  5993. */
  5994. }, {
  5995. key: 'getFocusAdapterMethods_',
  5996. value: function getFocusAdapterMethods_() {
  5997. var _this4 = this;
  5998. return {
  5999. isFocused: function isFocused() {
  6000. return document.activeElement === _this4.root_;
  6001. },
  6002. saveFocus: function saveFocus() {
  6003. _this4.previousFocus_ = document.activeElement;
  6004. },
  6005. restoreFocus: function restoreFocus() {
  6006. if (_this4.root_.contains(document.activeElement)) {
  6007. if (_this4.previousFocus_ && _this4.previousFocus_.focus) {
  6008. _this4.previousFocus_.focus();
  6009. }
  6010. }
  6011. },
  6012. isFirstElementFocused: function isFirstElementFocused() {
  6013. return _this4.firstFocusableElement_ && _this4.firstFocusableElement_ === document.activeElement;
  6014. },
  6015. isLastElementFocused: function isLastElementFocused() {
  6016. return _this4.lastFocusableElement_ && _this4.lastFocusableElement_ === document.activeElement;
  6017. },
  6018. focusFirstElement: function focusFirstElement() {
  6019. return _this4.firstFocusableElement_ && _this4.firstFocusableElement_.focus && _this4.firstFocusableElement_.focus();
  6020. },
  6021. focusLastElement: function focusLastElement() {
  6022. return _this4.lastFocusableElement_ && _this4.lastFocusableElement_.focus && _this4.lastFocusableElement_.focus();
  6023. }
  6024. };
  6025. }
  6026. /**
  6027. * @return {!{
  6028. * getInnerDimensions: function(),
  6029. * getAnchorDimensions: function(): (HTMLElement | null | * | ClientRect),
  6030. * getWindowDimensions: function(),
  6031. * setPosition: function(*),
  6032. * setMaxHeight: function(string)}}
  6033. * @private
  6034. */
  6035. }, {
  6036. key: 'getDimensionAdapterMethods_',
  6037. value: function getDimensionAdapterMethods_() {
  6038. var _this5 = this;
  6039. return {
  6040. getInnerDimensions: function getInnerDimensions() {
  6041. return { width: _this5.root_.offsetWidth, height: _this5.root_.offsetHeight };
  6042. },
  6043. getAnchorDimensions: function getAnchorDimensions() {
  6044. return _this5.anchorElement && _this5.anchorElement.getBoundingClientRect();
  6045. },
  6046. getWindowDimensions: function getWindowDimensions() {
  6047. return { width: window.innerWidth, height: window.innerHeight };
  6048. },
  6049. getBodyDimensions: function getBodyDimensions() {
  6050. return { width: document.body.clientWidth, height: document.body.clientHeight };
  6051. },
  6052. getWindowScroll: function getWindowScroll() {
  6053. return { x: window.pageXOffset, y: window.pageYOffset };
  6054. },
  6055. setPosition: function setPosition(position) {
  6056. _this5.root_.style.left = 'left' in position ? position.left : null;
  6057. _this5.root_.style.right = 'right' in position ? position.right : null;
  6058. _this5.root_.style.top = 'top' in position ? position.top : null;
  6059. _this5.root_.style.bottom = 'bottom' in position ? position.bottom : null;
  6060. },
  6061. setMaxHeight: function setMaxHeight(height) {
  6062. _this5.root_.style.maxHeight = height;
  6063. }
  6064. };
  6065. }
  6066. }, {
  6067. key: 'open',
  6068. get: function get() {
  6069. return this.foundation_.isOpen();
  6070. }
  6071. /** @param {boolean} value */
  6072. ,
  6073. set: function set(value) {
  6074. if (value) {
  6075. var focusableElements = this.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_4__constants__["e" /* strings */].FOCUSABLE_ELEMENTS);
  6076. this.firstFocusableElement_ = focusableElements.length > 0 ? focusableElements[0] : null;
  6077. this.lastFocusableElement_ = focusableElements.length > 0 ? focusableElements[focusableElements.length - 1] : null;
  6078. this.foundation_.open();
  6079. } else {
  6080. this.foundation_.close();
  6081. }
  6082. }
  6083. }, {
  6084. key: 'quickOpen',
  6085. set: function set(quickOpen) {
  6086. this.foundation_.setQuickOpen(quickOpen);
  6087. }
  6088. }], [{
  6089. key: 'attachTo',
  6090. value: function attachTo(root) {
  6091. return new MDCMenuSurface(root);
  6092. }
  6093. }]);
  6094. return MDCMenuSurface;
  6095. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  6096. /***/ }),
  6097. /* 41 */
  6098. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6099. "use strict";
  6100. 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; }; }();
  6101. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6102. /**
  6103. * @license
  6104. * Copyright 2017 Google Inc.
  6105. *
  6106. * Permission is hereby granted, free of charge, to any person obtaining a copy
  6107. * of this software and associated documentation files (the "Software"), to deal
  6108. * in the Software without restriction, including without limitation the rights
  6109. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  6110. * copies of the Software, and to permit persons to whom the Software is
  6111. * furnished to do so, subject to the following conditions:
  6112. *
  6113. * The above copyright notice and this permission notice shall be included in
  6114. * all copies or substantial portions of the Software.
  6115. *
  6116. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  6117. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  6118. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  6119. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  6120. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  6121. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  6122. * THE SOFTWARE.
  6123. */
  6124. /* eslint no-unused-vars: [2, {"args": "none"}] */
  6125. /**
  6126. * Adapter for MDC Notched Outline.
  6127. *
  6128. * Defines the shape of the adapter expected by the foundation. Implement this
  6129. * adapter to integrate the Notched Outline into your framework. See
  6130. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  6131. * for more information.
  6132. *
  6133. * @record
  6134. */
  6135. var MDCNotchedOutlineAdapter = function () {
  6136. function MDCNotchedOutlineAdapter() {
  6137. _classCallCheck(this, MDCNotchedOutlineAdapter);
  6138. }
  6139. _createClass(MDCNotchedOutlineAdapter, [{
  6140. key: "getWidth",
  6141. /**
  6142. * Returns the width of the root element.
  6143. * @return {number}
  6144. */
  6145. value: function getWidth() {}
  6146. /**
  6147. * Returns the height of the root element.
  6148. * @return {number}
  6149. */
  6150. }, {
  6151. key: "getHeight",
  6152. value: function getHeight() {}
  6153. /**
  6154. * Adds a class to the root element.
  6155. * @param {string} className
  6156. */
  6157. }, {
  6158. key: "addClass",
  6159. value: function addClass(className) {}
  6160. /**
  6161. * Removes a class from the root element.
  6162. * @param {string} className
  6163. */
  6164. }, {
  6165. key: "removeClass",
  6166. value: function removeClass(className) {}
  6167. /**
  6168. * Sets the "d" attribute of the outline element's SVG path.
  6169. * @param {string} value
  6170. */
  6171. }, {
  6172. key: "setOutlinePathAttr",
  6173. value: function setOutlinePathAttr(value) {}
  6174. /**
  6175. * Returns the idle outline element's computed style value of the given css property `propertyName`.
  6176. * We achieve this via `getComputedStyle(...).getPropertyValue(propertyName)`.
  6177. * @param {string} propertyName
  6178. * @return {string}
  6179. */
  6180. }, {
  6181. key: "getIdleOutlineStyleValue",
  6182. value: function getIdleOutlineStyleValue(propertyName) {}
  6183. }]);
  6184. return MDCNotchedOutlineAdapter;
  6185. }();
  6186. /* unused harmony default export */ var _unused_webpack_default_export = (MDCNotchedOutlineAdapter);
  6187. /***/ }),
  6188. /* 42 */
  6189. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6190. "use strict";
  6191. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  6192. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  6193. /**
  6194. * @license
  6195. * Copyright 2018 Google Inc.
  6196. *
  6197. * Permission is hereby granted, free of charge, to any person obtaining a copy
  6198. * of this software and associated documentation files (the "Software"), to deal
  6199. * in the Software without restriction, including without limitation the rights
  6200. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  6201. * copies of the Software, and to permit persons to whom the Software is
  6202. * furnished to do so, subject to the following conditions:
  6203. *
  6204. * The above copyright notice and this permission notice shall be included in
  6205. * all copies or substantial portions of the Software.
  6206. *
  6207. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  6208. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  6209. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  6210. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  6211. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  6212. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  6213. * THE SOFTWARE.
  6214. */
  6215. /** @enum {string} */
  6216. var strings = {
  6217. PATH_SELECTOR: '.mdc-notched-outline__path',
  6218. IDLE_OUTLINE_SELECTOR: '.mdc-notched-outline__idle'
  6219. };
  6220. /** @enum {string} */
  6221. var cssClasses = {
  6222. OUTLINE_NOTCHED: 'mdc-notched-outline--notched'
  6223. };
  6224. /***/ }),
  6225. /* 43 */
  6226. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6227. "use strict";
  6228. 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; }; }();
  6229. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6230. /**
  6231. * @license
  6232. * Copyright 2018 Google Inc.
  6233. *
  6234. * Permission is hereby granted, free of charge, to any person obtaining a copy
  6235. * of this software and associated documentation files (the "Software"), to deal
  6236. * in the Software without restriction, including without limitation the rights
  6237. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  6238. * copies of the Software, and to permit persons to whom the Software is
  6239. * furnished to do so, subject to the following conditions:
  6240. *
  6241. * The above copyright notice and this permission notice shall be included in
  6242. * all copies or substantial portions of the Software.
  6243. *
  6244. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  6245. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  6246. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  6247. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  6248. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  6249. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  6250. * THE SOFTWARE.
  6251. */
  6252. /* eslint no-unused-vars: [2, {"args": "none"}] */
  6253. /**
  6254. * Adapter for MDC Select. Provides an interface for managing
  6255. * - classes
  6256. * - dom
  6257. * - event handlers
  6258. *
  6259. * Additionally, provides type information for the adapter to the Closure
  6260. * compiler.
  6261. *
  6262. * Implement this adapter for your framework of choice to delegate updates to
  6263. * the component in your framework of choice. See architecture documentation
  6264. * for more details.
  6265. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  6266. *
  6267. * @record
  6268. */
  6269. var MDCSelectAdapter = function () {
  6270. function MDCSelectAdapter() {
  6271. _classCallCheck(this, MDCSelectAdapter);
  6272. }
  6273. _createClass(MDCSelectAdapter, [{
  6274. key: "addClass",
  6275. /**
  6276. * Adds class to root element.
  6277. * @param {string} className
  6278. */
  6279. value: function addClass(className) {}
  6280. /**
  6281. * Removes a class from the root element.
  6282. * @param {string} className
  6283. */
  6284. }, {
  6285. key: "removeClass",
  6286. value: function removeClass(className) {}
  6287. /**
  6288. * Returns true if the root element contains the given class name.
  6289. * @param {string} className
  6290. * @return {boolean}
  6291. */
  6292. }, {
  6293. key: "hasClass",
  6294. value: function hasClass(className) {}
  6295. /**
  6296. * Activates the bottom line, showing a focused state.
  6297. */
  6298. }, {
  6299. key: "activateBottomLine",
  6300. value: function activateBottomLine() {}
  6301. /**
  6302. * Deactivates the bottom line.
  6303. */
  6304. }, {
  6305. key: "deactivateBottomLine",
  6306. value: function deactivateBottomLine() {}
  6307. /**
  6308. * Returns the selected value of the select element.
  6309. * @return {string}
  6310. */
  6311. }, {
  6312. key: "getValue",
  6313. value: function getValue() {}
  6314. /**
  6315. * Returns true if the direction of the root element is set to RTL.
  6316. * @return {boolean}
  6317. */
  6318. }, {
  6319. key: "isRtl",
  6320. value: function isRtl() {}
  6321. /**
  6322. * Returns true if label element exists, false if it doesn't.
  6323. * @return {boolean}
  6324. */
  6325. }, {
  6326. key: "hasLabel",
  6327. value: function hasLabel() {}
  6328. /**
  6329. * Floats label determined based off of the shouldFloat argument.
  6330. * @param {boolean} shouldFloat
  6331. */
  6332. }, {
  6333. key: "floatLabel",
  6334. value: function floatLabel(shouldFloat) {}
  6335. /**
  6336. * Returns width of label in pixels, if the label exists.
  6337. * @return {number}
  6338. */
  6339. }, {
  6340. key: "getLabelWidth",
  6341. value: function getLabelWidth() {}
  6342. /**
  6343. * Returns true if outline element exists, false if it doesn't.
  6344. * @return {boolean}
  6345. */
  6346. }, {
  6347. key: "hasOutline",
  6348. value: function hasOutline() {}
  6349. /**
  6350. * Updates SVG Path and outline element based on the
  6351. * label element width and RTL context, if the outline exists.
  6352. * @param {number} labelWidth
  6353. * @param {boolean=} isRtl
  6354. */
  6355. }, {
  6356. key: "notchOutline",
  6357. value: function notchOutline(labelWidth, isRtl) {}
  6358. /**
  6359. * Closes notch in outline element, if the outline exists.
  6360. */
  6361. }, {
  6362. key: "closeOutline",
  6363. value: function closeOutline() {}
  6364. }]);
  6365. return MDCSelectAdapter;
  6366. }();
  6367. /* unused harmony default export */ var _unused_webpack_default_export = (MDCSelectAdapter);
  6368. /***/ }),
  6369. /* 44 */
  6370. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6371. "use strict";
  6372. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  6373. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; });
  6374. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; });
  6375. /**
  6376. * @license
  6377. * Copyright 2016 Google Inc.
  6378. *
  6379. * Permission is hereby granted, free of charge, to any person obtaining a copy
  6380. * of this software and associated documentation files (the "Software"), to deal
  6381. * in the Software without restriction, including without limitation the rights
  6382. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  6383. * copies of the Software, and to permit persons to whom the Software is
  6384. * furnished to do so, subject to the following conditions:
  6385. *
  6386. * The above copyright notice and this permission notice shall be included in
  6387. * all copies or substantial portions of the Software.
  6388. *
  6389. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  6390. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  6391. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  6392. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  6393. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  6394. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  6395. * THE SOFTWARE.
  6396. */
  6397. /** @enum {string} */
  6398. var cssClasses = {
  6399. DISABLED: 'mdc-select--disabled',
  6400. ROOT: 'mdc-select',
  6401. OUTLINED: 'mdc-select--outlined'
  6402. };
  6403. /** @enum {string} */
  6404. var strings = {
  6405. CHANGE_EVENT: 'MDCSelect:change',
  6406. LINE_RIPPLE_SELECTOR: '.mdc-line-ripple',
  6407. LABEL_SELECTOR: '.mdc-floating-label',
  6408. NATIVE_CONTROL_SELECTOR: '.mdc-select__native-control',
  6409. OUTLINE_SELECTOR: '.mdc-notched-outline'
  6410. };
  6411. /** @enum {number} */
  6412. var numbers = {
  6413. LABEL_SCALE: 0.75
  6414. };
  6415. /***/ }),
  6416. /* 45 */
  6417. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6418. "use strict";
  6419. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  6420. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; });
  6421. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; });
  6422. /**
  6423. * @license
  6424. * Copyright 2017 Google Inc.
  6425. *
  6426. * Permission is hereby granted, free of charge, to any person obtaining a copy
  6427. * of this software and associated documentation files (the "Software"), to deal
  6428. * in the Software without restriction, including without limitation the rights
  6429. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  6430. * copies of the Software, and to permit persons to whom the Software is
  6431. * furnished to do so, subject to the following conditions:
  6432. *
  6433. * The above copyright notice and this permission notice shall be included in
  6434. * all copies or substantial portions of the Software.
  6435. *
  6436. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  6437. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  6438. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  6439. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  6440. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  6441. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  6442. * THE SOFTWARE.
  6443. */
  6444. /** @enum {string} */
  6445. var cssClasses = {
  6446. ACTIVE: 'mdc-slider--active',
  6447. DISABLED: 'mdc-slider--disabled',
  6448. DISCRETE: 'mdc-slider--discrete',
  6449. FOCUS: 'mdc-slider--focus',
  6450. IN_TRANSIT: 'mdc-slider--in-transit',
  6451. IS_DISCRETE: 'mdc-slider--discrete',
  6452. HAS_TRACK_MARKER: 'mdc-slider--display-markers'
  6453. };
  6454. /** @enum {string} */
  6455. var strings = {
  6456. TRACK_SELECTOR: '.mdc-slider__track',
  6457. TRACK_MARKER_CONTAINER_SELECTOR: '.mdc-slider__track-marker-container',
  6458. LAST_TRACK_MARKER_SELECTOR: '.mdc-slider__track-marker:last-child',
  6459. THUMB_CONTAINER_SELECTOR: '.mdc-slider__thumb-container',
  6460. PIN_VALUE_MARKER_SELECTOR: '.mdc-slider__pin-value-marker',
  6461. ARIA_VALUEMIN: 'aria-valuemin',
  6462. ARIA_VALUEMAX: 'aria-valuemax',
  6463. ARIA_VALUENOW: 'aria-valuenow',
  6464. ARIA_DISABLED: 'aria-disabled',
  6465. STEP_DATA_ATTR: 'data-step',
  6466. CHANGE_EVENT: 'MDCSlider:change',
  6467. INPUT_EVENT: 'MDCSlider:input'
  6468. };
  6469. /** @enum {number} */
  6470. var numbers = {
  6471. PAGE_FACTOR: 4
  6472. };
  6473. /***/ }),
  6474. /* 46 */
  6475. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6476. "use strict";
  6477. 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; }; }();
  6478. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6479. /**
  6480. * @license
  6481. * Copyright 2017 Google Inc.
  6482. *
  6483. * Permission is hereby granted, free of charge, to any person obtaining a copy
  6484. * of this software and associated documentation files (the "Software"), to deal
  6485. * in the Software without restriction, including without limitation the rights
  6486. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  6487. * copies of the Software, and to permit persons to whom the Software is
  6488. * furnished to do so, subject to the following conditions:
  6489. *
  6490. * The above copyright notice and this permission notice shall be included in
  6491. * all copies or substantial portions of the Software.
  6492. *
  6493. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  6494. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  6495. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  6496. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  6497. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  6498. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  6499. * THE SOFTWARE.
  6500. */
  6501. /* eslint-disable no-unused-vars */
  6502. /**
  6503. * Adapter for MDC Slider.
  6504. *
  6505. * Defines the shape of the adapter expected by the foundation. Implement this
  6506. * adapter to integrate the Slider into your framework. See
  6507. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  6508. * for more information.
  6509. *
  6510. * @record
  6511. */
  6512. var MDCSliderAdapter = function () {
  6513. function MDCSliderAdapter() {
  6514. _classCallCheck(this, MDCSliderAdapter);
  6515. }
  6516. _createClass(MDCSliderAdapter, [{
  6517. key: "hasClass",
  6518. /**
  6519. * Returns true if className exists for the slider Element
  6520. * @param {string} className
  6521. * @return {boolean}
  6522. */
  6523. value: function hasClass(className) {}
  6524. /**
  6525. * Adds a class to the slider Element
  6526. * @param {string} className
  6527. */
  6528. }, {
  6529. key: "addClass",
  6530. value: function addClass(className) {}
  6531. /**
  6532. * Removes a class from the slider Element
  6533. * @param {string} className
  6534. */
  6535. }, {
  6536. key: "removeClass",
  6537. value: function removeClass(className) {}
  6538. /**
  6539. * Returns a string if attribute name exists on the slider Element,
  6540. * otherwise returns null
  6541. * @param {string} name
  6542. * @return {?string}
  6543. */
  6544. }, {
  6545. key: "getAttribute",
  6546. value: function getAttribute(name) {}
  6547. /**
  6548. * Sets attribute name on slider Element to value
  6549. * @param {string} name
  6550. * @param {string} value
  6551. */
  6552. }, {
  6553. key: "setAttribute",
  6554. value: function setAttribute(name, value) {}
  6555. /**
  6556. * Removes attribute name from slider Element
  6557. * @param {string} name
  6558. */
  6559. }, {
  6560. key: "removeAttribute",
  6561. value: function removeAttribute(name) {}
  6562. /**
  6563. * Returns the bounding client rect for the slider Element
  6564. * @return {?ClientRect}
  6565. */
  6566. }, {
  6567. key: "computeBoundingRect",
  6568. value: function computeBoundingRect() {}
  6569. /**
  6570. * Returns the tab index of the slider Element
  6571. * @return {number}
  6572. */
  6573. }, {
  6574. key: "getTabIndex",
  6575. value: function getTabIndex() {}
  6576. /**
  6577. * Registers an event handler on the root element for a given event.
  6578. * @param {string} type
  6579. * @param {function(!Event): undefined} handler
  6580. */
  6581. }, {
  6582. key: "registerInteractionHandler",
  6583. value: function registerInteractionHandler(type, handler) {}
  6584. /**
  6585. * Deregisters an event handler on the root element for a given event.
  6586. * @param {string} type
  6587. * @param {function(!Event): undefined} handler
  6588. */
  6589. }, {
  6590. key: "deregisterInteractionHandler",
  6591. value: function deregisterInteractionHandler(type, handler) {}
  6592. /**
  6593. * Registers an event handler on the thumb container element for a given event.
  6594. * @param {string} type
  6595. * @param {function(!Event): undefined} handler
  6596. */
  6597. }, {
  6598. key: "registerThumbContainerInteractionHandler",
  6599. value: function registerThumbContainerInteractionHandler(type, handler) {}
  6600. /**
  6601. * Deregisters an event handler on the thumb container element for a given event.
  6602. * @param {string} type
  6603. * @param {function(!Event): undefined} handler
  6604. */
  6605. }, {
  6606. key: "deregisterThumbContainerInteractionHandler",
  6607. value: function deregisterThumbContainerInteractionHandler(type, handler) {}
  6608. /**
  6609. * Registers an event handler on the body for a given event.
  6610. * @param {string} type
  6611. * @param {function(!Event): undefined} handler
  6612. */
  6613. }, {
  6614. key: "registerBodyInteractionHandler",
  6615. value: function registerBodyInteractionHandler(type, handler) {}
  6616. /**
  6617. * Deregisters an event handler on the body for a given event.
  6618. * @param {string} type
  6619. * @param {function(!Event): undefined} handler
  6620. */
  6621. }, {
  6622. key: "deregisterBodyInteractionHandler",
  6623. value: function deregisterBodyInteractionHandler(type, handler) {}
  6624. /**
  6625. * Registers an event handler for the window resize event
  6626. * @param {function(!Event): undefined} handler
  6627. */
  6628. }, {
  6629. key: "registerResizeHandler",
  6630. value: function registerResizeHandler(handler) {}
  6631. /**
  6632. * Deregisters an event handler for the window resize event
  6633. * @param {function(!Event): undefined} handler
  6634. */
  6635. }, {
  6636. key: "deregisterResizeHandler",
  6637. value: function deregisterResizeHandler(handler) {}
  6638. /**
  6639. * Emits a custom event MDCSlider:input from the root
  6640. */
  6641. }, {
  6642. key: "notifyInput",
  6643. value: function notifyInput() {}
  6644. /**
  6645. * Emits a custom event MDCSlider:change from the root
  6646. */
  6647. }, {
  6648. key: "notifyChange",
  6649. value: function notifyChange() {}
  6650. /**
  6651. * Sets a style property of the thumb container element to the passed value
  6652. * @param {string} propertyName
  6653. * @param {string} value
  6654. */
  6655. }, {
  6656. key: "setThumbContainerStyleProperty",
  6657. value: function setThumbContainerStyleProperty(propertyName, value) {}
  6658. /**
  6659. * Sets a style property of the track element to the passed value
  6660. * @param {string} propertyName
  6661. * @param {string} value
  6662. */
  6663. }, {
  6664. key: "setTrackStyleProperty",
  6665. value: function setTrackStyleProperty(propertyName, value) {}
  6666. /**
  6667. * Sets the inner text of the pin marker to the passed value
  6668. * @param {number} value
  6669. */
  6670. }, {
  6671. key: "setMarkerValue",
  6672. value: function setMarkerValue(value) {}
  6673. /**
  6674. * Appends the passed number of track markers to the track mark container element
  6675. * @param {number} numMarkers
  6676. */
  6677. }, {
  6678. key: "appendTrackMarkers",
  6679. value: function appendTrackMarkers(numMarkers) {}
  6680. /**
  6681. * Removes all track markers fromt he track mark container element
  6682. */
  6683. }, {
  6684. key: "removeTrackMarkers",
  6685. value: function removeTrackMarkers() {}
  6686. /**
  6687. * Sets a style property of the last track marker to the passed value
  6688. * @param {string} propertyName
  6689. * @param {string} value
  6690. */
  6691. }, {
  6692. key: "setLastTrackMarkersStyleProperty",
  6693. value: function setLastTrackMarkersStyleProperty(propertyName, value) {}
  6694. /**
  6695. * Returns true if the root element is RTL, otherwise false
  6696. * @return {boolean}
  6697. */
  6698. }, {
  6699. key: "isRTL",
  6700. value: function isRTL() {}
  6701. }]);
  6702. return MDCSliderAdapter;
  6703. }();
  6704. /* unused harmony default export */ var _unused_webpack_default_export = (MDCSliderAdapter);
  6705. /***/ }),
  6706. /* 47 */
  6707. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6708. "use strict";
  6709. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  6710. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTabIndicator", function() { return MDCTabIndicator; });
  6711. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  6712. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(48);
  6713. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(21);
  6714. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__sliding_foundation__ = __webpack_require__(122);
  6715. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__fading_foundation__ = __webpack_require__(123);
  6716. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTabIndicatorFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  6717. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSlidingTabIndicatorFoundation", function() { return __WEBPACK_IMPORTED_MODULE_3__sliding_foundation__["a"]; });
  6718. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCFadingTabIndicatorFoundation", function() { return __WEBPACK_IMPORTED_MODULE_4__fading_foundation__["a"]; });
  6719. 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; };
  6720. 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; }; }();
  6721. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6722. 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; }
  6723. 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; }
  6724. /**
  6725. * @license
  6726. * Copyright 2018 Google Inc.
  6727. *
  6728. * Permission is hereby granted, free of charge, to any person obtaining a copy
  6729. * of this software and associated documentation files (the "Software"), to deal
  6730. * in the Software without restriction, including without limitation the rights
  6731. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  6732. * copies of the Software, and to permit persons to whom the Software is
  6733. * furnished to do so, subject to the following conditions:
  6734. *
  6735. * The above copyright notice and this permission notice shall be included in
  6736. * all copies or substantial portions of the Software.
  6737. *
  6738. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  6739. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  6740. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  6741. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  6742. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  6743. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  6744. * THE SOFTWARE.
  6745. */
  6746. /**
  6747. * @extends {MDCComponent<!MDCTabIndicatorFoundation>}
  6748. * @final
  6749. */
  6750. var MDCTabIndicator = function (_MDCComponent) {
  6751. _inherits(MDCTabIndicator, _MDCComponent);
  6752. _createClass(MDCTabIndicator, null, [{
  6753. key: 'attachTo',
  6754. /**
  6755. * @param {!Element} root
  6756. * @return {!MDCTabIndicator}
  6757. */
  6758. value: function attachTo(root) {
  6759. return new MDCTabIndicator(root);
  6760. }
  6761. /**
  6762. * @param {...?} args
  6763. */
  6764. }]);
  6765. function MDCTabIndicator() {
  6766. var _ref;
  6767. _classCallCheck(this, MDCTabIndicator);
  6768. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  6769. args[_key] = arguments[_key];
  6770. }
  6771. /** @type {?Element} */
  6772. var _this = _possibleConstructorReturn(this, (_ref = MDCTabIndicator.__proto__ || Object.getPrototypeOf(MDCTabIndicator)).call.apply(_ref, [this].concat(args)));
  6773. _this.content_;
  6774. return _this;
  6775. }
  6776. _createClass(MDCTabIndicator, [{
  6777. key: 'initialize',
  6778. value: function initialize() {
  6779. this.content_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.CONTENT_SELECTOR);
  6780. }
  6781. /**
  6782. * @return {!ClientRect}
  6783. */
  6784. }, {
  6785. key: 'computeContentClientRect',
  6786. value: function computeContentClientRect() {
  6787. return this.foundation_.computeContentClientRect();
  6788. }
  6789. /**
  6790. * @return {!MDCTabIndicatorFoundation}
  6791. */
  6792. }, {
  6793. key: 'getDefaultFoundation',
  6794. value: function getDefaultFoundation() {
  6795. var _this2 = this;
  6796. var adapter = /** @type {!MDCTabIndicatorAdapter} */_extends({
  6797. addClass: function addClass(className) {
  6798. return _this2.root_.classList.add(className);
  6799. },
  6800. removeClass: function removeClass(className) {
  6801. return _this2.root_.classList.remove(className);
  6802. },
  6803. computeContentClientRect: function computeContentClientRect() {
  6804. return _this2.content_.getBoundingClientRect();
  6805. },
  6806. setContentStyleProperty: function setContentStyleProperty(prop, value) {
  6807. return _this2.content_.style.setProperty(prop, value);
  6808. }
  6809. });
  6810. if (this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].cssClasses.FADE)) {
  6811. return new __WEBPACK_IMPORTED_MODULE_4__fading_foundation__["a" /* default */](adapter);
  6812. }
  6813. // Default to the sliding indicator
  6814. return new __WEBPACK_IMPORTED_MODULE_3__sliding_foundation__["a" /* default */](adapter);
  6815. }
  6816. /**
  6817. * @param {!ClientRect=} previousIndicatorClientRect
  6818. */
  6819. }, {
  6820. key: 'activate',
  6821. value: function activate(previousIndicatorClientRect) {
  6822. this.foundation_.activate(previousIndicatorClientRect);
  6823. }
  6824. }, {
  6825. key: 'deactivate',
  6826. value: function deactivate() {
  6827. this.foundation_.deactivate();
  6828. }
  6829. }]);
  6830. return MDCTabIndicator;
  6831. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  6832. /***/ }),
  6833. /* 48 */
  6834. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6835. "use strict";
  6836. 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; }; }();
  6837. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6838. /**
  6839. * @license
  6840. * Copyright 2018 Google Inc.
  6841. *
  6842. * Permission is hereby granted, free of charge, to any person obtaining a copy
  6843. * of this software and associated documentation files (the "Software"), to deal
  6844. * in the Software without restriction, including without limitation the rights
  6845. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  6846. * copies of the Software, and to permit persons to whom the Software is
  6847. * furnished to do so, subject to the following conditions:
  6848. *
  6849. * The above copyright notice and this permission notice shall be included in
  6850. * all copies or substantial portions of the Software.
  6851. *
  6852. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  6853. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  6854. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  6855. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  6856. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  6857. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  6858. * THE SOFTWARE.
  6859. */
  6860. /* eslint no-unused-vars: [2, {"args": "none"}] */
  6861. /**
  6862. * Adapter for MDC Tab Indicator.
  6863. *
  6864. * Defines the shape of the adapter expected by the foundation. Implement this
  6865. * adapter to integrate the Tab Indicator into your framework. See
  6866. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  6867. * for more information.
  6868. *
  6869. * @record
  6870. */
  6871. var MDCTabIndicatorAdapter = function () {
  6872. function MDCTabIndicatorAdapter() {
  6873. _classCallCheck(this, MDCTabIndicatorAdapter);
  6874. }
  6875. _createClass(MDCTabIndicatorAdapter, [{
  6876. key: "addClass",
  6877. /**
  6878. * Adds the given className to the root element.
  6879. * @param {string} className The className to add
  6880. */
  6881. value: function addClass(className) {}
  6882. /**
  6883. * Removes the given className from the root element.
  6884. * @param {string} className The className to remove
  6885. */
  6886. }, {
  6887. key: "removeClass",
  6888. value: function removeClass(className) {}
  6889. /**
  6890. * Returns the client rect of the content element.
  6891. * @return {!ClientRect}
  6892. */
  6893. }, {
  6894. key: "computeContentClientRect",
  6895. value: function computeContentClientRect() {}
  6896. /**
  6897. * Sets a style property of the content element to the passed value
  6898. * @param {string} propName The style property name to set
  6899. * @param {string} value The style property value
  6900. */
  6901. }, {
  6902. key: "setContentStyleProperty",
  6903. value: function setContentStyleProperty(propName, value) {}
  6904. }]);
  6905. return MDCTabIndicatorAdapter;
  6906. }();
  6907. /* unused harmony default export */ var _unused_webpack_default_export = (MDCTabIndicatorAdapter);
  6908. /***/ }),
  6909. /* 49 */
  6910. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6911. "use strict";
  6912. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  6913. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTabScroller", function() { return MDCTabScroller; });
  6914. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  6915. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(5);
  6916. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(127);
  6917. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util__ = __webpack_require__(131);
  6918. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTabScrollerFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  6919. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "util", function() { return __WEBPACK_IMPORTED_MODULE_3__util__; });
  6920. 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); } };
  6921. 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; }; }();
  6922. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6923. 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; }
  6924. 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; }
  6925. /**
  6926. * @license
  6927. * Copyright 2018 Google Inc.
  6928. *
  6929. * Permission is hereby granted, free of charge, to any person obtaining a copy
  6930. * of this software and associated documentation files (the "Software"), to deal
  6931. * in the Software without restriction, including without limitation the rights
  6932. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  6933. * copies of the Software, and to permit persons to whom the Software is
  6934. * furnished to do so, subject to the following conditions:
  6935. *
  6936. * The above copyright notice and this permission notice shall be included in
  6937. * all copies or substantial portions of the Software.
  6938. *
  6939. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  6940. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  6941. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  6942. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  6943. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  6944. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  6945. * THE SOFTWARE.
  6946. */
  6947. /**
  6948. * @extends {MDCComponent<!MDCTabScrollerFoundation>}
  6949. * @final
  6950. */
  6951. var MDCTabScroller = function (_MDCComponent) {
  6952. _inherits(MDCTabScroller, _MDCComponent);
  6953. _createClass(MDCTabScroller, null, [{
  6954. key: 'attachTo',
  6955. /**
  6956. * @param {!Element} root
  6957. * @return {!MDCTabScroller}
  6958. */
  6959. value: function attachTo(root) {
  6960. return new MDCTabScroller(root);
  6961. }
  6962. }]);
  6963. function MDCTabScroller() {
  6964. var _ref;
  6965. _classCallCheck(this, MDCTabScroller);
  6966. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  6967. args[_key] = arguments[_key];
  6968. }
  6969. /** @private {?Element} */
  6970. var _this = _possibleConstructorReturn(this, (_ref = MDCTabScroller.__proto__ || Object.getPrototypeOf(MDCTabScroller)).call.apply(_ref, [this].concat(args)));
  6971. _this.content_;
  6972. /** @private {?Element} */
  6973. _this.area_;
  6974. /** @private {?function(?Event): undefined} */
  6975. _this.handleInteraction_;
  6976. /** @private {?function(!Event): undefined} */
  6977. _this.handleTransitionEnd_;
  6978. return _this;
  6979. }
  6980. _createClass(MDCTabScroller, [{
  6981. key: 'initialize',
  6982. value: function initialize() {
  6983. this.area_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.AREA_SELECTOR);
  6984. this.content_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.CONTENT_SELECTOR);
  6985. }
  6986. }, {
  6987. key: 'initialSyncWithDOM',
  6988. value: function initialSyncWithDOM() {
  6989. var _this2 = this;
  6990. this.handleInteraction_ = function () {
  6991. return _this2.foundation_.handleInteraction();
  6992. };
  6993. this.handleTransitionEnd_ = function (evt) {
  6994. return _this2.foundation_.handleTransitionEnd(evt);
  6995. };
  6996. this.area_.addEventListener('wheel', this.handleInteraction_);
  6997. this.area_.addEventListener('touchstart', this.handleInteraction_);
  6998. this.area_.addEventListener('pointerdown', this.handleInteraction_);
  6999. this.area_.addEventListener('mousedown', this.handleInteraction_);
  7000. this.area_.addEventListener('keydown', this.handleInteraction_);
  7001. this.content_.addEventListener('transitionend', this.handleTransitionEnd_);
  7002. }
  7003. }, {
  7004. key: 'destroy',
  7005. value: function destroy() {
  7006. _get(MDCTabScroller.prototype.__proto__ || Object.getPrototypeOf(MDCTabScroller.prototype), 'destroy', this).call(this);
  7007. this.area_.removeEventListener('wheel', this.handleInteraction_);
  7008. this.area_.removeEventListener('touchstart', this.handleInteraction_);
  7009. this.area_.removeEventListener('pointerdown', this.handleInteraction_);
  7010. this.area_.removeEventListener('mousedown', this.handleInteraction_);
  7011. this.area_.removeEventListener('keydown', this.handleInteraction_);
  7012. this.content_.removeEventListener('transitionend', this.handleTransitionEnd_);
  7013. }
  7014. /**
  7015. * @return {!MDCTabScrollerFoundation}
  7016. */
  7017. }, {
  7018. key: 'getDefaultFoundation',
  7019. value: function getDefaultFoundation() {
  7020. var _this3 = this;
  7021. var adapter = /** @type {!MDCTabScrollerAdapter} */{
  7022. eventTargetMatchesSelector: function eventTargetMatchesSelector(evtTarget, selector) {
  7023. var MATCHES = __WEBPACK_IMPORTED_MODULE_3__util__["getMatchesProperty"](HTMLElement.prototype);
  7024. return evtTarget[MATCHES](selector);
  7025. },
  7026. addClass: function addClass(className) {
  7027. return _this3.root_.classList.add(className);
  7028. },
  7029. removeClass: function removeClass(className) {
  7030. return _this3.root_.classList.remove(className);
  7031. },
  7032. addScrollAreaClass: function addScrollAreaClass(className) {
  7033. return _this3.area_.classList.add(className);
  7034. },
  7035. setScrollAreaStyleProperty: function setScrollAreaStyleProperty(prop, value) {
  7036. return _this3.area_.style.setProperty(prop, value);
  7037. },
  7038. setScrollContentStyleProperty: function setScrollContentStyleProperty(prop, value) {
  7039. return _this3.content_.style.setProperty(prop, value);
  7040. },
  7041. getScrollContentStyleValue: function getScrollContentStyleValue(propName) {
  7042. return window.getComputedStyle(_this3.content_).getPropertyValue(propName);
  7043. },
  7044. setScrollAreaScrollLeft: function setScrollAreaScrollLeft(scrollX) {
  7045. return _this3.area_.scrollLeft = scrollX;
  7046. },
  7047. getScrollAreaScrollLeft: function getScrollAreaScrollLeft() {
  7048. return _this3.area_.scrollLeft;
  7049. },
  7050. getScrollContentOffsetWidth: function getScrollContentOffsetWidth() {
  7051. return _this3.content_.offsetWidth;
  7052. },
  7053. getScrollAreaOffsetWidth: function getScrollAreaOffsetWidth() {
  7054. return _this3.area_.offsetWidth;
  7055. },
  7056. computeScrollAreaClientRect: function computeScrollAreaClientRect() {
  7057. return _this3.area_.getBoundingClientRect();
  7058. },
  7059. computeScrollContentClientRect: function computeScrollContentClientRect() {
  7060. return _this3.content_.getBoundingClientRect();
  7061. },
  7062. computeHorizontalScrollbarHeight: function computeHorizontalScrollbarHeight() {
  7063. return __WEBPACK_IMPORTED_MODULE_3__util__["computeHorizontalScrollbarHeight"](document);
  7064. }
  7065. };
  7066. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */](adapter);
  7067. }
  7068. /**
  7069. * Returns the current visual scroll position
  7070. * @return {number}
  7071. */
  7072. }, {
  7073. key: 'getScrollPosition',
  7074. value: function getScrollPosition() {
  7075. return this.foundation_.getScrollPosition();
  7076. }
  7077. /**
  7078. * Returns the width of the scroll content
  7079. * @return {number}
  7080. */
  7081. }, {
  7082. key: 'getScrollContentWidth',
  7083. value: function getScrollContentWidth() {
  7084. return this.content_.offsetWidth;
  7085. }
  7086. /**
  7087. * Increments the scroll value by the given amount
  7088. * @param {number} scrollXIncrement The pixel value by which to increment the scroll value
  7089. */
  7090. }, {
  7091. key: 'incrementScroll',
  7092. value: function incrementScroll(scrollXIncrement) {
  7093. this.foundation_.incrementScroll(scrollXIncrement);
  7094. }
  7095. /**
  7096. * Scrolls to the given pixel position
  7097. * @param {number} scrollX The pixel value to scroll to
  7098. */
  7099. }, {
  7100. key: 'scrollTo',
  7101. value: function scrollTo(scrollX) {
  7102. this.foundation_.scrollTo(scrollX);
  7103. }
  7104. }]);
  7105. return MDCTabScroller;
  7106. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  7107. /***/ }),
  7108. /* 50 */
  7109. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7110. "use strict";
  7111. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  7112. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  7113. /**
  7114. * @license
  7115. * Copyright 2018 Google Inc.
  7116. *
  7117. * Permission is hereby granted, free of charge, to any person obtaining a copy
  7118. * of this software and associated documentation files (the "Software"), to deal
  7119. * in the Software without restriction, including without limitation the rights
  7120. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7121. * copies of the Software, and to permit persons to whom the Software is
  7122. * furnished to do so, subject to the following conditions:
  7123. *
  7124. * The above copyright notice and this permission notice shall be included in
  7125. * all copies or substantial portions of the Software.
  7126. *
  7127. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  7128. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  7129. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  7130. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  7131. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  7132. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  7133. * THE SOFTWARE.
  7134. */
  7135. /** @enum {string} */
  7136. var cssClasses = {
  7137. ANIMATING: 'mdc-tab-scroller--animating',
  7138. SCROLL_TEST: 'mdc-tab-scroller__test',
  7139. SCROLL_AREA_SCROLL: 'mdc-tab-scroller__scroll-area--scroll'
  7140. };
  7141. /** @enum {string} */
  7142. var strings = {
  7143. AREA_SELECTOR: '.mdc-tab-scroller__scroll-area',
  7144. CONTENT_SELECTOR: '.mdc-tab-scroller__scroll-content'
  7145. };
  7146. /***/ }),
  7147. /* 51 */
  7148. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7149. "use strict";
  7150. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_tab_adapter__ = __webpack_require__(10);
  7151. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_tab_index__ = __webpack_require__(20);
  7152. 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; }; }();
  7153. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7154. /**
  7155. * @license
  7156. * Copyright 2018 Google Inc.
  7157. *
  7158. * Permission is hereby granted, free of charge, to any person obtaining a copy
  7159. * of this software and associated documentation files (the "Software"), to deal
  7160. * in the Software without restriction, including without limitation the rights
  7161. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7162. * copies of the Software, and to permit persons to whom the Software is
  7163. * furnished to do so, subject to the following conditions:
  7164. *
  7165. * The above copyright notice and this permission notice shall be included in
  7166. * all copies or substantial portions of the Software.
  7167. *
  7168. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  7169. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  7170. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  7171. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  7172. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  7173. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  7174. * THE SOFTWARE.
  7175. */
  7176. /* eslint no-unused-vars: [2, {"args": "none"}] */
  7177. /* eslint-disable no-unused-vars */
  7178. /* eslint-enable no-unused-vars */
  7179. /**
  7180. * Adapter for MDC Tab Bar.
  7181. *
  7182. * Defines the shape of the adapter expected by the foundation. Implement this
  7183. * adapter to integrate the Tab Bar into your framework. See
  7184. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  7185. * for more information.
  7186. *
  7187. * @record
  7188. */
  7189. var MDCTabBarAdapter = function () {
  7190. function MDCTabBarAdapter() {
  7191. _classCallCheck(this, MDCTabBarAdapter);
  7192. }
  7193. _createClass(MDCTabBarAdapter, [{
  7194. key: 'scrollTo',
  7195. /**
  7196. * Scrolls to the given position
  7197. * @param {number} scrollX The position to scroll to
  7198. */
  7199. value: function scrollTo(scrollX) {}
  7200. /**
  7201. * Increments the current scroll position by the given amount
  7202. * @param {number} scrollXIncrement The amount to increment scroll
  7203. */
  7204. }, {
  7205. key: 'incrementScroll',
  7206. value: function incrementScroll(scrollXIncrement) {}
  7207. /**
  7208. * Returns the current scroll position
  7209. * @return {number}
  7210. */
  7211. }, {
  7212. key: 'getScrollPosition',
  7213. value: function getScrollPosition() {}
  7214. /**
  7215. * Returns the width of the scroll content
  7216. * @return {number}
  7217. */
  7218. }, {
  7219. key: 'getScrollContentWidth',
  7220. value: function getScrollContentWidth() {}
  7221. /**
  7222. * Returns the root element's offsetWidth
  7223. * @return {number}
  7224. */
  7225. }, {
  7226. key: 'getOffsetWidth',
  7227. value: function getOffsetWidth() {}
  7228. /**
  7229. * Returns if the Tab Bar language direction is RTL
  7230. * @return {boolean}
  7231. */
  7232. }, {
  7233. key: 'isRTL',
  7234. value: function isRTL() {}
  7235. /**
  7236. * Sets the tab at the given index to be activated
  7237. * @param {number} index The index of the tab to activate
  7238. */
  7239. }, {
  7240. key: 'setActiveTab',
  7241. value: function setActiveTab(index) {}
  7242. /**
  7243. * Activates the tab at the given index with the given client rect
  7244. * @param {number} index The index of the tab to activate
  7245. * @param {!ClientRect} clientRect The client rect of the previously active Tab Indicator
  7246. */
  7247. }, {
  7248. key: 'activateTabAtIndex',
  7249. value: function activateTabAtIndex(index, clientRect) {}
  7250. /**
  7251. * Deactivates the tab at the given index
  7252. * @param {number} index The index of the tab to deactivate
  7253. */
  7254. }, {
  7255. key: 'deactivateTabAtIndex',
  7256. value: function deactivateTabAtIndex(index) {}
  7257. /**
  7258. * Focuses the tab at the given index
  7259. * @param {number} index The index of the tab to focus
  7260. */
  7261. }, {
  7262. key: 'focusTabAtIndex',
  7263. value: function focusTabAtIndex(index) {}
  7264. /**
  7265. * Returns the client rect of the tab's indicator
  7266. * @param {number} index The index of the tab
  7267. * @return {!ClientRect}
  7268. */
  7269. }, {
  7270. key: 'getTabIndicatorClientRectAtIndex',
  7271. value: function getTabIndicatorClientRectAtIndex(index) {}
  7272. /**
  7273. * Returns the tab dimensions of the tab at the given index
  7274. * @param {number} index The index of the tab
  7275. * @return {!MDCTabDimensions}
  7276. */
  7277. }, {
  7278. key: 'getTabDimensionsAtIndex',
  7279. value: function getTabDimensionsAtIndex(index) {}
  7280. /**
  7281. * Returns the length of the tab list
  7282. * @return {number}
  7283. */
  7284. }, {
  7285. key: 'getTabListLength',
  7286. value: function getTabListLength() {}
  7287. /**
  7288. * Returns the index of the previously active tab
  7289. * @return {number}
  7290. */
  7291. }, {
  7292. key: 'getPreviousActiveTabIndex',
  7293. value: function getPreviousActiveTabIndex() {}
  7294. /**
  7295. * Returns the index of the focused tab
  7296. * @return {number}
  7297. */
  7298. }, {
  7299. key: 'getFocusedTabIndex',
  7300. value: function getFocusedTabIndex() {}
  7301. /**
  7302. * Returns the index of the given tab
  7303. * @param {!MDCTab} tab The tab whose index to determin
  7304. * @return {number}
  7305. */
  7306. }, {
  7307. key: 'getIndexOfTab',
  7308. value: function getIndexOfTab(tab) {}
  7309. /**
  7310. * Emits the MDCTabBar:activated event
  7311. * @param {number} index The index of the activated tab
  7312. */
  7313. }, {
  7314. key: 'notifyTabActivated',
  7315. value: function notifyTabActivated(index) {}
  7316. }]);
  7317. return MDCTabBarAdapter;
  7318. }();
  7319. /* unused harmony default export */ var _unused_webpack_default_export = (MDCTabBarAdapter);
  7320. /***/ }),
  7321. /* 52 */
  7322. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7323. "use strict";
  7324. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return cssClasses; });
  7325. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return strings; });
  7326. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return numbers; });
  7327. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return VALIDATION_ATTR_WHITELIST; });
  7328. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ALWAYS_FLOAT_TYPES; });
  7329. /**
  7330. * @license
  7331. * Copyright 2016 Google Inc.
  7332. *
  7333. * Permission is hereby granted, free of charge, to any person obtaining a copy
  7334. * of this software and associated documentation files (the "Software"), to deal
  7335. * in the Software without restriction, including without limitation the rights
  7336. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7337. * copies of the Software, and to permit persons to whom the Software is
  7338. * furnished to do so, subject to the following conditions:
  7339. *
  7340. * The above copyright notice and this permission notice shall be included in
  7341. * all copies or substantial portions of the Software.
  7342. *
  7343. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  7344. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  7345. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  7346. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  7347. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  7348. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  7349. * THE SOFTWARE.
  7350. */
  7351. /** @enum {string} */
  7352. var strings = {
  7353. ARIA_CONTROLS: 'aria-controls',
  7354. INPUT_SELECTOR: '.mdc-text-field__input',
  7355. LABEL_SELECTOR: '.mdc-floating-label',
  7356. ICON_SELECTOR: '.mdc-text-field__icon',
  7357. OUTLINE_SELECTOR: '.mdc-notched-outline',
  7358. LINE_RIPPLE_SELECTOR: '.mdc-line-ripple'
  7359. };
  7360. /** @enum {string} */
  7361. var cssClasses = {
  7362. ROOT: 'mdc-text-field',
  7363. DISABLED: 'mdc-text-field--disabled',
  7364. DENSE: 'mdc-text-field--dense',
  7365. FOCUSED: 'mdc-text-field--focused',
  7366. INVALID: 'mdc-text-field--invalid',
  7367. TEXTAREA: 'mdc-text-field--textarea',
  7368. OUTLINED: 'mdc-text-field--outlined'
  7369. };
  7370. /** @enum {number} */
  7371. var numbers = {
  7372. LABEL_SCALE: 0.75,
  7373. DENSE_LABEL_SCALE: 0.923
  7374. };
  7375. // whitelist based off of https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation
  7376. // under section: `Validation-related attributes`
  7377. var VALIDATION_ATTR_WHITELIST = ['pattern', 'min', 'max', 'required', 'step', 'minlength', 'maxlength'];
  7378. // Label should always float for these types as they show some UI even if value is empty.
  7379. var ALWAYS_FLOAT_TYPES = ['color', 'date', 'datetime-local', 'month', 'range', 'time', 'week'];
  7380. /***/ }),
  7381. /* 53 */
  7382. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7383. "use strict";
  7384. /* unused harmony export MDCTextFieldAdapter */
  7385. /* unused harmony export NativeInputType */
  7386. /* unused harmony export FoundationMapType */
  7387. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__helper_text_foundation__ = __webpack_require__(22);
  7388. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__icon_foundation__ = __webpack_require__(23);
  7389. 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; }; }();
  7390. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7391. /**
  7392. * @license
  7393. * Copyright 2017 Google Inc.
  7394. *
  7395. * Permission is hereby granted, free of charge, to any person obtaining a copy
  7396. * of this software and associated documentation files (the "Software"), to deal
  7397. * in the Software without restriction, including without limitation the rights
  7398. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7399. * copies of the Software, and to permit persons to whom the Software is
  7400. * furnished to do so, subject to the following conditions:
  7401. *
  7402. * The above copyright notice and this permission notice shall be included in
  7403. * all copies or substantial portions of the Software.
  7404. *
  7405. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  7406. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  7407. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  7408. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  7409. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  7410. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  7411. * THE SOFTWARE.
  7412. */
  7413. /* eslint-disable no-unused-vars */
  7414. /* eslint no-unused-vars: [2, {"args": "none"}] */
  7415. /**
  7416. * @typedef {{
  7417. * value: string,
  7418. * disabled: boolean,
  7419. * badInput: boolean,
  7420. * validity: {
  7421. * badInput: boolean,
  7422. * valid: boolean,
  7423. * },
  7424. * }}
  7425. */
  7426. var NativeInputType = void 0;
  7427. /**
  7428. * @typedef {{
  7429. * helperText: (!MDCTextFieldHelperTextFoundation|undefined),
  7430. * icon: (!MDCTextFieldIconFoundation|undefined),
  7431. * }}
  7432. */
  7433. var FoundationMapType = void 0;
  7434. /**
  7435. * Adapter for MDC Text Field.
  7436. *
  7437. * Defines the shape of the adapter expected by the foundation. Implement this
  7438. * adapter to integrate the Text Field into your framework. See
  7439. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  7440. * for more information.
  7441. *
  7442. * @record
  7443. */
  7444. var MDCTextFieldAdapter = function () {
  7445. function MDCTextFieldAdapter() {
  7446. _classCallCheck(this, MDCTextFieldAdapter);
  7447. }
  7448. _createClass(MDCTextFieldAdapter, [{
  7449. key: 'addClass',
  7450. /**
  7451. * Adds a class to the root Element.
  7452. * @param {string} className
  7453. */
  7454. value: function addClass(className) {}
  7455. /**
  7456. * Removes a class from the root Element.
  7457. * @param {string} className
  7458. */
  7459. }, {
  7460. key: 'removeClass',
  7461. value: function removeClass(className) {}
  7462. /**
  7463. * Returns true if the root element contains the given class name.
  7464. * @param {string} className
  7465. * @return {boolean}
  7466. */
  7467. }, {
  7468. key: 'hasClass',
  7469. value: function hasClass(className) {}
  7470. /**
  7471. * Registers an event handler on the root element for a given event.
  7472. * @param {string} type
  7473. * @param {function(!Event): undefined} handler
  7474. */
  7475. }, {
  7476. key: 'registerTextFieldInteractionHandler',
  7477. value: function registerTextFieldInteractionHandler(type, handler) {}
  7478. /**
  7479. * Deregisters an event handler on the root element for a given event.
  7480. * @param {string} type
  7481. * @param {function(!Event): undefined} handler
  7482. */
  7483. }, {
  7484. key: 'deregisterTextFieldInteractionHandler',
  7485. value: function deregisterTextFieldInteractionHandler(type, handler) {}
  7486. /**
  7487. * Registers an event listener on the native input element for a given event.
  7488. * @param {string} evtType
  7489. * @param {function(!Event): undefined} handler
  7490. */
  7491. }, {
  7492. key: 'registerInputInteractionHandler',
  7493. value: function registerInputInteractionHandler(evtType, handler) {}
  7494. /**
  7495. * Deregisters an event listener on the native input element for a given event.
  7496. * @param {string} evtType
  7497. * @param {function(!Event): undefined} handler
  7498. */
  7499. }, {
  7500. key: 'deregisterInputInteractionHandler',
  7501. value: function deregisterInputInteractionHandler(evtType, handler) {}
  7502. /**
  7503. * Registers a validation attribute change listener on the input element.
  7504. * Handler accepts list of attribute names.
  7505. * @param {function(!Array<string>): undefined} handler
  7506. * @return {!MutationObserver}
  7507. */
  7508. }, {
  7509. key: 'registerValidationAttributeChangeHandler',
  7510. value: function registerValidationAttributeChangeHandler(handler) {}
  7511. /**
  7512. * Disconnects a validation attribute observer on the input element.
  7513. * @param {!MutationObserver} observer
  7514. */
  7515. }, {
  7516. key: 'deregisterValidationAttributeChangeHandler',
  7517. value: function deregisterValidationAttributeChangeHandler(observer) {}
  7518. /**
  7519. * Returns an object representing the native text input element, with a
  7520. * similar API shape. The object returned should include the value, disabled
  7521. * and badInput properties, as well as the checkValidity() function. We never
  7522. * alter the value within our code, however we do update the disabled
  7523. * property, so if you choose to duck-type the return value for this method
  7524. * in your implementation it's important to keep this in mind. Also note that
  7525. * this method can return null, which the foundation will handle gracefully.
  7526. * @return {?Element|?NativeInputType}
  7527. */
  7528. }, {
  7529. key: 'getNativeInput',
  7530. value: function getNativeInput() {}
  7531. /**
  7532. * Returns true if the textfield is focused.
  7533. * We achieve this via `document.activeElement === this.root_`.
  7534. * @return {boolean}
  7535. */
  7536. }, {
  7537. key: 'isFocused',
  7538. value: function isFocused() {}
  7539. /**
  7540. * Returns true if the direction of the root element is set to RTL.
  7541. * @return {boolean}
  7542. */
  7543. }, {
  7544. key: 'isRtl',
  7545. value: function isRtl() {}
  7546. /**
  7547. * Activates the line ripple.
  7548. */
  7549. }, {
  7550. key: 'activateLineRipple',
  7551. value: function activateLineRipple() {}
  7552. /**
  7553. * Deactivates the line ripple.
  7554. */
  7555. }, {
  7556. key: 'deactivateLineRipple',
  7557. value: function deactivateLineRipple() {}
  7558. /**
  7559. * Sets the transform origin of the line ripple.
  7560. * @param {number} normalizedX
  7561. */
  7562. }, {
  7563. key: 'setLineRippleTransformOrigin',
  7564. value: function setLineRippleTransformOrigin(normalizedX) {}
  7565. /**
  7566. * Only implement if label exists.
  7567. * Shakes label if shouldShake is true.
  7568. * @param {boolean} shouldShake
  7569. */
  7570. }, {
  7571. key: 'shakeLabel',
  7572. value: function shakeLabel(shouldShake) {}
  7573. /**
  7574. * Only implement if label exists.
  7575. * Floats the label above the input element if shouldFloat is true.
  7576. * @param {boolean} shouldFloat
  7577. */
  7578. }, {
  7579. key: 'floatLabel',
  7580. value: function floatLabel(shouldFloat) {}
  7581. /**
  7582. * Returns true if label element exists, false if it doesn't.
  7583. * @return {boolean}
  7584. */
  7585. }, {
  7586. key: 'hasLabel',
  7587. value: function hasLabel() {}
  7588. /**
  7589. * Only implement if label exists.
  7590. * Returns width of label in pixels.
  7591. * @return {number}
  7592. */
  7593. }, {
  7594. key: 'getLabelWidth',
  7595. value: function getLabelWidth() {}
  7596. /**
  7597. * Returns true if outline element exists, false if it doesn't.
  7598. * @return {boolean}
  7599. */
  7600. }, {
  7601. key: 'hasOutline',
  7602. value: function hasOutline() {}
  7603. /**
  7604. * Only implement if outline element exists.
  7605. * Updates SVG Path and outline element based on the
  7606. * label element width and RTL context.
  7607. * @param {number} labelWidth
  7608. * @param {boolean=} isRtl
  7609. */
  7610. }, {
  7611. key: 'notchOutline',
  7612. value: function notchOutline(labelWidth, isRtl) {}
  7613. /**
  7614. * Only implement if outline element exists.
  7615. * Closes notch in outline element.
  7616. */
  7617. }, {
  7618. key: 'closeOutline',
  7619. value: function closeOutline() {}
  7620. }]);
  7621. return MDCTextFieldAdapter;
  7622. }();
  7623. /***/ }),
  7624. /* 54 */
  7625. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7626. "use strict";
  7627. 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; }; }();
  7628. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7629. /**
  7630. * @license
  7631. * Copyright 2017 Google Inc.
  7632. *
  7633. * Permission is hereby granted, free of charge, to any person obtaining a copy
  7634. * of this software and associated documentation files (the "Software"), to deal
  7635. * in the Software without restriction, including without limitation the rights
  7636. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7637. * copies of the Software, and to permit persons to whom the Software is
  7638. * furnished to do so, subject to the following conditions:
  7639. *
  7640. * The above copyright notice and this permission notice shall be included in
  7641. * all copies or substantial portions of the Software.
  7642. *
  7643. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  7644. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  7645. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  7646. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  7647. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  7648. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  7649. * THE SOFTWARE.
  7650. */
  7651. /* eslint no-unused-vars: [2, {"args": "none"}] */
  7652. /**
  7653. * Adapter for MDC Text Field Helper Text.
  7654. *
  7655. * Defines the shape of the adapter expected by the foundation. Implement this
  7656. * adapter to integrate the TextField helper text into your framework. See
  7657. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  7658. * for more information.
  7659. *
  7660. * @record
  7661. */
  7662. var MDCTextFieldHelperTextAdapter = function () {
  7663. function MDCTextFieldHelperTextAdapter() {
  7664. _classCallCheck(this, MDCTextFieldHelperTextAdapter);
  7665. }
  7666. _createClass(MDCTextFieldHelperTextAdapter, [{
  7667. key: "addClass",
  7668. /**
  7669. * Adds a class to the helper text element.
  7670. * @param {string} className
  7671. */
  7672. value: function addClass(className) {}
  7673. /**
  7674. * Removes a class from the helper text element.
  7675. * @param {string} className
  7676. */
  7677. }, {
  7678. key: "removeClass",
  7679. value: function removeClass(className) {}
  7680. /**
  7681. * Returns whether or not the helper text element contains the given class.
  7682. * @param {string} className
  7683. * @return {boolean}
  7684. */
  7685. }, {
  7686. key: "hasClass",
  7687. value: function hasClass(className) {}
  7688. /**
  7689. * Sets an attribute with a given value on the helper text element.
  7690. * @param {string} attr
  7691. * @param {string} value
  7692. */
  7693. }, {
  7694. key: "setAttr",
  7695. value: function setAttr(attr, value) {}
  7696. /**
  7697. * Removes an attribute from the helper text element.
  7698. * @param {string} attr
  7699. */
  7700. }, {
  7701. key: "removeAttr",
  7702. value: function removeAttr(attr) {}
  7703. /**
  7704. * Sets the text content for the helper text element.
  7705. * @param {string} content
  7706. */
  7707. }, {
  7708. key: "setContent",
  7709. value: function setContent(content) {}
  7710. }]);
  7711. return MDCTextFieldHelperTextAdapter;
  7712. }();
  7713. /* unused harmony default export */ var _unused_webpack_default_export = (MDCTextFieldHelperTextAdapter);
  7714. /***/ }),
  7715. /* 55 */
  7716. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7717. "use strict";
  7718. 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; }; }();
  7719. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7720. /**
  7721. * @license
  7722. * Copyright 2017 Google Inc.
  7723. *
  7724. * Permission is hereby granted, free of charge, to any person obtaining a copy
  7725. * of this software and associated documentation files (the "Software"), to deal
  7726. * in the Software without restriction, including without limitation the rights
  7727. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7728. * copies of the Software, and to permit persons to whom the Software is
  7729. * furnished to do so, subject to the following conditions:
  7730. *
  7731. * The above copyright notice and this permission notice shall be included in
  7732. * all copies or substantial portions of the Software.
  7733. *
  7734. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  7735. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  7736. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  7737. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  7738. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  7739. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  7740. * THE SOFTWARE.
  7741. */
  7742. /* eslint no-unused-vars: [2, {"args": "none"}] */
  7743. /**
  7744. * Adapter for MDC Text Field Icon.
  7745. *
  7746. * Defines the shape of the adapter expected by the foundation. Implement this
  7747. * adapter to integrate the text field icon into your framework. See
  7748. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  7749. * for more information.
  7750. *
  7751. * @record
  7752. */
  7753. var MDCTextFieldIconAdapter = function () {
  7754. function MDCTextFieldIconAdapter() {
  7755. _classCallCheck(this, MDCTextFieldIconAdapter);
  7756. }
  7757. _createClass(MDCTextFieldIconAdapter, [{
  7758. key: "getAttr",
  7759. /**
  7760. * Gets the value of an attribute on the icon element.
  7761. * @param {string} attr
  7762. * @return {string}
  7763. */
  7764. value: function getAttr(attr) {}
  7765. /**
  7766. * Sets an attribute on the icon element.
  7767. * @param {string} attr
  7768. * @param {string} value
  7769. */
  7770. }, {
  7771. key: "setAttr",
  7772. value: function setAttr(attr, value) {}
  7773. /**
  7774. * Removes an attribute from the icon element.
  7775. * @param {string} attr
  7776. */
  7777. }, {
  7778. key: "removeAttr",
  7779. value: function removeAttr(attr) {}
  7780. /**
  7781. * Sets the text content of the icon element.
  7782. * @param {string} content
  7783. */
  7784. }, {
  7785. key: "setContent",
  7786. value: function setContent(content) {}
  7787. /**
  7788. * Registers an event listener on the icon element for a given event.
  7789. * @param {string} evtType
  7790. * @param {function(!Event): undefined} handler
  7791. */
  7792. }, {
  7793. key: "registerInteractionHandler",
  7794. value: function registerInteractionHandler(evtType, handler) {}
  7795. /**
  7796. * Deregisters an event listener on the icon element for a given event.
  7797. * @param {string} evtType
  7798. * @param {function(!Event): undefined} handler
  7799. */
  7800. }, {
  7801. key: "deregisterInteractionHandler",
  7802. value: function deregisterInteractionHandler(evtType, handler) {}
  7803. /**
  7804. * Emits a custom event "MDCTextField:icon" denoting a user has clicked the icon.
  7805. */
  7806. }, {
  7807. key: "notifyIconAction",
  7808. value: function notifyIconAction() {}
  7809. }]);
  7810. return MDCTextFieldIconAdapter;
  7811. }();
  7812. /* unused harmony default export */ var _unused_webpack_default_export = (MDCTextFieldIconAdapter);
  7813. /***/ }),
  7814. /* 56 */
  7815. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7816. "use strict";
  7817. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  7818. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__ = __webpack_require__(57);
  7819. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_index__ = __webpack_require__(3);
  7820. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_checkbox_index__ = __webpack_require__(58);
  7821. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_chips_index__ = __webpack_require__(64);
  7822. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__material_dialog_index__ = __webpack_require__(68);
  7823. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__material_drawer_index__ = __webpack_require__(74);
  7824. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__material_floating_label_index__ = __webpack_require__(16);
  7825. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__material_form_field_index__ = __webpack_require__(81);
  7826. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__material_grid_list_index__ = __webpack_require__(85);
  7827. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__material_icon_button_index__ = __webpack_require__(88);
  7828. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__material_icon_toggle_index__ = __webpack_require__(92);
  7829. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__material_linear_progress_index__ = __webpack_require__(96);
  7830. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__material_line_ripple_index__ = __webpack_require__(17);
  7831. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__material_list_index__ = __webpack_require__(14);
  7832. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__material_menu_index__ = __webpack_require__(101);
  7833. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__material_menu_surface_index__ = __webpack_require__(40);
  7834. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__material_notched_outline_index__ = __webpack_require__(19);
  7835. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__material_radio_index__ = __webpack_require__(106);
  7836. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__material_ripple_index__ = __webpack_require__(2);
  7837. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__material_select_index__ = __webpack_require__(110);
  7838. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__material_selection_control_index__ = __webpack_require__(4);
  7839. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_21__material_slider_index__ = __webpack_require__(112);
  7840. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_22__material_snackbar_index__ = __webpack_require__(114);
  7841. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_23__material_switch_index__ = __webpack_require__(117);
  7842. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_24__material_tab_index__ = __webpack_require__(20);
  7843. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_25__material_tab_bar_index__ = __webpack_require__(126);
  7844. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_26__material_tab_indicator_index__ = __webpack_require__(47);
  7845. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_27__material_tab_scroller_index__ = __webpack_require__(49);
  7846. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_28__material_textfield_index__ = __webpack_require__(134);
  7847. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_29__material_toolbar_index__ = __webpack_require__(140);
  7848. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_30__material_top_app_bar_index__ = __webpack_require__(143);
  7849. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "autoInit", function() { return __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a"]; });
  7850. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "base", function() { return __WEBPACK_IMPORTED_MODULE_1__material_base_index__; });
  7851. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "checkbox", function() { return __WEBPACK_IMPORTED_MODULE_2__material_checkbox_index__; });
  7852. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "chips", function() { return __WEBPACK_IMPORTED_MODULE_3__material_chips_index__; });
  7853. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "dialog", function() { return __WEBPACK_IMPORTED_MODULE_4__material_dialog_index__; });
  7854. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "drawer", function() { return __WEBPACK_IMPORTED_MODULE_5__material_drawer_index__; });
  7855. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "floatingLabel", function() { return __WEBPACK_IMPORTED_MODULE_6__material_floating_label_index__; });
  7856. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "formField", function() { return __WEBPACK_IMPORTED_MODULE_7__material_form_field_index__; });
  7857. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "gridList", function() { return __WEBPACK_IMPORTED_MODULE_8__material_grid_list_index__; });
  7858. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "iconButton", function() { return __WEBPACK_IMPORTED_MODULE_9__material_icon_button_index__; });
  7859. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "iconToggle", function() { return __WEBPACK_IMPORTED_MODULE_10__material_icon_toggle_index__; });
  7860. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "lineRipple", function() { return __WEBPACK_IMPORTED_MODULE_12__material_line_ripple_index__; });
  7861. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "linearProgress", function() { return __WEBPACK_IMPORTED_MODULE_11__material_linear_progress_index__; });
  7862. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "list", function() { return __WEBPACK_IMPORTED_MODULE_13__material_list_index__; });
  7863. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "menu", function() { return __WEBPACK_IMPORTED_MODULE_14__material_menu_index__; });
  7864. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "menuSurface", function() { return __WEBPACK_IMPORTED_MODULE_15__material_menu_surface_index__; });
  7865. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "notchedOutline", function() { return __WEBPACK_IMPORTED_MODULE_16__material_notched_outline_index__; });
  7866. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "radio", function() { return __WEBPACK_IMPORTED_MODULE_17__material_radio_index__; });
  7867. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "ripple", function() { return __WEBPACK_IMPORTED_MODULE_18__material_ripple_index__; });
  7868. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "select", function() { return __WEBPACK_IMPORTED_MODULE_19__material_select_index__; });
  7869. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "selectionControl", function() { return __WEBPACK_IMPORTED_MODULE_20__material_selection_control_index__; });
  7870. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "slider", function() { return __WEBPACK_IMPORTED_MODULE_21__material_slider_index__; });
  7871. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "switchControl", function() { return __WEBPACK_IMPORTED_MODULE_23__material_switch_index__; });
  7872. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "snackbar", function() { return __WEBPACK_IMPORTED_MODULE_22__material_snackbar_index__; });
  7873. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "tab", function() { return __WEBPACK_IMPORTED_MODULE_24__material_tab_index__; });
  7874. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "tabBar", function() { return __WEBPACK_IMPORTED_MODULE_25__material_tab_bar_index__; });
  7875. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "tabIndicator", function() { return __WEBPACK_IMPORTED_MODULE_26__material_tab_indicator_index__; });
  7876. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "tabScroller", function() { return __WEBPACK_IMPORTED_MODULE_27__material_tab_scroller_index__; });
  7877. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "textField", function() { return __WEBPACK_IMPORTED_MODULE_28__material_textfield_index__; });
  7878. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "toolbar", function() { return __WEBPACK_IMPORTED_MODULE_29__material_toolbar_index__; });
  7879. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "topAppBar", function() { return __WEBPACK_IMPORTED_MODULE_30__material_top_app_bar_index__; });
  7880. /**
  7881. * @license
  7882. * Copyright 2016 Google Inc.
  7883. *
  7884. * Permission is hereby granted, free of charge, to any person obtaining a copy
  7885. * of this software and associated documentation files (the "Software"), to deal
  7886. * in the Software without restriction, including without limitation the rights
  7887. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7888. * copies of the Software, and to permit persons to whom the Software is
  7889. * furnished to do so, subject to the following conditions:
  7890. *
  7891. * The above copyright notice and this permission notice shall be included in
  7892. * all copies or substantial portions of the Software.
  7893. *
  7894. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  7895. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  7896. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  7897. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  7898. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  7899. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  7900. * THE SOFTWARE.
  7901. */
  7902. // Register all components
  7903. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCCheckbox', __WEBPACK_IMPORTED_MODULE_2__material_checkbox_index__["MDCCheckbox"]);
  7904. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCChip', __WEBPACK_IMPORTED_MODULE_3__material_chips_index__["MDCChip"]);
  7905. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCChipSet', __WEBPACK_IMPORTED_MODULE_3__material_chips_index__["MDCChipSet"]);
  7906. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCDialog', __WEBPACK_IMPORTED_MODULE_4__material_dialog_index__["MDCDialog"]);
  7907. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCDrawer', __WEBPACK_IMPORTED_MODULE_5__material_drawer_index__["MDCDrawer"]);
  7908. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCFloatingLabel', __WEBPACK_IMPORTED_MODULE_6__material_floating_label_index__["MDCFloatingLabel"]);
  7909. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCFormField', __WEBPACK_IMPORTED_MODULE_7__material_form_field_index__["MDCFormField"]);
  7910. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCRipple', __WEBPACK_IMPORTED_MODULE_18__material_ripple_index__["MDCRipple"]);
  7911. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCGridList', __WEBPACK_IMPORTED_MODULE_8__material_grid_list_index__["MDCGridList"]);
  7912. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCIconButtonToggle', __WEBPACK_IMPORTED_MODULE_9__material_icon_button_index__["MDCIconButtonToggle"]);
  7913. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCIconToggle', __WEBPACK_IMPORTED_MODULE_10__material_icon_toggle_index__["MDCIconToggle"]);
  7914. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCLineRipple', __WEBPACK_IMPORTED_MODULE_12__material_line_ripple_index__["MDCLineRipple"]);
  7915. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCLinearProgress', __WEBPACK_IMPORTED_MODULE_11__material_linear_progress_index__["MDCLinearProgress"]);
  7916. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCList', __WEBPACK_IMPORTED_MODULE_13__material_list_index__["MDCList"]);
  7917. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCNotchedOutline', __WEBPACK_IMPORTED_MODULE_16__material_notched_outline_index__["MDCNotchedOutline"]);
  7918. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCRadio', __WEBPACK_IMPORTED_MODULE_17__material_radio_index__["MDCRadio"]);
  7919. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCSnackbar', __WEBPACK_IMPORTED_MODULE_22__material_snackbar_index__["MDCSnackbar"]);
  7920. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCTabBar', __WEBPACK_IMPORTED_MODULE_25__material_tab_bar_index__["MDCTabBar"]);
  7921. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCTextField', __WEBPACK_IMPORTED_MODULE_28__material_textfield_index__["MDCTextField"]);
  7922. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCMenu', __WEBPACK_IMPORTED_MODULE_14__material_menu_index__["MDCMenu"]);
  7923. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCMenuSurface', __WEBPACK_IMPORTED_MODULE_15__material_menu_surface_index__["MDCMenuSurface"]);
  7924. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCSelect', __WEBPACK_IMPORTED_MODULE_19__material_select_index__["MDCSelect"]);
  7925. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCSlider', __WEBPACK_IMPORTED_MODULE_21__material_slider_index__["MDCSlider"]);
  7926. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCSwitch', __WEBPACK_IMPORTED_MODULE_23__material_switch_index__["MDCSwitch"]);
  7927. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCToolbar', __WEBPACK_IMPORTED_MODULE_29__material_toolbar_index__["MDCToolbar"]);
  7928. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCTopAppBar', __WEBPACK_IMPORTED_MODULE_30__material_top_app_bar_index__["MDCTopAppBar"]);
  7929. // Export all components.
  7930. /***/ }),
  7931. /* 57 */
  7932. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7933. "use strict";
  7934. /* harmony export (immutable) */ __webpack_exports__["a"] = mdcAutoInit;
  7935. /**
  7936. * @license
  7937. * Copyright 2016 Google Inc.
  7938. *
  7939. * Permission is hereby granted, free of charge, to any person obtaining a copy
  7940. * of this software and associated documentation files (the "Software"), to deal
  7941. * in the Software without restriction, including without limitation the rights
  7942. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7943. * copies of the Software, and to permit persons to whom the Software is
  7944. * furnished to do so, subject to the following conditions:
  7945. *
  7946. * The above copyright notice and this permission notice shall be included in
  7947. * all copies or substantial portions of the Software.
  7948. *
  7949. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  7950. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  7951. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  7952. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  7953. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  7954. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  7955. * THE SOFTWARE.
  7956. */
  7957. var registry = Object.create(null);
  7958. var CONSOLE_WARN = console.warn.bind(console);
  7959. function _emit(evtType, evtData) {
  7960. var shouldBubble = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  7961. var evt = void 0;
  7962. if (typeof CustomEvent === 'function') {
  7963. evt = new CustomEvent(evtType, {
  7964. detail: evtData,
  7965. bubbles: shouldBubble
  7966. });
  7967. } else {
  7968. evt = document.createEvent('CustomEvent');
  7969. evt.initCustomEvent(evtType, shouldBubble, false, evtData);
  7970. }
  7971. document.dispatchEvent(evt);
  7972. }
  7973. /**
  7974. * Auto-initializes all mdc components on a page.
  7975. */
  7976. function mdcAutoInit() {
  7977. var root = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document;
  7978. var warn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : CONSOLE_WARN;
  7979. var components = [];
  7980. var nodes = root.querySelectorAll('[data-mdc-auto-init]');
  7981. for (var i = 0, node; node = nodes[i]; i++) {
  7982. var ctorName = node.dataset.mdcAutoInit;
  7983. if (!ctorName) {
  7984. throw new Error('(mdc-auto-init) Constructor name must be given.');
  7985. }
  7986. var Ctor = registry[ctorName];
  7987. if (typeof Ctor !== 'function') {
  7988. throw new Error('(mdc-auto-init) Could not find constructor in registry for ' + ctorName);
  7989. }
  7990. if (node[ctorName]) {
  7991. warn('(mdc-auto-init) Component already initialized for ' + node + '. Skipping...');
  7992. continue;
  7993. }
  7994. // TODO: Should we make an eslint rule for an attachTo() static method?
  7995. var component = Ctor.attachTo(node);
  7996. Object.defineProperty(node, ctorName, {
  7997. value: component,
  7998. writable: false,
  7999. enumerable: false,
  8000. configurable: true
  8001. });
  8002. components.push(component);
  8003. }
  8004. _emit('MDCAutoInit:End', {});
  8005. return components;
  8006. }
  8007. mdcAutoInit.register = function (componentName, Ctor) {
  8008. var warn = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : CONSOLE_WARN;
  8009. if (typeof Ctor !== 'function') {
  8010. throw new Error('(mdc-auto-init) Invalid Ctor value ' + Ctor + '. Expected function');
  8011. }
  8012. if (registry[componentName]) {
  8013. warn('(mdc-auto-init) Overriding registration for ' + componentName + ' with ' + Ctor + '. ' + ('Was: ' + registry[componentName]));
  8014. }
  8015. registry[componentName] = Ctor;
  8016. };
  8017. mdcAutoInit.deregister = function (componentName) {
  8018. delete registry[componentName];
  8019. };
  8020. mdcAutoInit.deregisterAll = function () {
  8021. Object.keys(registry).forEach(this.deregister, this);
  8022. };
  8023. /***/ }),
  8024. /* 58 */
  8025. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8026. "use strict";
  8027. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  8028. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCCheckbox", function() { return MDCCheckbox; });
  8029. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_animation_index__ = __webpack_require__(9);
  8030. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_component__ = __webpack_require__(1);
  8031. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_selection_control_index__ = __webpack_require__(4);
  8032. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation__ = __webpack_require__(61);
  8033. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__material_ripple_index__ = __webpack_require__(2);
  8034. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__material_ripple_util__ = __webpack_require__(6);
  8035. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCCheckboxFoundation", function() { return __WEBPACK_IMPORTED_MODULE_3__foundation__["a"]; });
  8036. 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; };
  8037. 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); } };
  8038. 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; }; }();
  8039. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8040. 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; }
  8041. 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; }
  8042. /**
  8043. * @license
  8044. * Copyright 2016 Google Inc.
  8045. *
  8046. * Permission is hereby granted, free of charge, to any person obtaining a copy
  8047. * of this software and associated documentation files (the "Software"), to deal
  8048. * in the Software without restriction, including without limitation the rights
  8049. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8050. * copies of the Software, and to permit persons to whom the Software is
  8051. * furnished to do so, subject to the following conditions:
  8052. *
  8053. * The above copyright notice and this permission notice shall be included in
  8054. * all copies or substantial portions of the Software.
  8055. *
  8056. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  8057. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  8058. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  8059. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  8060. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  8061. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  8062. * THE SOFTWARE.
  8063. */
  8064. /* eslint-disable no-unused-vars */
  8065. /* eslint-enable no-unused-vars */
  8066. /**
  8067. * @extends MDCComponent<!MDCCheckboxFoundation>
  8068. * @implements {MDCSelectionControl}
  8069. */
  8070. var MDCCheckbox = function (_MDCComponent) {
  8071. _inherits(MDCCheckbox, _MDCComponent);
  8072. _createClass(MDCCheckbox, [{
  8073. key: 'nativeCb_',
  8074. /**
  8075. * Returns the state of the native control element, or null if the native control element is not present.
  8076. * @return {?MDCSelectionControlState}
  8077. * @private
  8078. */
  8079. get: function get() {
  8080. var NATIVE_CONTROL_SELECTOR = __WEBPACK_IMPORTED_MODULE_3__foundation__["a" /* default */].strings.NATIVE_CONTROL_SELECTOR;
  8081. var cbEl = /** @type {?MDCSelectionControlState} */this.root_.querySelector(NATIVE_CONTROL_SELECTOR);
  8082. return cbEl;
  8083. }
  8084. }], [{
  8085. key: 'attachTo',
  8086. value: function attachTo(root) {
  8087. return new MDCCheckbox(root);
  8088. }
  8089. }]);
  8090. function MDCCheckbox() {
  8091. var _ref;
  8092. _classCallCheck(this, MDCCheckbox);
  8093. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  8094. args[_key] = arguments[_key];
  8095. }
  8096. /** @private {!MDCRipple} */
  8097. var _this = _possibleConstructorReturn(this, (_ref = MDCCheckbox.__proto__ || Object.getPrototypeOf(MDCCheckbox)).call.apply(_ref, [this].concat(args)));
  8098. _this.ripple_ = _this.initRipple_();
  8099. /** @private {!Function} */
  8100. _this.handleChange_;
  8101. /** @private {!Function} */
  8102. _this.handleAnimationEnd_;
  8103. return _this;
  8104. }
  8105. _createClass(MDCCheckbox, [{
  8106. key: 'initialSyncWithDOM',
  8107. value: function initialSyncWithDOM() {
  8108. var _this2 = this;
  8109. this.handleChange_ = function () {
  8110. return _this2.foundation_.handleChange();
  8111. };
  8112. this.handleAnimationEnd_ = function () {
  8113. return _this2.foundation_.handleAnimationEnd();
  8114. };
  8115. this.nativeCb_.addEventListener('change', this.handleChange_);
  8116. this.listen(Object(__WEBPACK_IMPORTED_MODULE_0__material_animation_index__["a" /* getCorrectEventName */])(window, 'animationend'), this.handleAnimationEnd_);
  8117. }
  8118. /**
  8119. * @return {!MDCRipple}
  8120. * @private
  8121. */
  8122. }, {
  8123. key: 'initRipple_',
  8124. value: function initRipple_() {
  8125. var _this3 = this;
  8126. var MATCHES = Object(__WEBPACK_IMPORTED_MODULE_5__material_ripple_util__["getMatchesProperty"])(HTMLElement.prototype);
  8127. var adapter = _extends(__WEBPACK_IMPORTED_MODULE_4__material_ripple_index__["MDCRipple"].createAdapter(this), {
  8128. isUnbounded: function isUnbounded() {
  8129. return true;
  8130. },
  8131. isSurfaceActive: function isSurfaceActive() {
  8132. return _this3.nativeCb_[MATCHES](':active');
  8133. },
  8134. registerInteractionHandler: function registerInteractionHandler(type, handler) {
  8135. return _this3.nativeCb_.addEventListener(type, handler);
  8136. },
  8137. deregisterInteractionHandler: function deregisterInteractionHandler(type, handler) {
  8138. return _this3.nativeCb_.removeEventListener(type, handler);
  8139. }
  8140. });
  8141. var foundation = new __WEBPACK_IMPORTED_MODULE_4__material_ripple_index__["MDCRippleFoundation"](adapter);
  8142. return new __WEBPACK_IMPORTED_MODULE_4__material_ripple_index__["MDCRipple"](this.root_, foundation);
  8143. }
  8144. /** @return {!MDCCheckboxFoundation} */
  8145. }, {
  8146. key: 'getDefaultFoundation',
  8147. value: function getDefaultFoundation() {
  8148. var _this4 = this;
  8149. return new __WEBPACK_IMPORTED_MODULE_3__foundation__["a" /* default */]({
  8150. addClass: function addClass(className) {
  8151. return _this4.root_.classList.add(className);
  8152. },
  8153. removeClass: function removeClass(className) {
  8154. return _this4.root_.classList.remove(className);
  8155. },
  8156. setNativeControlAttr: function setNativeControlAttr(attr, value) {
  8157. return _this4.nativeCb_.setAttribute(attr, value);
  8158. },
  8159. removeNativeControlAttr: function removeNativeControlAttr(attr) {
  8160. return _this4.nativeCb_.removeAttribute(attr);
  8161. },
  8162. getNativeControl: function getNativeControl() {
  8163. return _this4.nativeCb_;
  8164. },
  8165. forceLayout: function forceLayout() {
  8166. return _this4.root_.offsetWidth;
  8167. },
  8168. isAttachedToDOM: function isAttachedToDOM() {
  8169. return Boolean(_this4.root_.parentNode);
  8170. }
  8171. });
  8172. }
  8173. /** @return {!MDCRipple} */
  8174. }, {
  8175. key: 'destroy',
  8176. value: function destroy() {
  8177. this.ripple_.destroy();
  8178. this.nativeCb_.removeEventListener('change', this.handleChange_);
  8179. this.unlisten(Object(__WEBPACK_IMPORTED_MODULE_0__material_animation_index__["a" /* getCorrectEventName */])(window, 'animationend'), this.handleAnimationEnd_);
  8180. _get(MDCCheckbox.prototype.__proto__ || Object.getPrototypeOf(MDCCheckbox.prototype), 'destroy', this).call(this);
  8181. }
  8182. }, {
  8183. key: 'ripple',
  8184. get: function get() {
  8185. return this.ripple_;
  8186. }
  8187. /** @return {boolean} */
  8188. }, {
  8189. key: 'checked',
  8190. get: function get() {
  8191. return this.foundation_.isChecked();
  8192. }
  8193. /** @param {boolean} checked */
  8194. ,
  8195. set: function set(checked) {
  8196. this.foundation_.setChecked(checked);
  8197. }
  8198. /** @return {boolean} */
  8199. }, {
  8200. key: 'indeterminate',
  8201. get: function get() {
  8202. return this.foundation_.isIndeterminate();
  8203. }
  8204. /** @param {boolean} indeterminate */
  8205. ,
  8206. set: function set(indeterminate) {
  8207. this.foundation_.setIndeterminate(indeterminate);
  8208. }
  8209. /** @return {boolean} */
  8210. }, {
  8211. key: 'disabled',
  8212. get: function get() {
  8213. return this.foundation_.isDisabled();
  8214. }
  8215. /** @param {boolean} disabled */
  8216. ,
  8217. set: function set(disabled) {
  8218. this.foundation_.setDisabled(disabled);
  8219. }
  8220. /** @return {?string} */
  8221. }, {
  8222. key: 'value',
  8223. get: function get() {
  8224. return this.foundation_.getValue();
  8225. }
  8226. /** @param {?string} value */
  8227. ,
  8228. set: function set(value) {
  8229. this.foundation_.setValue(value);
  8230. }
  8231. }]);
  8232. return MDCCheckbox;
  8233. }(__WEBPACK_IMPORTED_MODULE_1__material_base_component__["a" /* default */]);
  8234. /***/ }),
  8235. /* 59 */
  8236. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8237. "use strict";
  8238. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  8239. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(24);
  8240. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(60);
  8241. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util__ = __webpack_require__(6);
  8242. 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; };
  8243. 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; }; }();
  8244. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8245. 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; }
  8246. 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; }
  8247. /**
  8248. * @license
  8249. * Copyright 2016 Google Inc.
  8250. *
  8251. * Permission is hereby granted, free of charge, to any person obtaining a copy
  8252. * of this software and associated documentation files (the "Software"), to deal
  8253. * in the Software without restriction, including without limitation the rights
  8254. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8255. * copies of the Software, and to permit persons to whom the Software is
  8256. * furnished to do so, subject to the following conditions:
  8257. *
  8258. * The above copyright notice and this permission notice shall be included in
  8259. * all copies or substantial portions of the Software.
  8260. *
  8261. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  8262. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  8263. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  8264. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  8265. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  8266. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  8267. * THE SOFTWARE.
  8268. */
  8269. /**
  8270. * @typedef {{
  8271. * isActivated: (boolean|undefined),
  8272. * hasDeactivationUXRun: (boolean|undefined),
  8273. * wasActivatedByPointer: (boolean|undefined),
  8274. * wasElementMadeActive: (boolean|undefined),
  8275. * activationEvent: Event,
  8276. * isProgrammatic: (boolean|undefined)
  8277. * }}
  8278. */
  8279. var ActivationStateType = void 0;
  8280. /**
  8281. * @typedef {{
  8282. * activate: (string|undefined),
  8283. * deactivate: (string|undefined),
  8284. * focus: (string|undefined),
  8285. * blur: (string|undefined)
  8286. * }}
  8287. */
  8288. var ListenerInfoType = void 0;
  8289. /**
  8290. * @typedef {{
  8291. * activate: function(!Event),
  8292. * deactivate: function(!Event),
  8293. * focus: function(),
  8294. * blur: function()
  8295. * }}
  8296. */
  8297. var ListenersType = void 0;
  8298. /**
  8299. * @typedef {{
  8300. * x: number,
  8301. * y: number
  8302. * }}
  8303. */
  8304. var PointType = void 0;
  8305. // Activation events registered on the root element of each instance for activation
  8306. var ACTIVATION_EVENT_TYPES = ['touchstart', 'pointerdown', 'mousedown', 'keydown'];
  8307. // Deactivation events registered on documentElement when a pointer-related down event occurs
  8308. var POINTER_DEACTIVATION_EVENT_TYPES = ['touchend', 'pointerup', 'mouseup'];
  8309. // Tracks activations that have occurred on the current frame, to avoid simultaneous nested activations
  8310. /** @type {!Array<!EventTarget>} */
  8311. var activatedTargets = [];
  8312. /**
  8313. * @extends {MDCFoundation<!MDCRippleAdapter>}
  8314. */
  8315. var MDCRippleFoundation = function (_MDCFoundation) {
  8316. _inherits(MDCRippleFoundation, _MDCFoundation);
  8317. _createClass(MDCRippleFoundation, null, [{
  8318. key: 'cssClasses',
  8319. get: function get() {
  8320. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  8321. }
  8322. }, {
  8323. key: 'strings',
  8324. get: function get() {
  8325. return __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */];
  8326. }
  8327. }, {
  8328. key: 'numbers',
  8329. get: function get() {
  8330. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */];
  8331. }
  8332. }, {
  8333. key: 'defaultAdapter',
  8334. get: function get() {
  8335. return {
  8336. browserSupportsCssVars: function browserSupportsCssVars() /* boolean - cached */{},
  8337. isUnbounded: function isUnbounded() /* boolean */{},
  8338. isSurfaceActive: function isSurfaceActive() /* boolean */{},
  8339. isSurfaceDisabled: function isSurfaceDisabled() /* boolean */{},
  8340. addClass: function addClass() /* className: string */{},
  8341. removeClass: function removeClass() /* className: string */{},
  8342. containsEventTarget: function containsEventTarget() /* target: !EventTarget */{},
  8343. registerInteractionHandler: function registerInteractionHandler() /* evtType: string, handler: EventListener */{},
  8344. deregisterInteractionHandler: function deregisterInteractionHandler() /* evtType: string, handler: EventListener */{},
  8345. registerDocumentInteractionHandler: function registerDocumentInteractionHandler() /* evtType: string, handler: EventListener */{},
  8346. deregisterDocumentInteractionHandler: function deregisterDocumentInteractionHandler() /* evtType: string, handler: EventListener */{},
  8347. registerResizeHandler: function registerResizeHandler() /* handler: EventListener */{},
  8348. deregisterResizeHandler: function deregisterResizeHandler() /* handler: EventListener */{},
  8349. updateCssVariable: function updateCssVariable() /* varName: string, value: string */{},
  8350. computeBoundingRect: function computeBoundingRect() /* ClientRect */{},
  8351. getWindowPageOffset: function getWindowPageOffset() /* {x: number, y: number} */{}
  8352. };
  8353. }
  8354. }]);
  8355. function MDCRippleFoundation(adapter) {
  8356. _classCallCheck(this, MDCRippleFoundation);
  8357. /** @private {number} */
  8358. var _this = _possibleConstructorReturn(this, (MDCRippleFoundation.__proto__ || Object.getPrototypeOf(MDCRippleFoundation)).call(this, _extends(MDCRippleFoundation.defaultAdapter, adapter)));
  8359. _this.layoutFrame_ = 0;
  8360. /** @private {!ClientRect} */
  8361. _this.frame_ = /** @type {!ClientRect} */{ width: 0, height: 0 };
  8362. /** @private {!ActivationStateType} */
  8363. _this.activationState_ = _this.defaultActivationState_();
  8364. /** @private {number} */
  8365. _this.initialSize_ = 0;
  8366. /** @private {number} */
  8367. _this.maxRadius_ = 0;
  8368. /** @private {function(!Event)} */
  8369. _this.activateHandler_ = function (e) {
  8370. return _this.activate_(e);
  8371. };
  8372. /** @private {function(!Event)} */
  8373. _this.deactivateHandler_ = function (e) {
  8374. return _this.deactivate_(e);
  8375. };
  8376. /** @private {function(?Event=)} */
  8377. _this.focusHandler_ = function () {
  8378. return _this.handleFocus();
  8379. };
  8380. /** @private {function(?Event=)} */
  8381. _this.blurHandler_ = function () {
  8382. return _this.handleBlur();
  8383. };
  8384. /** @private {!Function} */
  8385. _this.resizeHandler_ = function () {
  8386. return _this.layout();
  8387. };
  8388. /** @private {{left: number, top:number}} */
  8389. _this.unboundedCoords_ = {
  8390. left: 0,
  8391. top: 0
  8392. };
  8393. /** @private {number} */
  8394. _this.fgScale_ = 0;
  8395. /** @private {number} */
  8396. _this.activationTimer_ = 0;
  8397. /** @private {number} */
  8398. _this.fgDeactivationRemovalTimer_ = 0;
  8399. /** @private {boolean} */
  8400. _this.activationAnimationHasEnded_ = false;
  8401. /** @private {!Function} */
  8402. _this.activationTimerCallback_ = function () {
  8403. _this.activationAnimationHasEnded_ = true;
  8404. _this.runDeactivationUXLogicIfReady_();
  8405. };
  8406. /** @private {?Event} */
  8407. _this.previousActivationEvent_ = null;
  8408. return _this;
  8409. }
  8410. /**
  8411. * We compute this property so that we are not querying information about the client
  8412. * until the point in time where the foundation requests it. This prevents scenarios where
  8413. * client-side feature-detection may happen too early, such as when components are rendered on the server
  8414. * and then initialized at mount time on the client.
  8415. * @return {boolean}
  8416. * @private
  8417. */
  8418. _createClass(MDCRippleFoundation, [{
  8419. key: 'supportsPressRipple_',
  8420. value: function supportsPressRipple_() {
  8421. return this.adapter_.browserSupportsCssVars();
  8422. }
  8423. /**
  8424. * @return {!ActivationStateType}
  8425. */
  8426. }, {
  8427. key: 'defaultActivationState_',
  8428. value: function defaultActivationState_() {
  8429. return {
  8430. isActivated: false,
  8431. hasDeactivationUXRun: false,
  8432. wasActivatedByPointer: false,
  8433. wasElementMadeActive: false,
  8434. activationEvent: null,
  8435. isProgrammatic: false
  8436. };
  8437. }
  8438. /** @override */
  8439. }, {
  8440. key: 'init',
  8441. value: function init() {
  8442. var _this2 = this;
  8443. var supportsPressRipple = this.supportsPressRipple_();
  8444. this.registerRootHandlers_(supportsPressRipple);
  8445. if (supportsPressRipple) {
  8446. var _MDCRippleFoundation$ = MDCRippleFoundation.cssClasses,
  8447. ROOT = _MDCRippleFoundation$.ROOT,
  8448. UNBOUNDED = _MDCRippleFoundation$.UNBOUNDED;
  8449. requestAnimationFrame(function () {
  8450. _this2.adapter_.addClass(ROOT);
  8451. if (_this2.adapter_.isUnbounded()) {
  8452. _this2.adapter_.addClass(UNBOUNDED);
  8453. // Unbounded ripples need layout logic applied immediately to set coordinates for both shade and ripple
  8454. _this2.layoutInternal_();
  8455. }
  8456. });
  8457. }
  8458. }
  8459. /** @override */
  8460. }, {
  8461. key: 'destroy',
  8462. value: function destroy() {
  8463. var _this3 = this;
  8464. if (this.supportsPressRipple_()) {
  8465. if (this.activationTimer_) {
  8466. clearTimeout(this.activationTimer_);
  8467. this.activationTimer_ = 0;
  8468. this.adapter_.removeClass(MDCRippleFoundation.cssClasses.FG_ACTIVATION);
  8469. }
  8470. if (this.fgDeactivationRemovalTimer_) {
  8471. clearTimeout(this.fgDeactivationRemovalTimer_);
  8472. this.fgDeactivationRemovalTimer_ = 0;
  8473. this.adapter_.removeClass(MDCRippleFoundation.cssClasses.FG_DEACTIVATION);
  8474. }
  8475. var _MDCRippleFoundation$2 = MDCRippleFoundation.cssClasses,
  8476. ROOT = _MDCRippleFoundation$2.ROOT,
  8477. UNBOUNDED = _MDCRippleFoundation$2.UNBOUNDED;
  8478. requestAnimationFrame(function () {
  8479. _this3.adapter_.removeClass(ROOT);
  8480. _this3.adapter_.removeClass(UNBOUNDED);
  8481. _this3.removeCssVars_();
  8482. });
  8483. }
  8484. this.deregisterRootHandlers_();
  8485. this.deregisterDeactivationHandlers_();
  8486. }
  8487. /**
  8488. * @param {boolean} supportsPressRipple Passed from init to save a redundant function call
  8489. * @private
  8490. */
  8491. }, {
  8492. key: 'registerRootHandlers_',
  8493. value: function registerRootHandlers_(supportsPressRipple) {
  8494. var _this4 = this;
  8495. if (supportsPressRipple) {
  8496. ACTIVATION_EVENT_TYPES.forEach(function (type) {
  8497. _this4.adapter_.registerInteractionHandler(type, _this4.activateHandler_);
  8498. });
  8499. if (this.adapter_.isUnbounded()) {
  8500. this.adapter_.registerResizeHandler(this.resizeHandler_);
  8501. }
  8502. }
  8503. this.adapter_.registerInteractionHandler('focus', this.focusHandler_);
  8504. this.adapter_.registerInteractionHandler('blur', this.blurHandler_);
  8505. }
  8506. /**
  8507. * @param {!Event} e
  8508. * @private
  8509. */
  8510. }, {
  8511. key: 'registerDeactivationHandlers_',
  8512. value: function registerDeactivationHandlers_(e) {
  8513. var _this5 = this;
  8514. if (e.type === 'keydown') {
  8515. this.adapter_.registerInteractionHandler('keyup', this.deactivateHandler_);
  8516. } else {
  8517. POINTER_DEACTIVATION_EVENT_TYPES.forEach(function (type) {
  8518. _this5.adapter_.registerDocumentInteractionHandler(type, _this5.deactivateHandler_);
  8519. });
  8520. }
  8521. }
  8522. /** @private */
  8523. }, {
  8524. key: 'deregisterRootHandlers_',
  8525. value: function deregisterRootHandlers_() {
  8526. var _this6 = this;
  8527. ACTIVATION_EVENT_TYPES.forEach(function (type) {
  8528. _this6.adapter_.deregisterInteractionHandler(type, _this6.activateHandler_);
  8529. });
  8530. this.adapter_.deregisterInteractionHandler('focus', this.focusHandler_);
  8531. this.adapter_.deregisterInteractionHandler('blur', this.blurHandler_);
  8532. if (this.adapter_.isUnbounded()) {
  8533. this.adapter_.deregisterResizeHandler(this.resizeHandler_);
  8534. }
  8535. }
  8536. /** @private */
  8537. }, {
  8538. key: 'deregisterDeactivationHandlers_',
  8539. value: function deregisterDeactivationHandlers_() {
  8540. var _this7 = this;
  8541. this.adapter_.deregisterInteractionHandler('keyup', this.deactivateHandler_);
  8542. POINTER_DEACTIVATION_EVENT_TYPES.forEach(function (type) {
  8543. _this7.adapter_.deregisterDocumentInteractionHandler(type, _this7.deactivateHandler_);
  8544. });
  8545. }
  8546. /** @private */
  8547. }, {
  8548. key: 'removeCssVars_',
  8549. value: function removeCssVars_() {
  8550. var _this8 = this;
  8551. var strings = MDCRippleFoundation.strings;
  8552. Object.keys(strings).forEach(function (k) {
  8553. if (k.indexOf('VAR_') === 0) {
  8554. _this8.adapter_.updateCssVariable(strings[k], null);
  8555. }
  8556. });
  8557. }
  8558. /**
  8559. * @param {?Event} e
  8560. * @private
  8561. */
  8562. }, {
  8563. key: 'activate_',
  8564. value: function activate_(e) {
  8565. var _this9 = this;
  8566. if (this.adapter_.isSurfaceDisabled()) {
  8567. return;
  8568. }
  8569. var activationState = this.activationState_;
  8570. if (activationState.isActivated) {
  8571. return;
  8572. }
  8573. // Avoid reacting to follow-on events fired by touch device after an already-processed user interaction
  8574. var previousActivationEvent = this.previousActivationEvent_;
  8575. var isSameInteraction = previousActivationEvent && e && previousActivationEvent.type !== e.type;
  8576. if (isSameInteraction) {
  8577. return;
  8578. }
  8579. activationState.isActivated = true;
  8580. activationState.isProgrammatic = e === null;
  8581. activationState.activationEvent = e;
  8582. activationState.wasActivatedByPointer = activationState.isProgrammatic ? false : e.type === 'mousedown' || e.type === 'touchstart' || e.type === 'pointerdown';
  8583. var hasActivatedChild = e && activatedTargets.length > 0 && activatedTargets.some(function (target) {
  8584. return _this9.adapter_.containsEventTarget(target);
  8585. });
  8586. if (hasActivatedChild) {
  8587. // Immediately reset activation state, while preserving logic that prevents touch follow-on events
  8588. this.resetActivationState_();
  8589. return;
  8590. }
  8591. if (e) {
  8592. activatedTargets.push( /** @type {!EventTarget} */e.target);
  8593. this.registerDeactivationHandlers_(e);
  8594. }
  8595. activationState.wasElementMadeActive = this.checkElementMadeActive_(e);
  8596. if (activationState.wasElementMadeActive) {
  8597. this.animateActivation_();
  8598. }
  8599. requestAnimationFrame(function () {
  8600. // Reset array on next frame after the current event has had a chance to bubble to prevent ancestor ripples
  8601. activatedTargets = [];
  8602. if (!activationState.wasElementMadeActive && (e.key === ' ' || e.keyCode === 32)) {
  8603. // If space was pressed, try again within an rAF call to detect :active, because different UAs report
  8604. // active states inconsistently when they're called within event handling code:
  8605. // - https://bugs.chromium.org/p/chromium/issues/detail?id=635971
  8606. // - https://bugzilla.mozilla.org/show_bug.cgi?id=1293741
  8607. // We try first outside rAF to support Edge, which does not exhibit this problem, but will crash if a CSS
  8608. // variable is set within a rAF callback for a submit button interaction (#2241).
  8609. activationState.wasElementMadeActive = _this9.checkElementMadeActive_(e);
  8610. if (activationState.wasElementMadeActive) {
  8611. _this9.animateActivation_();
  8612. }
  8613. }
  8614. if (!activationState.wasElementMadeActive) {
  8615. // Reset activation state immediately if element was not made active.
  8616. _this9.activationState_ = _this9.defaultActivationState_();
  8617. }
  8618. });
  8619. }
  8620. /**
  8621. * @param {?Event} e
  8622. * @private
  8623. */
  8624. }, {
  8625. key: 'checkElementMadeActive_',
  8626. value: function checkElementMadeActive_(e) {
  8627. return e && e.type === 'keydown' ? this.adapter_.isSurfaceActive() : true;
  8628. }
  8629. /**
  8630. * @param {?Event=} event Optional event containing position information.
  8631. */
  8632. }, {
  8633. key: 'activate',
  8634. value: function activate() {
  8635. var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  8636. this.activate_(event);
  8637. }
  8638. /** @private */
  8639. }, {
  8640. key: 'animateActivation_',
  8641. value: function animateActivation_() {
  8642. var _this10 = this;
  8643. var _MDCRippleFoundation$3 = MDCRippleFoundation.strings,
  8644. VAR_FG_TRANSLATE_START = _MDCRippleFoundation$3.VAR_FG_TRANSLATE_START,
  8645. VAR_FG_TRANSLATE_END = _MDCRippleFoundation$3.VAR_FG_TRANSLATE_END;
  8646. var _MDCRippleFoundation$4 = MDCRippleFoundation.cssClasses,
  8647. FG_DEACTIVATION = _MDCRippleFoundation$4.FG_DEACTIVATION,
  8648. FG_ACTIVATION = _MDCRippleFoundation$4.FG_ACTIVATION;
  8649. var DEACTIVATION_TIMEOUT_MS = MDCRippleFoundation.numbers.DEACTIVATION_TIMEOUT_MS;
  8650. this.layoutInternal_();
  8651. var translateStart = '';
  8652. var translateEnd = '';
  8653. if (!this.adapter_.isUnbounded()) {
  8654. var _getFgTranslationCoor = this.getFgTranslationCoordinates_(),
  8655. startPoint = _getFgTranslationCoor.startPoint,
  8656. endPoint = _getFgTranslationCoor.endPoint;
  8657. translateStart = startPoint.x + 'px, ' + startPoint.y + 'px';
  8658. translateEnd = endPoint.x + 'px, ' + endPoint.y + 'px';
  8659. }
  8660. this.adapter_.updateCssVariable(VAR_FG_TRANSLATE_START, translateStart);
  8661. this.adapter_.updateCssVariable(VAR_FG_TRANSLATE_END, translateEnd);
  8662. // Cancel any ongoing activation/deactivation animations
  8663. clearTimeout(this.activationTimer_);
  8664. clearTimeout(this.fgDeactivationRemovalTimer_);
  8665. this.rmBoundedActivationClasses_();
  8666. this.adapter_.removeClass(FG_DEACTIVATION);
  8667. // Force layout in order to re-trigger the animation.
  8668. this.adapter_.computeBoundingRect();
  8669. this.adapter_.addClass(FG_ACTIVATION);
  8670. this.activationTimer_ = setTimeout(function () {
  8671. return _this10.activationTimerCallback_();
  8672. }, DEACTIVATION_TIMEOUT_MS);
  8673. }
  8674. /**
  8675. * @private
  8676. * @return {{startPoint: PointType, endPoint: PointType}}
  8677. */
  8678. }, {
  8679. key: 'getFgTranslationCoordinates_',
  8680. value: function getFgTranslationCoordinates_() {
  8681. var _activationState_ = this.activationState_,
  8682. activationEvent = _activationState_.activationEvent,
  8683. wasActivatedByPointer = _activationState_.wasActivatedByPointer;
  8684. var startPoint = void 0;
  8685. if (wasActivatedByPointer) {
  8686. startPoint = Object(__WEBPACK_IMPORTED_MODULE_3__util__["getNormalizedEventCoords"])(
  8687. /** @type {!Event} */activationEvent, this.adapter_.getWindowPageOffset(), this.adapter_.computeBoundingRect());
  8688. } else {
  8689. startPoint = {
  8690. x: this.frame_.width / 2,
  8691. y: this.frame_.height / 2
  8692. };
  8693. }
  8694. // Center the element around the start point.
  8695. startPoint = {
  8696. x: startPoint.x - this.initialSize_ / 2,
  8697. y: startPoint.y - this.initialSize_ / 2
  8698. };
  8699. var endPoint = {
  8700. x: this.frame_.width / 2 - this.initialSize_ / 2,
  8701. y: this.frame_.height / 2 - this.initialSize_ / 2
  8702. };
  8703. return { startPoint: startPoint, endPoint: endPoint };
  8704. }
  8705. /** @private */
  8706. }, {
  8707. key: 'runDeactivationUXLogicIfReady_',
  8708. value: function runDeactivationUXLogicIfReady_() {
  8709. var _this11 = this;
  8710. // This method is called both when a pointing device is released, and when the activation animation ends.
  8711. // The deactivation animation should only run after both of those occur.
  8712. var FG_DEACTIVATION = MDCRippleFoundation.cssClasses.FG_DEACTIVATION;
  8713. var _activationState_2 = this.activationState_,
  8714. hasDeactivationUXRun = _activationState_2.hasDeactivationUXRun,
  8715. isActivated = _activationState_2.isActivated;
  8716. var activationHasEnded = hasDeactivationUXRun || !isActivated;
  8717. if (activationHasEnded && this.activationAnimationHasEnded_) {
  8718. this.rmBoundedActivationClasses_();
  8719. this.adapter_.addClass(FG_DEACTIVATION);
  8720. this.fgDeactivationRemovalTimer_ = setTimeout(function () {
  8721. _this11.adapter_.removeClass(FG_DEACTIVATION);
  8722. }, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].FG_DEACTIVATION_MS);
  8723. }
  8724. }
  8725. /** @private */
  8726. }, {
  8727. key: 'rmBoundedActivationClasses_',
  8728. value: function rmBoundedActivationClasses_() {
  8729. var FG_ACTIVATION = MDCRippleFoundation.cssClasses.FG_ACTIVATION;
  8730. this.adapter_.removeClass(FG_ACTIVATION);
  8731. this.activationAnimationHasEnded_ = false;
  8732. this.adapter_.computeBoundingRect();
  8733. }
  8734. }, {
  8735. key: 'resetActivationState_',
  8736. value: function resetActivationState_() {
  8737. var _this12 = this;
  8738. this.previousActivationEvent_ = this.activationState_.activationEvent;
  8739. this.activationState_ = this.defaultActivationState_();
  8740. // Touch devices may fire additional events for the same interaction within a short time.
  8741. // Store the previous event until it's safe to assume that subsequent events are for new interactions.
  8742. setTimeout(function () {
  8743. return _this12.previousActivationEvent_ = null;
  8744. }, MDCRippleFoundation.numbers.TAP_DELAY_MS);
  8745. }
  8746. /**
  8747. * @param {?Event} e
  8748. * @private
  8749. */
  8750. }, {
  8751. key: 'deactivate_',
  8752. value: function deactivate_(e) {
  8753. var _this13 = this;
  8754. var activationState = this.activationState_;
  8755. // This can happen in scenarios such as when you have a keyup event that blurs the element.
  8756. if (!activationState.isActivated) {
  8757. return;
  8758. }
  8759. var state = /** @type {!ActivationStateType} */_extends({}, activationState);
  8760. if (activationState.isProgrammatic) {
  8761. var evtObject = null;
  8762. requestAnimationFrame(function () {
  8763. return _this13.animateDeactivation_(evtObject, state);
  8764. });
  8765. this.resetActivationState_();
  8766. } else {
  8767. this.deregisterDeactivationHandlers_();
  8768. requestAnimationFrame(function () {
  8769. _this13.activationState_.hasDeactivationUXRun = true;
  8770. _this13.animateDeactivation_(e, state);
  8771. _this13.resetActivationState_();
  8772. });
  8773. }
  8774. }
  8775. /**
  8776. * @param {?Event=} event Optional event containing position information.
  8777. */
  8778. }, {
  8779. key: 'deactivate',
  8780. value: function deactivate() {
  8781. var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  8782. this.deactivate_(event);
  8783. }
  8784. /**
  8785. * @param {Event} e
  8786. * @param {!ActivationStateType} options
  8787. * @private
  8788. */
  8789. }, {
  8790. key: 'animateDeactivation_',
  8791. value: function animateDeactivation_(e, _ref) {
  8792. var wasActivatedByPointer = _ref.wasActivatedByPointer,
  8793. wasElementMadeActive = _ref.wasElementMadeActive;
  8794. if (wasActivatedByPointer || wasElementMadeActive) {
  8795. this.runDeactivationUXLogicIfReady_();
  8796. }
  8797. }
  8798. }, {
  8799. key: 'layout',
  8800. value: function layout() {
  8801. var _this14 = this;
  8802. if (this.layoutFrame_) {
  8803. cancelAnimationFrame(this.layoutFrame_);
  8804. }
  8805. this.layoutFrame_ = requestAnimationFrame(function () {
  8806. _this14.layoutInternal_();
  8807. _this14.layoutFrame_ = 0;
  8808. });
  8809. }
  8810. /** @private */
  8811. }, {
  8812. key: 'layoutInternal_',
  8813. value: function layoutInternal_() {
  8814. var _this15 = this;
  8815. this.frame_ = this.adapter_.computeBoundingRect();
  8816. var maxDim = Math.max(this.frame_.height, this.frame_.width);
  8817. // Surface diameter is treated differently for unbounded vs. bounded ripples.
  8818. // Unbounded ripple diameter is calculated smaller since the surface is expected to already be padded appropriately
  8819. // to extend the hitbox, and the ripple is expected to meet the edges of the padded hitbox (which is typically
  8820. // square). Bounded ripples, on the other hand, are fully expected to expand beyond the surface's longest diameter
  8821. // (calculated based on the diagonal plus a constant padding), and are clipped at the surface's border via
  8822. // `overflow: hidden`.
  8823. var getBoundedRadius = function getBoundedRadius() {
  8824. var hypotenuse = Math.sqrt(Math.pow(_this15.frame_.width, 2) + Math.pow(_this15.frame_.height, 2));
  8825. return hypotenuse + MDCRippleFoundation.numbers.PADDING;
  8826. };
  8827. this.maxRadius_ = this.adapter_.isUnbounded() ? maxDim : getBoundedRadius();
  8828. // Ripple is sized as a fraction of the largest dimension of the surface, then scales up using a CSS scale transform
  8829. this.initialSize_ = maxDim * MDCRippleFoundation.numbers.INITIAL_ORIGIN_SCALE;
  8830. this.fgScale_ = this.maxRadius_ / this.initialSize_;
  8831. this.updateLayoutCssVars_();
  8832. }
  8833. /** @private */
  8834. }, {
  8835. key: 'updateLayoutCssVars_',
  8836. value: function updateLayoutCssVars_() {
  8837. var _MDCRippleFoundation$5 = MDCRippleFoundation.strings,
  8838. VAR_FG_SIZE = _MDCRippleFoundation$5.VAR_FG_SIZE,
  8839. VAR_LEFT = _MDCRippleFoundation$5.VAR_LEFT,
  8840. VAR_TOP = _MDCRippleFoundation$5.VAR_TOP,
  8841. VAR_FG_SCALE = _MDCRippleFoundation$5.VAR_FG_SCALE;
  8842. this.adapter_.updateCssVariable(VAR_FG_SIZE, this.initialSize_ + 'px');
  8843. this.adapter_.updateCssVariable(VAR_FG_SCALE, this.fgScale_);
  8844. if (this.adapter_.isUnbounded()) {
  8845. this.unboundedCoords_ = {
  8846. left: Math.round(this.frame_.width / 2 - this.initialSize_ / 2),
  8847. top: Math.round(this.frame_.height / 2 - this.initialSize_ / 2)
  8848. };
  8849. this.adapter_.updateCssVariable(VAR_LEFT, this.unboundedCoords_.left + 'px');
  8850. this.adapter_.updateCssVariable(VAR_TOP, this.unboundedCoords_.top + 'px');
  8851. }
  8852. }
  8853. /** @param {boolean} unbounded */
  8854. }, {
  8855. key: 'setUnbounded',
  8856. value: function setUnbounded(unbounded) {
  8857. var UNBOUNDED = MDCRippleFoundation.cssClasses.UNBOUNDED;
  8858. if (unbounded) {
  8859. this.adapter_.addClass(UNBOUNDED);
  8860. } else {
  8861. this.adapter_.removeClass(UNBOUNDED);
  8862. }
  8863. }
  8864. }, {
  8865. key: 'handleFocus',
  8866. value: function handleFocus() {
  8867. var _this16 = this;
  8868. requestAnimationFrame(function () {
  8869. return _this16.adapter_.addClass(MDCRippleFoundation.cssClasses.BG_FOCUSED);
  8870. });
  8871. }
  8872. }, {
  8873. key: 'handleBlur',
  8874. value: function handleBlur() {
  8875. var _this17 = this;
  8876. requestAnimationFrame(function () {
  8877. return _this17.adapter_.removeClass(MDCRippleFoundation.cssClasses.BG_FOCUSED);
  8878. });
  8879. }
  8880. }]);
  8881. return MDCRippleFoundation;
  8882. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  8883. /* harmony default export */ __webpack_exports__["a"] = (MDCRippleFoundation);
  8884. /***/ }),
  8885. /* 60 */
  8886. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8887. "use strict";
  8888. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  8889. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; });
  8890. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; });
  8891. /**
  8892. * @license
  8893. * Copyright 2016 Google Inc.
  8894. *
  8895. * Permission is hereby granted, free of charge, to any person obtaining a copy
  8896. * of this software and associated documentation files (the "Software"), to deal
  8897. * in the Software without restriction, including without limitation the rights
  8898. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8899. * copies of the Software, and to permit persons to whom the Software is
  8900. * furnished to do so, subject to the following conditions:
  8901. *
  8902. * The above copyright notice and this permission notice shall be included in
  8903. * all copies or substantial portions of the Software.
  8904. *
  8905. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  8906. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  8907. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  8908. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  8909. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  8910. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  8911. * THE SOFTWARE.
  8912. */
  8913. var cssClasses = {
  8914. // Ripple is a special case where the "root" component is really a "mixin" of sorts,
  8915. // given that it's an 'upgrade' to an existing component. That being said it is the root
  8916. // CSS class that all other CSS classes derive from.
  8917. ROOT: 'mdc-ripple-upgraded',
  8918. UNBOUNDED: 'mdc-ripple-upgraded--unbounded',
  8919. BG_FOCUSED: 'mdc-ripple-upgraded--background-focused',
  8920. FG_ACTIVATION: 'mdc-ripple-upgraded--foreground-activation',
  8921. FG_DEACTIVATION: 'mdc-ripple-upgraded--foreground-deactivation'
  8922. };
  8923. var strings = {
  8924. VAR_LEFT: '--mdc-ripple-left',
  8925. VAR_TOP: '--mdc-ripple-top',
  8926. VAR_FG_SIZE: '--mdc-ripple-fg-size',
  8927. VAR_FG_SCALE: '--mdc-ripple-fg-scale',
  8928. VAR_FG_TRANSLATE_START: '--mdc-ripple-fg-translate-start',
  8929. VAR_FG_TRANSLATE_END: '--mdc-ripple-fg-translate-end'
  8930. };
  8931. var numbers = {
  8932. PADDING: 10,
  8933. INITIAL_ORIGIN_SCALE: 0.6,
  8934. DEACTIVATION_TIMEOUT_MS: 225, // Corresponds to $mdc-ripple-translate-duration (i.e. activation animation duration)
  8935. FG_DEACTIVATION_MS: 150, // Corresponds to $mdc-ripple-fade-out-duration (i.e. deactivation animation duration)
  8936. TAP_DELAY_MS: 300 };
  8937. /***/ }),
  8938. /* 61 */
  8939. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8940. "use strict";
  8941. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  8942. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_selection_control_index__ = __webpack_require__(4);
  8943. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__adapter__ = __webpack_require__(62);
  8944. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__constants__ = __webpack_require__(63);
  8945. 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; };
  8946. 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; }; }();
  8947. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8948. 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; }
  8949. 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; }
  8950. /**
  8951. * @license
  8952. * Copyright 2016 Google Inc.
  8953. *
  8954. * Permission is hereby granted, free of charge, to any person obtaining a copy
  8955. * of this software and associated documentation files (the "Software"), to deal
  8956. * in the Software without restriction, including without limitation the rights
  8957. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8958. * copies of the Software, and to permit persons to whom the Software is
  8959. * furnished to do so, subject to the following conditions:
  8960. *
  8961. * The above copyright notice and this permission notice shall be included in
  8962. * all copies or substantial portions of the Software.
  8963. *
  8964. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  8965. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  8966. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  8967. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  8968. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  8969. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  8970. * THE SOFTWARE.
  8971. */
  8972. /* eslint-disable no-unused-vars */
  8973. /* eslint-enable no-unused-vars */
  8974. /** @const {!Array<string>} */
  8975. var CB_PROTO_PROPS = ['checked', 'indeterminate'];
  8976. /**
  8977. * @extends {MDCFoundation<!MDCCheckboxAdapter>}
  8978. */
  8979. var MDCCheckboxFoundation = function (_MDCFoundation) {
  8980. _inherits(MDCCheckboxFoundation, _MDCFoundation);
  8981. _createClass(MDCCheckboxFoundation, null, [{
  8982. key: 'cssClasses',
  8983. /** @return enum {cssClasses} */
  8984. get: function get() {
  8985. return __WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */];
  8986. }
  8987. /** @return enum {strings} */
  8988. }, {
  8989. key: 'strings',
  8990. get: function get() {
  8991. return __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */];
  8992. }
  8993. /** @return enum {numbers} */
  8994. }, {
  8995. key: 'numbers',
  8996. get: function get() {
  8997. return __WEBPACK_IMPORTED_MODULE_3__constants__["b" /* numbers */];
  8998. }
  8999. /** @return {!MDCCheckboxAdapter} */
  9000. }, {
  9001. key: 'defaultAdapter',
  9002. get: function get() {
  9003. return (/** @type {!MDCCheckboxAdapter} */{
  9004. addClass: function addClass() /* className: string */{},
  9005. removeClass: function removeClass() /* className: string */{},
  9006. setNativeControlAttr: function setNativeControlAttr() /* attr: string, value: string */{},
  9007. removeNativeControlAttr: function removeNativeControlAttr() /* attr: string */{},
  9008. getNativeControl: function getNativeControl() /* !MDCSelectionControlState */{},
  9009. forceLayout: function forceLayout() {},
  9010. isAttachedToDOM: function isAttachedToDOM() /* boolean */{}
  9011. }
  9012. );
  9013. }
  9014. }]);
  9015. function MDCCheckboxFoundation(adapter) {
  9016. _classCallCheck(this, MDCCheckboxFoundation);
  9017. /** @private {string} */
  9018. var _this = _possibleConstructorReturn(this, (MDCCheckboxFoundation.__proto__ || Object.getPrototypeOf(MDCCheckboxFoundation)).call(this, _extends(MDCCheckboxFoundation.defaultAdapter, adapter)));
  9019. _this.currentCheckState_ = __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].TRANSITION_STATE_INIT;
  9020. /** @private {string} */
  9021. _this.currentAnimationClass_ = '';
  9022. /** @private {number} */
  9023. _this.animEndLatchTimer_ = 0;
  9024. /** @private {boolean} */
  9025. _this.enableAnimationEndHandler_ = false;
  9026. return _this;
  9027. }
  9028. /** @override */
  9029. _createClass(MDCCheckboxFoundation, [{
  9030. key: 'init',
  9031. value: function init() {
  9032. this.currentCheckState_ = this.determineCheckState_(this.getNativeControl_());
  9033. this.updateAriaChecked_();
  9034. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].UPGRADED);
  9035. this.installPropertyChangeHooks_();
  9036. }
  9037. /** @override */
  9038. }, {
  9039. key: 'destroy',
  9040. value: function destroy() {
  9041. this.uninstallPropertyChangeHooks_();
  9042. }
  9043. /** @return {boolean} */
  9044. }, {
  9045. key: 'isChecked',
  9046. value: function isChecked() {
  9047. return this.getNativeControl_().checked;
  9048. }
  9049. /** @param {boolean} checked */
  9050. }, {
  9051. key: 'setChecked',
  9052. value: function setChecked(checked) {
  9053. this.getNativeControl_().checked = checked;
  9054. }
  9055. /** @return {boolean} */
  9056. }, {
  9057. key: 'isIndeterminate',
  9058. value: function isIndeterminate() {
  9059. return this.getNativeControl_().indeterminate;
  9060. }
  9061. /** @param {boolean} indeterminate */
  9062. }, {
  9063. key: 'setIndeterminate',
  9064. value: function setIndeterminate(indeterminate) {
  9065. this.getNativeControl_().indeterminate = indeterminate;
  9066. }
  9067. /** @return {boolean} */
  9068. }, {
  9069. key: 'isDisabled',
  9070. value: function isDisabled() {
  9071. return this.getNativeControl_().disabled;
  9072. }
  9073. /** @param {boolean} disabled */
  9074. }, {
  9075. key: 'setDisabled',
  9076. value: function setDisabled(disabled) {
  9077. this.getNativeControl_().disabled = disabled;
  9078. if (disabled) {
  9079. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].DISABLED);
  9080. } else {
  9081. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].DISABLED);
  9082. }
  9083. }
  9084. /** @return {?string} */
  9085. }, {
  9086. key: 'getValue',
  9087. value: function getValue() {
  9088. return this.getNativeControl_().value;
  9089. }
  9090. /** @param {?string} value */
  9091. }, {
  9092. key: 'setValue',
  9093. value: function setValue(value) {
  9094. this.getNativeControl_().value = value;
  9095. }
  9096. /**
  9097. * Handles the animationend event for the checkbox
  9098. */
  9099. }, {
  9100. key: 'handleAnimationEnd',
  9101. value: function handleAnimationEnd() {
  9102. var _this2 = this;
  9103. if (!this.enableAnimationEndHandler_) return;
  9104. clearTimeout(this.animEndLatchTimer_);
  9105. this.animEndLatchTimer_ = setTimeout(function () {
  9106. _this2.adapter_.removeClass(_this2.currentAnimationClass_);
  9107. _this2.enableAnimationEndHandler_ = false;
  9108. }, __WEBPACK_IMPORTED_MODULE_3__constants__["b" /* numbers */].ANIM_END_LATCH_MS);
  9109. }
  9110. /**
  9111. * Handles the change event for the checkbox
  9112. */
  9113. }, {
  9114. key: 'handleChange',
  9115. value: function handleChange() {
  9116. this.transitionCheckState_();
  9117. }
  9118. /** @private */
  9119. }, {
  9120. key: 'installPropertyChangeHooks_',
  9121. value: function installPropertyChangeHooks_() {
  9122. var _this3 = this;
  9123. var nativeCb = this.getNativeControl_();
  9124. var cbProto = Object.getPrototypeOf(nativeCb);
  9125. CB_PROTO_PROPS.forEach(function (controlState) {
  9126. var desc = Object.getOwnPropertyDescriptor(cbProto, controlState);
  9127. // We have to check for this descriptor, since some browsers (Safari) don't support its return.
  9128. // See: https://bugs.webkit.org/show_bug.cgi?id=49739
  9129. if (validDescriptor(desc)) {
  9130. var nativeCbDesc = /** @type {!ObjectPropertyDescriptor} */{
  9131. get: desc.get,
  9132. set: function set(state) {
  9133. desc.set.call(nativeCb, state);
  9134. _this3.transitionCheckState_();
  9135. },
  9136. configurable: desc.configurable,
  9137. enumerable: desc.enumerable
  9138. };
  9139. Object.defineProperty(nativeCb, controlState, nativeCbDesc);
  9140. }
  9141. });
  9142. }
  9143. /** @private */
  9144. }, {
  9145. key: 'uninstallPropertyChangeHooks_',
  9146. value: function uninstallPropertyChangeHooks_() {
  9147. var nativeCb = this.getNativeControl_();
  9148. var cbProto = Object.getPrototypeOf(nativeCb);
  9149. CB_PROTO_PROPS.forEach(function (controlState) {
  9150. var desc = /** @type {!ObjectPropertyDescriptor} */Object.getOwnPropertyDescriptor(cbProto, controlState);
  9151. if (validDescriptor(desc)) {
  9152. Object.defineProperty(nativeCb, controlState, desc);
  9153. }
  9154. });
  9155. }
  9156. /** @private */
  9157. }, {
  9158. key: 'transitionCheckState_',
  9159. value: function transitionCheckState_() {
  9160. var nativeCb = this.adapter_.getNativeControl();
  9161. if (!nativeCb) {
  9162. return;
  9163. }
  9164. var oldState = this.currentCheckState_;
  9165. var newState = this.determineCheckState_(nativeCb);
  9166. if (oldState === newState) {
  9167. return;
  9168. }
  9169. this.updateAriaChecked_();
  9170. // Check to ensure that there isn't a previously existing animation class, in case for example
  9171. // the user interacted with the checkbox before the animation was finished.
  9172. if (this.currentAnimationClass_.length > 0) {
  9173. clearTimeout(this.animEndLatchTimer_);
  9174. this.adapter_.forceLayout();
  9175. this.adapter_.removeClass(this.currentAnimationClass_);
  9176. }
  9177. this.currentAnimationClass_ = this.getTransitionAnimationClass_(oldState, newState);
  9178. this.currentCheckState_ = newState;
  9179. // Check for parentNode so that animations are only run when the element is attached
  9180. // to the DOM.
  9181. if (this.adapter_.isAttachedToDOM() && this.currentAnimationClass_.length > 0) {
  9182. this.adapter_.addClass(this.currentAnimationClass_);
  9183. this.enableAnimationEndHandler_ = true;
  9184. }
  9185. }
  9186. /**
  9187. * @param {!MDCSelectionControlState} nativeCb
  9188. * @return {string}
  9189. * @private
  9190. */
  9191. }, {
  9192. key: 'determineCheckState_',
  9193. value: function determineCheckState_(nativeCb) {
  9194. var TRANSITION_STATE_INDETERMINATE = __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].TRANSITION_STATE_INDETERMINATE,
  9195. TRANSITION_STATE_CHECKED = __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].TRANSITION_STATE_CHECKED,
  9196. TRANSITION_STATE_UNCHECKED = __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].TRANSITION_STATE_UNCHECKED;
  9197. if (nativeCb.indeterminate) {
  9198. return TRANSITION_STATE_INDETERMINATE;
  9199. }
  9200. return nativeCb.checked ? TRANSITION_STATE_CHECKED : TRANSITION_STATE_UNCHECKED;
  9201. }
  9202. /**
  9203. * @param {string} oldState
  9204. * @param {string} newState
  9205. * @return {string}
  9206. */
  9207. }, {
  9208. key: 'getTransitionAnimationClass_',
  9209. value: function getTransitionAnimationClass_(oldState, newState) {
  9210. var TRANSITION_STATE_INIT = __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].TRANSITION_STATE_INIT,
  9211. TRANSITION_STATE_CHECKED = __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].TRANSITION_STATE_CHECKED,
  9212. TRANSITION_STATE_UNCHECKED = __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].TRANSITION_STATE_UNCHECKED;
  9213. var _MDCCheckboxFoundatio = MDCCheckboxFoundation.cssClasses,
  9214. ANIM_UNCHECKED_CHECKED = _MDCCheckboxFoundatio.ANIM_UNCHECKED_CHECKED,
  9215. ANIM_UNCHECKED_INDETERMINATE = _MDCCheckboxFoundatio.ANIM_UNCHECKED_INDETERMINATE,
  9216. ANIM_CHECKED_UNCHECKED = _MDCCheckboxFoundatio.ANIM_CHECKED_UNCHECKED,
  9217. ANIM_CHECKED_INDETERMINATE = _MDCCheckboxFoundatio.ANIM_CHECKED_INDETERMINATE,
  9218. ANIM_INDETERMINATE_CHECKED = _MDCCheckboxFoundatio.ANIM_INDETERMINATE_CHECKED,
  9219. ANIM_INDETERMINATE_UNCHECKED = _MDCCheckboxFoundatio.ANIM_INDETERMINATE_UNCHECKED;
  9220. switch (oldState) {
  9221. case TRANSITION_STATE_INIT:
  9222. if (newState === TRANSITION_STATE_UNCHECKED) {
  9223. return '';
  9224. }
  9225. // fallthrough
  9226. case TRANSITION_STATE_UNCHECKED:
  9227. return newState === TRANSITION_STATE_CHECKED ? ANIM_UNCHECKED_CHECKED : ANIM_UNCHECKED_INDETERMINATE;
  9228. case TRANSITION_STATE_CHECKED:
  9229. return newState === TRANSITION_STATE_UNCHECKED ? ANIM_CHECKED_UNCHECKED : ANIM_CHECKED_INDETERMINATE;
  9230. // TRANSITION_STATE_INDETERMINATE
  9231. default:
  9232. return newState === TRANSITION_STATE_CHECKED ? ANIM_INDETERMINATE_CHECKED : ANIM_INDETERMINATE_UNCHECKED;
  9233. }
  9234. }
  9235. }, {
  9236. key: 'updateAriaChecked_',
  9237. value: function updateAriaChecked_() {
  9238. // Ensure aria-checked is set to mixed if checkbox is in indeterminate state.
  9239. if (this.isIndeterminate()) {
  9240. this.adapter_.setNativeControlAttr(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].ARIA_CHECKED_ATTR, __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].ARIA_CHECKED_INDETERMINATE_VALUE);
  9241. } else {
  9242. // The on/off state does not need to keep track of aria-checked, since
  9243. // the screenreader uses the checked property on the checkbox element.
  9244. this.adapter_.removeNativeControlAttr(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].ARIA_CHECKED_ATTR);
  9245. }
  9246. }
  9247. /**
  9248. * @return {!MDCSelectionControlState}
  9249. * @private
  9250. */
  9251. }, {
  9252. key: 'getNativeControl_',
  9253. value: function getNativeControl_() {
  9254. return this.adapter_.getNativeControl() || {
  9255. checked: false,
  9256. indeterminate: false,
  9257. disabled: false,
  9258. value: null
  9259. };
  9260. }
  9261. }]);
  9262. return MDCCheckboxFoundation;
  9263. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  9264. /**
  9265. * @param {ObjectPropertyDescriptor|undefined} inputPropDesc
  9266. * @return {boolean}
  9267. */
  9268. function validDescriptor(inputPropDesc) {
  9269. return !!inputPropDesc && typeof inputPropDesc.set === 'function';
  9270. }
  9271. /* harmony default export */ __webpack_exports__["a"] = (MDCCheckboxFoundation);
  9272. /***/ }),
  9273. /* 62 */
  9274. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9275. "use strict";
  9276. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_selection_control_index__ = __webpack_require__(4);
  9277. 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; }; }();
  9278. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9279. /**
  9280. * @license
  9281. * Copyright 2016 Google Inc.
  9282. *
  9283. * Permission is hereby granted, free of charge, to any person obtaining a copy
  9284. * of this software and associated documentation files (the "Software"), to deal
  9285. * in the Software without restriction, including without limitation the rights
  9286. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9287. * copies of the Software, and to permit persons to whom the Software is
  9288. * furnished to do so, subject to the following conditions:
  9289. *
  9290. * The above copyright notice and this permission notice shall be included in
  9291. * all copies or substantial portions of the Software.
  9292. *
  9293. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  9294. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  9295. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  9296. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  9297. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  9298. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  9299. * THE SOFTWARE.
  9300. */
  9301. /* eslint-disable no-unused-vars */
  9302. /* eslint no-unused-vars: [2, {"args": "none"}] */
  9303. /**
  9304. * Adapter for MDC Checkbox. Provides an interface for managing
  9305. * - classes
  9306. * - dom
  9307. * - event handlers
  9308. *
  9309. * Additionally, provides type information for the adapter to the Closure
  9310. * compiler.
  9311. *
  9312. * Implement this adapter for your framework of choice to delegate updates to
  9313. * the component in your framework of choice. See architecture documentation
  9314. * for more details.
  9315. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  9316. *
  9317. * @record
  9318. */
  9319. var MDCCheckboxAdapter = function () {
  9320. function MDCCheckboxAdapter() {
  9321. _classCallCheck(this, MDCCheckboxAdapter);
  9322. }
  9323. _createClass(MDCCheckboxAdapter, [{
  9324. key: 'addClass',
  9325. /** @param {string} className */
  9326. value: function addClass(className) {}
  9327. /** @param {string} className */
  9328. }, {
  9329. key: 'removeClass',
  9330. value: function removeClass(className) {}
  9331. /**
  9332. * Sets an attribute with a given value on the input element.
  9333. * @param {string} attr
  9334. * @param {string} value
  9335. */
  9336. }, {
  9337. key: 'setNativeControlAttr',
  9338. value: function setNativeControlAttr(attr, value) {}
  9339. /**
  9340. * Removes an attribute from the input element.
  9341. * @param {string} attr
  9342. */
  9343. }, {
  9344. key: 'removeNativeControlAttr',
  9345. value: function removeNativeControlAttr(attr) {}
  9346. /** @return {!MDCSelectionControlState} */
  9347. }, {
  9348. key: 'getNativeControl',
  9349. value: function getNativeControl() {}
  9350. }, {
  9351. key: 'forceLayout',
  9352. value: function forceLayout() {}
  9353. /** @return {boolean} */
  9354. }, {
  9355. key: 'isAttachedToDOM',
  9356. value: function isAttachedToDOM() {}
  9357. }]);
  9358. return MDCCheckboxAdapter;
  9359. }();
  9360. /* unused harmony default export */ var _unused_webpack_default_export = (MDCCheckboxAdapter);
  9361. /***/ }),
  9362. /* 63 */
  9363. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9364. "use strict";
  9365. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  9366. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; });
  9367. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; });
  9368. /**
  9369. * @license
  9370. * Copyright 2016 Google Inc.
  9371. *
  9372. * Permission is hereby granted, free of charge, to any person obtaining a copy
  9373. * of this software and associated documentation files (the "Software"), to deal
  9374. * in the Software without restriction, including without limitation the rights
  9375. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9376. * copies of the Software, and to permit persons to whom the Software is
  9377. * furnished to do so, subject to the following conditions:
  9378. *
  9379. * The above copyright notice and this permission notice shall be included in
  9380. * all copies or substantial portions of the Software.
  9381. *
  9382. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  9383. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  9384. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  9385. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  9386. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  9387. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  9388. * THE SOFTWARE.
  9389. */
  9390. /** @const {string} */
  9391. var ROOT = 'mdc-checkbox';
  9392. /** @enum {string} */
  9393. var cssClasses = {
  9394. UPGRADED: 'mdc-checkbox--upgraded',
  9395. CHECKED: 'mdc-checkbox--checked',
  9396. INDETERMINATE: 'mdc-checkbox--indeterminate',
  9397. DISABLED: 'mdc-checkbox--disabled',
  9398. ANIM_UNCHECKED_CHECKED: 'mdc-checkbox--anim-unchecked-checked',
  9399. ANIM_UNCHECKED_INDETERMINATE: 'mdc-checkbox--anim-unchecked-indeterminate',
  9400. ANIM_CHECKED_UNCHECKED: 'mdc-checkbox--anim-checked-unchecked',
  9401. ANIM_CHECKED_INDETERMINATE: 'mdc-checkbox--anim-checked-indeterminate',
  9402. ANIM_INDETERMINATE_CHECKED: 'mdc-checkbox--anim-indeterminate-checked',
  9403. ANIM_INDETERMINATE_UNCHECKED: 'mdc-checkbox--anim-indeterminate-unchecked'
  9404. };
  9405. /** @enum {string} */
  9406. var strings = {
  9407. NATIVE_CONTROL_SELECTOR: '.' + ROOT + '__native-control',
  9408. TRANSITION_STATE_INIT: 'init',
  9409. TRANSITION_STATE_CHECKED: 'checked',
  9410. TRANSITION_STATE_UNCHECKED: 'unchecked',
  9411. TRANSITION_STATE_INDETERMINATE: 'indeterminate',
  9412. ARIA_CHECKED_ATTR: 'aria-checked',
  9413. ARIA_CHECKED_INDETERMINATE_VALUE: 'mixed'
  9414. };
  9415. /** @enum {number} */
  9416. var numbers = {
  9417. ANIM_END_LATCH_MS: 250
  9418. };
  9419. /***/ }),
  9420. /* 64 */
  9421. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9422. "use strict";
  9423. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  9424. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__chip_index__ = __webpack_require__(25);
  9425. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__chip_set_index__ = __webpack_require__(65);
  9426. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCChipFoundation", function() { return __WEBPACK_IMPORTED_MODULE_0__chip_index__["b"]; });
  9427. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCChip", function() { return __WEBPACK_IMPORTED_MODULE_0__chip_index__["a"]; });
  9428. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCChipSetFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__chip_set_index__["b"]; });
  9429. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCChipSet", function() { return __WEBPACK_IMPORTED_MODULE_1__chip_set_index__["a"]; });
  9430. /**
  9431. * @license
  9432. * Copyright 2017 Google Inc.
  9433. *
  9434. * Permission is hereby granted, free of charge, to any person obtaining a copy
  9435. * of this software and associated documentation files (the "Software"), to deal
  9436. * in the Software without restriction, including without limitation the rights
  9437. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9438. * copies of the Software, and to permit persons to whom the Software is
  9439. * furnished to do so, subject to the following conditions:
  9440. *
  9441. * The above copyright notice and this permission notice shall be included in
  9442. * all copies or substantial portions of the Software.
  9443. *
  9444. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  9445. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  9446. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  9447. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  9448. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  9449. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  9450. * THE SOFTWARE.
  9451. */
  9452. /***/ }),
  9453. /* 65 */
  9454. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9455. "use strict";
  9456. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCChipSet; });
  9457. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  9458. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(29);
  9459. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(66);
  9460. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__chip_index__ = __webpack_require__(25);
  9461. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  9462. 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; };
  9463. 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; }; }();
  9464. 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); } };
  9465. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9466. 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; }
  9467. 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; }
  9468. /**
  9469. * @license
  9470. * Copyright 2016 Google Inc.
  9471. *
  9472. * Permission is hereby granted, free of charge, to any person obtaining a copy
  9473. * of this software and associated documentation files (the "Software"), to deal
  9474. * in the Software without restriction, including without limitation the rights
  9475. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9476. * copies of the Software, and to permit persons to whom the Software is
  9477. * furnished to do so, subject to the following conditions:
  9478. *
  9479. * The above copyright notice and this permission notice shall be included in
  9480. * all copies or substantial portions of the Software.
  9481. *
  9482. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  9483. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  9484. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  9485. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  9486. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  9487. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  9488. * THE SOFTWARE.
  9489. */
  9490. var idCounter = 0;
  9491. /**
  9492. * @extends {MDCComponent<!MDCChipSetFoundation>}
  9493. * @final
  9494. */
  9495. var MDCChipSet = function (_MDCComponent) {
  9496. _inherits(MDCChipSet, _MDCComponent);
  9497. /**
  9498. * @param {...?} args
  9499. */
  9500. function MDCChipSet() {
  9501. var _ref;
  9502. _classCallCheck(this, MDCChipSet);
  9503. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  9504. args[_key] = arguments[_key];
  9505. }
  9506. /** @type {!Array<!MDCChip>} */
  9507. var _this = _possibleConstructorReturn(this, (_ref = MDCChipSet.__proto__ || Object.getPrototypeOf(MDCChipSet)).call.apply(_ref, [this].concat(args)));
  9508. _this.chips;
  9509. /** @private {(function(!Element): !MDCChip)} */
  9510. _this.chipFactory_;
  9511. /** @private {?function(?Event): undefined} */
  9512. _this.handleChipInteraction_;
  9513. /** @private {?function(?Event): undefined} */
  9514. _this.handleChipRemoval_;
  9515. return _this;
  9516. }
  9517. /**
  9518. * @param {!Element} root
  9519. * @return {!MDCChipSet}
  9520. */
  9521. _createClass(MDCChipSet, [{
  9522. key: 'initialize',
  9523. /**
  9524. * @param {(function(!Element): !MDCChip)=} chipFactory A function which
  9525. * creates a new MDCChip.
  9526. */
  9527. value: function initialize() {
  9528. var chipFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (el) {
  9529. return new __WEBPACK_IMPORTED_MODULE_3__chip_index__["a" /* MDCChip */](el);
  9530. };
  9531. this.chipFactory_ = chipFactory;
  9532. this.chips = this.instantiateChips_(this.chipFactory_);
  9533. }
  9534. }, {
  9535. key: 'initialSyncWithDOM',
  9536. value: function initialSyncWithDOM() {
  9537. var _this2 = this;
  9538. this.chips.forEach(function (chip) {
  9539. if (chip.selected) {
  9540. _this2.foundation_.select(chip.id);
  9541. }
  9542. });
  9543. this.handleChipInteraction_ = function (evt) {
  9544. return _this2.foundation_.handleChipInteraction(evt);
  9545. };
  9546. this.handleChipRemoval_ = function (evt) {
  9547. return _this2.foundation_.handleChipRemoval(evt);
  9548. };
  9549. this.root_.addEventListener(__WEBPACK_IMPORTED_MODULE_3__chip_index__["b" /* MDCChipFoundation */].strings.INTERACTION_EVENT, this.handleChipInteraction_);
  9550. this.root_.addEventListener(__WEBPACK_IMPORTED_MODULE_3__chip_index__["b" /* MDCChipFoundation */].strings.REMOVAL_EVENT, this.handleChipRemoval_);
  9551. }
  9552. }, {
  9553. key: 'destroy',
  9554. value: function destroy() {
  9555. this.chips.forEach(function (chip) {
  9556. chip.destroy();
  9557. });
  9558. this.root_.removeEventListener(__WEBPACK_IMPORTED_MODULE_3__chip_index__["b" /* MDCChipFoundation */].strings.INTERACTION_EVENT, this.handleChipInteraction_);
  9559. this.root_.removeEventListener(__WEBPACK_IMPORTED_MODULE_3__chip_index__["b" /* MDCChipFoundation */].strings.REMOVAL_EVENT, this.handleChipRemoval_);
  9560. _get(MDCChipSet.prototype.__proto__ || Object.getPrototypeOf(MDCChipSet.prototype), 'destroy', this).call(this);
  9561. }
  9562. /**
  9563. * Adds a new chip object to the chip set from the given chip element.
  9564. * @param {!Element} chipEl
  9565. */
  9566. }, {
  9567. key: 'addChip',
  9568. value: function addChip(chipEl) {
  9569. chipEl.id = chipEl.id || 'mdc-chip-' + ++idCounter;
  9570. this.chips.push(this.chipFactory_(chipEl));
  9571. }
  9572. /**
  9573. * Returns an array of the IDs of all selected chips.
  9574. * @return {!Array<string>}
  9575. */
  9576. }, {
  9577. key: 'getDefaultFoundation',
  9578. /**
  9579. * @return {!MDCChipSetFoundation}
  9580. */
  9581. value: function getDefaultFoundation() {
  9582. var _this3 = this;
  9583. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]( /** @type {!MDCChipSetAdapter} */_extends({
  9584. hasClass: function hasClass(className) {
  9585. return _this3.root_.classList.contains(className);
  9586. },
  9587. removeChip: function removeChip(chipId) {
  9588. var index = _this3.findChipIndex_(chipId);
  9589. if (index >= 0) {
  9590. _this3.chips[index].destroy();
  9591. _this3.chips.splice(index, 1);
  9592. }
  9593. },
  9594. setSelected: function setSelected(chipId, selected) {
  9595. var index = _this3.findChipIndex_(chipId);
  9596. if (index >= 0) {
  9597. _this3.chips[index].selected = selected;
  9598. }
  9599. }
  9600. }));
  9601. }
  9602. /**
  9603. * Instantiates chip components on all of the chip set's child chip elements.
  9604. * @param {(function(!Element): !MDCChip)} chipFactory
  9605. * @return {!Array<!MDCChip>}
  9606. */
  9607. }, {
  9608. key: 'instantiateChips_',
  9609. value: function instantiateChips_(chipFactory) {
  9610. var chipElements = [].slice.call(this.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.CHIP_SELECTOR));
  9611. return chipElements.map(function (el) {
  9612. el.id = el.id || 'mdc-chip-' + ++idCounter;
  9613. return chipFactory(el);
  9614. });
  9615. }
  9616. /**
  9617. * Returns the index of the chip with the given id, or -1 if the chip does not exist.
  9618. * @param {string} chipId
  9619. * @return {number}
  9620. */
  9621. }, {
  9622. key: 'findChipIndex_',
  9623. value: function findChipIndex_(chipId) {
  9624. for (var i = 0; i < this.chips.length; i++) {
  9625. if (this.chips[i].id === chipId) {
  9626. return i;
  9627. }
  9628. }
  9629. return -1;
  9630. }
  9631. }, {
  9632. key: 'selectedChipIds',
  9633. get: function get() {
  9634. return this.foundation_.getSelectedChipIds();
  9635. }
  9636. }], [{
  9637. key: 'attachTo',
  9638. value: function attachTo(root) {
  9639. return new MDCChipSet(root);
  9640. }
  9641. }]);
  9642. return MDCChipSet;
  9643. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  9644. /***/ }),
  9645. /* 66 */
  9646. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9647. "use strict";
  9648. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  9649. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(29);
  9650. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__chip_foundation__ = __webpack_require__(27);
  9651. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__constants__ = __webpack_require__(67);
  9652. 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; };
  9653. 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; }; }();
  9654. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9655. 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; }
  9656. 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; }
  9657. /**
  9658. * @license
  9659. * Copyright 2017 Google Inc.
  9660. *
  9661. * Permission is hereby granted, free of charge, to any person obtaining a copy
  9662. * of this software and associated documentation files (the "Software"), to deal
  9663. * in the Software without restriction, including without limitation the rights
  9664. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9665. * copies of the Software, and to permit persons to whom the Software is
  9666. * furnished to do so, subject to the following conditions:
  9667. *
  9668. * The above copyright notice and this permission notice shall be included in
  9669. * all copies or substantial portions of the Software.
  9670. *
  9671. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  9672. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  9673. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  9674. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  9675. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  9676. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  9677. * THE SOFTWARE.
  9678. */
  9679. // eslint-disable-next-line no-unused-vars
  9680. /**
  9681. * @extends {MDCFoundation<!MDCChipSetAdapter>}
  9682. * @final
  9683. */
  9684. var MDCChipSetFoundation = function (_MDCFoundation) {
  9685. _inherits(MDCChipSetFoundation, _MDCFoundation);
  9686. _createClass(MDCChipSetFoundation, null, [{
  9687. key: 'strings',
  9688. /** @return enum {string} */
  9689. get: function get() {
  9690. return __WEBPACK_IMPORTED_MODULE_3__constants__["b" /* strings */];
  9691. }
  9692. /** @return enum {string} */
  9693. }, {
  9694. key: 'cssClasses',
  9695. get: function get() {
  9696. return __WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */];
  9697. }
  9698. /**
  9699. * {@see MDCChipSetAdapter} for typing information on parameters and return
  9700. * types.
  9701. * @return {!MDCChipSetAdapter}
  9702. */
  9703. }, {
  9704. key: 'defaultAdapter',
  9705. get: function get() {
  9706. return (/** @type {!MDCChipSetAdapter} */{
  9707. hasClass: function hasClass() {},
  9708. removeChip: function removeChip() {},
  9709. setSelected: function setSelected() {}
  9710. }
  9711. );
  9712. }
  9713. /**
  9714. * @param {!MDCChipSetAdapter} adapter
  9715. */
  9716. }]);
  9717. function MDCChipSetFoundation(adapter) {
  9718. _classCallCheck(this, MDCChipSetFoundation);
  9719. /**
  9720. * The ids of the selected chips in the set. Only used for choice chip set or filter chip set.
  9721. * @private {!Array<string>}
  9722. */
  9723. var _this = _possibleConstructorReturn(this, (MDCChipSetFoundation.__proto__ || Object.getPrototypeOf(MDCChipSetFoundation)).call(this, _extends(MDCChipSetFoundation.defaultAdapter, adapter)));
  9724. _this.selectedChipIds_ = [];
  9725. return _this;
  9726. }
  9727. /**
  9728. * Returns an array of the IDs of all selected chips.
  9729. * @return {!Array<string>}
  9730. */
  9731. _createClass(MDCChipSetFoundation, [{
  9732. key: 'getSelectedChipIds',
  9733. value: function getSelectedChipIds() {
  9734. return this.selectedChipIds_;
  9735. }
  9736. /**
  9737. * Toggles selection of the chip with the given id.
  9738. * @param {string} chipId
  9739. */
  9740. }, {
  9741. key: 'toggleSelect',
  9742. value: function toggleSelect(chipId) {
  9743. if (this.selectedChipIds_.indexOf(chipId) >= 0) {
  9744. this.deselect(chipId);
  9745. } else {
  9746. this.select(chipId);
  9747. }
  9748. }
  9749. /**
  9750. * Selects the chip with the given id. Deselects all other chips if the chip set is of the choice variant.
  9751. * @param {string} chipId
  9752. */
  9753. }, {
  9754. key: 'select',
  9755. value: function select(chipId) {
  9756. if (this.selectedChipIds_.indexOf(chipId) >= 0) {
  9757. return;
  9758. }
  9759. if (this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].CHOICE) && this.selectedChipIds_.length > 0) {
  9760. this.adapter_.setSelected(this.selectedChipIds_[0], false);
  9761. this.selectedChipIds_.length = 0;
  9762. }
  9763. this.adapter_.setSelected(chipId, true);
  9764. this.selectedChipIds_.push(chipId);
  9765. }
  9766. /**
  9767. * Deselects the chip with the given id.
  9768. * @param {string} chipId
  9769. */
  9770. }, {
  9771. key: 'deselect',
  9772. value: function deselect(chipId) {
  9773. var index = this.selectedChipIds_.indexOf(chipId);
  9774. if (index >= 0) {
  9775. this.selectedChipIds_.splice(index, 1);
  9776. this.adapter_.setSelected(chipId, false);
  9777. }
  9778. }
  9779. /**
  9780. * Handles a chip interaction event
  9781. * @param {!MDCChipInteractionEventType} evt
  9782. */
  9783. }, {
  9784. key: 'handleChipInteraction',
  9785. value: function handleChipInteraction(evt) {
  9786. var chipId = evt.detail.chipId;
  9787. if (this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].CHOICE) || this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].FILTER)) {
  9788. this.toggleSelect(chipId);
  9789. }
  9790. }
  9791. /**
  9792. * Handles the event when a chip is removed.
  9793. * @param {!MDCChipRemovalEventType} evt
  9794. */
  9795. }, {
  9796. key: 'handleChipRemoval',
  9797. value: function handleChipRemoval(evt) {
  9798. var chipId = evt.detail.chipId;
  9799. this.deselect(chipId);
  9800. this.adapter_.removeChip(chipId);
  9801. }
  9802. }]);
  9803. return MDCChipSetFoundation;
  9804. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  9805. /* harmony default export */ __webpack_exports__["a"] = (MDCChipSetFoundation);
  9806. /***/ }),
  9807. /* 67 */
  9808. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9809. "use strict";
  9810. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  9811. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  9812. /**
  9813. * @license
  9814. * Copyright 2016 Google Inc.
  9815. *
  9816. * Permission is hereby granted, free of charge, to any person obtaining a copy
  9817. * of this software and associated documentation files (the "Software"), to deal
  9818. * in the Software without restriction, including without limitation the rights
  9819. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9820. * copies of the Software, and to permit persons to whom the Software is
  9821. * furnished to do so, subject to the following conditions:
  9822. *
  9823. * The above copyright notice and this permission notice shall be included in
  9824. * all copies or substantial portions of the Software.
  9825. *
  9826. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  9827. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  9828. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  9829. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  9830. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  9831. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  9832. * THE SOFTWARE.
  9833. */
  9834. /** @enum {string} */
  9835. var strings = {
  9836. CHIP_SELECTOR: '.mdc-chip'
  9837. };
  9838. /** @enum {string} */
  9839. var cssClasses = {
  9840. CHOICE: 'mdc-chip-set--choice',
  9841. FILTER: 'mdc-chip-set--filter'
  9842. };
  9843. /***/ }),
  9844. /* 68 */
  9845. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9846. "use strict";
  9847. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  9848. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCDialog", function() { return MDCDialog; });
  9849. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_index__ = __webpack_require__(3);
  9850. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__ = __webpack_require__(2);
  9851. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(69);
  9852. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util__ = __webpack_require__(71);
  9853. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCDialogFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  9854. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "util", function() { return __WEBPACK_IMPORTED_MODULE_3__util__; });
  9855. 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; }; }();
  9856. 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); } };
  9857. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9858. 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; }
  9859. 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; }
  9860. /**
  9861. * @license
  9862. * Copyright 2017 Google Inc.
  9863. *
  9864. * Permission is hereby granted, free of charge, to any person obtaining a copy
  9865. * of this software and associated documentation files (the "Software"), to deal
  9866. * in the Software without restriction, including without limitation the rights
  9867. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9868. * copies of the Software, and to permit persons to whom the Software is
  9869. * furnished to do so, subject to the following conditions:
  9870. *
  9871. * The above copyright notice and this permission notice shall be included in
  9872. * all copies or substantial portions of the Software.
  9873. *
  9874. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  9875. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  9876. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  9877. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  9878. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  9879. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  9880. * THE SOFTWARE.
  9881. */
  9882. var MDCDialog = function (_MDCComponent) {
  9883. _inherits(MDCDialog, _MDCComponent);
  9884. function MDCDialog() {
  9885. _classCallCheck(this, MDCDialog);
  9886. return _possibleConstructorReturn(this, (MDCDialog.__proto__ || Object.getPrototypeOf(MDCDialog)).apply(this, arguments));
  9887. }
  9888. _createClass(MDCDialog, [{
  9889. key: 'initialize',
  9890. value: function initialize() {
  9891. this.focusTrap_ = __WEBPACK_IMPORTED_MODULE_3__util__["createFocusTrapInstance"](this.dialogSurface_, this.acceptButton_);
  9892. this.footerBtnRipples_ = [];
  9893. var footerBtns = this.root_.querySelectorAll('.mdc-dialog__footer__button');
  9894. for (var i = 0, footerBtn; footerBtn = footerBtns[i]; i++) {
  9895. this.footerBtnRipples_.push(new __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRipple"](footerBtn));
  9896. }
  9897. }
  9898. }, {
  9899. key: 'destroy',
  9900. value: function destroy() {
  9901. this.footerBtnRipples_.forEach(function (ripple) {
  9902. return ripple.destroy();
  9903. });
  9904. _get(MDCDialog.prototype.__proto__ || Object.getPrototypeOf(MDCDialog.prototype), 'destroy', this).call(this);
  9905. }
  9906. }, {
  9907. key: 'show',
  9908. value: function show() {
  9909. this.foundation_.open();
  9910. }
  9911. }, {
  9912. key: 'close',
  9913. value: function close() {
  9914. this.foundation_.close();
  9915. }
  9916. }, {
  9917. key: 'getDefaultFoundation',
  9918. value: function getDefaultFoundation() {
  9919. var _this2 = this;
  9920. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]({
  9921. addClass: function addClass(className) {
  9922. return _this2.root_.classList.add(className);
  9923. },
  9924. removeClass: function removeClass(className) {
  9925. return _this2.root_.classList.remove(className);
  9926. },
  9927. addBodyClass: function addBodyClass(className) {
  9928. return document.body.classList.add(className);
  9929. },
  9930. removeBodyClass: function removeBodyClass(className) {
  9931. return document.body.classList.remove(className);
  9932. },
  9933. eventTargetHasClass: function eventTargetHasClass(target, className) {
  9934. return target.classList.contains(className);
  9935. },
  9936. registerInteractionHandler: function registerInteractionHandler(evt, handler) {
  9937. return _this2.root_.addEventListener(evt, handler);
  9938. },
  9939. deregisterInteractionHandler: function deregisterInteractionHandler(evt, handler) {
  9940. return _this2.root_.removeEventListener(evt, handler);
  9941. },
  9942. registerSurfaceInteractionHandler: function registerSurfaceInteractionHandler(evt, handler) {
  9943. return _this2.dialogSurface_.addEventListener(evt, handler);
  9944. },
  9945. deregisterSurfaceInteractionHandler: function deregisterSurfaceInteractionHandler(evt, handler) {
  9946. return _this2.dialogSurface_.removeEventListener(evt, handler);
  9947. },
  9948. registerDocumentKeydownHandler: function registerDocumentKeydownHandler(handler) {
  9949. return document.addEventListener('keydown', handler);
  9950. },
  9951. deregisterDocumentKeydownHandler: function deregisterDocumentKeydownHandler(handler) {
  9952. return document.removeEventListener('keydown', handler);
  9953. },
  9954. notifyAccept: function notifyAccept() {
  9955. return _this2.emit(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.ACCEPT_EVENT);
  9956. },
  9957. notifyCancel: function notifyCancel() {
  9958. return _this2.emit(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.CANCEL_EVENT);
  9959. },
  9960. trapFocusOnSurface: function trapFocusOnSurface() {
  9961. return _this2.focusTrap_.activate();
  9962. },
  9963. untrapFocusOnSurface: function untrapFocusOnSurface() {
  9964. return _this2.focusTrap_.deactivate();
  9965. },
  9966. isDialog: function isDialog(el) {
  9967. return el === _this2.dialogSurface_;
  9968. }
  9969. });
  9970. }
  9971. }, {
  9972. key: 'open',
  9973. get: function get() {
  9974. return this.foundation_.isOpen();
  9975. }
  9976. }, {
  9977. key: 'acceptButton_',
  9978. get: function get() {
  9979. return this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.ACCEPT_SELECTOR);
  9980. }
  9981. }, {
  9982. key: 'dialogSurface_',
  9983. get: function get() {
  9984. return this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.DIALOG_SURFACE_SELECTOR);
  9985. }
  9986. }], [{
  9987. key: 'attachTo',
  9988. value: function attachTo(root) {
  9989. return new MDCDialog(root);
  9990. }
  9991. }]);
  9992. return MDCDialog;
  9993. }(__WEBPACK_IMPORTED_MODULE_0__material_base_index__["MDCComponent"]);
  9994. /***/ }),
  9995. /* 69 */
  9996. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9997. "use strict";
  9998. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_index__ = __webpack_require__(3);
  9999. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(70);
  10000. 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; };
  10001. 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; }; }();
  10002. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  10003. 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; }
  10004. 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; }
  10005. /**
  10006. * @license
  10007. * Copyright 2017 Google Inc.
  10008. *
  10009. * Permission is hereby granted, free of charge, to any person obtaining a copy
  10010. * of this software and associated documentation files (the "Software"), to deal
  10011. * in the Software without restriction, including without limitation the rights
  10012. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10013. * copies of the Software, and to permit persons to whom the Software is
  10014. * furnished to do so, subject to the following conditions:
  10015. *
  10016. * The above copyright notice and this permission notice shall be included in
  10017. * all copies or substantial portions of the Software.
  10018. *
  10019. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  10020. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  10021. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  10022. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  10023. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  10024. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  10025. * THE SOFTWARE.
  10026. */
  10027. var MDCDialogFoundation = function (_MDCFoundation) {
  10028. _inherits(MDCDialogFoundation, _MDCFoundation);
  10029. _createClass(MDCDialogFoundation, null, [{
  10030. key: 'cssClasses',
  10031. get: function get() {
  10032. return __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */];
  10033. }
  10034. }, {
  10035. key: 'strings',
  10036. get: function get() {
  10037. return __WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */];
  10038. }
  10039. }, {
  10040. key: 'numbers',
  10041. get: function get() {
  10042. return __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* numbers */];
  10043. }
  10044. }, {
  10045. key: 'defaultAdapter',
  10046. get: function get() {
  10047. return {
  10048. addClass: function addClass() /* className: string */{},
  10049. removeClass: function removeClass() /* className: string */{},
  10050. addBodyClass: function addBodyClass() /* className: string */{},
  10051. removeBodyClass: function removeBodyClass() /* className: string */{},
  10052. eventTargetHasClass: function eventTargetHasClass() {
  10053. return (/* target: EventTarget, className: string */ /* boolean */false
  10054. );
  10055. },
  10056. registerInteractionHandler: function registerInteractionHandler() /* evt: string, handler: EventListener */{},
  10057. deregisterInteractionHandler: function deregisterInteractionHandler() /* evt: string, handler: EventListener */{},
  10058. registerSurfaceInteractionHandler: function registerSurfaceInteractionHandler() /* evt: string, handler: EventListener */{},
  10059. deregisterSurfaceInteractionHandler: function deregisterSurfaceInteractionHandler() /* evt: string, handler: EventListener */{},
  10060. registerDocumentKeydownHandler: function registerDocumentKeydownHandler() /* handler: EventListener */{},
  10061. deregisterDocumentKeydownHandler: function deregisterDocumentKeydownHandler() /* handler: EventListener */{},
  10062. notifyAccept: function notifyAccept() {},
  10063. notifyCancel: function notifyCancel() {},
  10064. trapFocusOnSurface: function trapFocusOnSurface() {},
  10065. untrapFocusOnSurface: function untrapFocusOnSurface() {},
  10066. isDialog: function isDialog() {
  10067. return (/* el: Element */ /* boolean */false
  10068. );
  10069. }
  10070. };
  10071. }
  10072. }]);
  10073. function MDCDialogFoundation(adapter) {
  10074. _classCallCheck(this, MDCDialogFoundation);
  10075. var _this = _possibleConstructorReturn(this, (MDCDialogFoundation.__proto__ || Object.getPrototypeOf(MDCDialogFoundation)).call(this, _extends(MDCDialogFoundation.defaultAdapter, adapter)));
  10076. _this.isOpen_ = false;
  10077. _this.componentClickHandler_ = function (evt) {
  10078. if (_this.adapter_.eventTargetHasClass(evt.target, __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].BACKDROP)) {
  10079. _this.cancel(true);
  10080. }
  10081. };
  10082. _this.dialogClickHandler_ = function (evt) {
  10083. return _this.handleDialogClick_(evt);
  10084. };
  10085. _this.documentKeydownHandler_ = function (evt) {
  10086. if (evt.key && evt.key === 'Escape' || evt.keyCode === 27) {
  10087. _this.cancel(true);
  10088. }
  10089. };
  10090. _this.timerId_ = 0;
  10091. _this.animationTimerEnd_ = function (evt) {
  10092. return _this.handleAnimationTimerEnd_(evt);
  10093. };
  10094. return _this;
  10095. }
  10096. _createClass(MDCDialogFoundation, [{
  10097. key: 'destroy',
  10098. value: function destroy() {
  10099. // Ensure that dialog is cleaned up when destroyed
  10100. if (this.isOpen_) {
  10101. this.close();
  10102. }
  10103. // Final cleanup of animating class in case the timer has not completed.
  10104. this.adapter_.removeClass(MDCDialogFoundation.cssClasses.ANIMATING);
  10105. clearTimeout(this.timerId_);
  10106. }
  10107. }, {
  10108. key: 'open',
  10109. value: function open() {
  10110. this.isOpen_ = true;
  10111. this.disableScroll_();
  10112. this.adapter_.registerDocumentKeydownHandler(this.documentKeydownHandler_);
  10113. this.adapter_.registerSurfaceInteractionHandler('click', this.dialogClickHandler_);
  10114. this.adapter_.registerInteractionHandler('click', this.componentClickHandler_);
  10115. clearTimeout(this.timerId_);
  10116. this.timerId_ = setTimeout(this.animationTimerEnd_, MDCDialogFoundation.numbers.DIALOG_ANIMATION_TIME_MS);
  10117. this.adapter_.addClass(MDCDialogFoundation.cssClasses.ANIMATING);
  10118. this.adapter_.addClass(MDCDialogFoundation.cssClasses.OPEN);
  10119. }
  10120. }, {
  10121. key: 'close',
  10122. value: function close() {
  10123. this.isOpen_ = false;
  10124. this.enableScroll_();
  10125. this.adapter_.deregisterSurfaceInteractionHandler('click', this.dialogClickHandler_);
  10126. this.adapter_.deregisterDocumentKeydownHandler(this.documentKeydownHandler_);
  10127. this.adapter_.deregisterInteractionHandler('click', this.componentClickHandler_);
  10128. this.adapter_.untrapFocusOnSurface();
  10129. clearTimeout(this.timerId_);
  10130. this.timerId_ = setTimeout(this.animationTimerEnd_, MDCDialogFoundation.numbers.DIALOG_ANIMATION_TIME_MS);
  10131. this.adapter_.addClass(MDCDialogFoundation.cssClasses.ANIMATING);
  10132. this.adapter_.removeClass(MDCDialogFoundation.cssClasses.OPEN);
  10133. }
  10134. }, {
  10135. key: 'isOpen',
  10136. value: function isOpen() {
  10137. return this.isOpen_;
  10138. }
  10139. }, {
  10140. key: 'accept',
  10141. value: function accept(shouldNotify) {
  10142. if (shouldNotify) {
  10143. this.adapter_.notifyAccept();
  10144. }
  10145. this.close();
  10146. }
  10147. }, {
  10148. key: 'cancel',
  10149. value: function cancel(shouldNotify) {
  10150. if (shouldNotify) {
  10151. this.adapter_.notifyCancel();
  10152. }
  10153. this.close();
  10154. }
  10155. }, {
  10156. key: 'handleDialogClick_',
  10157. value: function handleDialogClick_(evt) {
  10158. var target = evt.target;
  10159. if (this.adapter_.eventTargetHasClass(target, __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].ACCEPT_BTN)) {
  10160. this.accept(true);
  10161. } else if (this.adapter_.eventTargetHasClass(target, __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].CANCEL_BTN)) {
  10162. this.cancel(true);
  10163. }
  10164. }
  10165. }, {
  10166. key: 'handleAnimationTimerEnd_',
  10167. value: function handleAnimationTimerEnd_() {
  10168. this.adapter_.removeClass(MDCDialogFoundation.cssClasses.ANIMATING);
  10169. if (this.isOpen_) {
  10170. this.adapter_.trapFocusOnSurface();
  10171. }
  10172. }
  10173. }, {
  10174. key: 'disableScroll_',
  10175. value: function disableScroll_() {
  10176. this.adapter_.addBodyClass(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].SCROLL_LOCK);
  10177. }
  10178. }, {
  10179. key: 'enableScroll_',
  10180. value: function enableScroll_() {
  10181. this.adapter_.removeBodyClass(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].SCROLL_LOCK);
  10182. }
  10183. }]);
  10184. return MDCDialogFoundation;
  10185. }(__WEBPACK_IMPORTED_MODULE_0__material_base_index__["MDCFoundation"]);
  10186. /* harmony default export */ __webpack_exports__["a"] = (MDCDialogFoundation);
  10187. /***/ }),
  10188. /* 70 */
  10189. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10190. "use strict";
  10191. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  10192. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; });
  10193. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; });
  10194. /**
  10195. * @license
  10196. * Copyright 2016 Google Inc.
  10197. *
  10198. * Permission is hereby granted, free of charge, to any person obtaining a copy
  10199. * of this software and associated documentation files (the "Software"), to deal
  10200. * in the Software without restriction, including without limitation the rights
  10201. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10202. * copies of the Software, and to permit persons to whom the Software is
  10203. * furnished to do so, subject to the following conditions:
  10204. *
  10205. * The above copyright notice and this permission notice shall be included in
  10206. * all copies or substantial portions of the Software.
  10207. *
  10208. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  10209. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  10210. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  10211. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  10212. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  10213. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  10214. * THE SOFTWARE.
  10215. */
  10216. var cssClasses = {
  10217. ROOT: 'mdc-dialog',
  10218. OPEN: 'mdc-dialog--open',
  10219. ANIMATING: 'mdc-dialog--animating',
  10220. BACKDROP: 'mdc-dialog__backdrop',
  10221. SCROLL_LOCK: 'mdc-dialog-scroll-lock',
  10222. ACCEPT_BTN: 'mdc-dialog__footer__button--accept',
  10223. CANCEL_BTN: 'mdc-dialog__footer__button--cancel'
  10224. };
  10225. var strings = {
  10226. OPEN_DIALOG_SELECTOR: '.mdc-dialog--open',
  10227. DIALOG_SURFACE_SELECTOR: '.mdc-dialog__surface',
  10228. ACCEPT_SELECTOR: '.mdc-dialog__footer__button--accept',
  10229. ACCEPT_EVENT: 'MDCDialog:accept',
  10230. CANCEL_EVENT: 'MDCDialog:cancel'
  10231. };
  10232. var numbers = {
  10233. DIALOG_ANIMATION_TIME_MS: 120
  10234. };
  10235. /***/ }),
  10236. /* 71 */
  10237. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10238. "use strict";
  10239. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  10240. /* harmony export (immutable) */ __webpack_exports__["createFocusTrapInstance"] = createFocusTrapInstance;
  10241. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_focus_trap__ = __webpack_require__(72);
  10242. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_focus_trap___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_focus_trap__);
  10243. /**
  10244. * @license
  10245. * Copyright 2016 Google Inc.
  10246. *
  10247. * Permission is hereby granted, free of charge, to any person obtaining a copy
  10248. * of this software and associated documentation files (the "Software"), to deal
  10249. * in the Software without restriction, including without limitation the rights
  10250. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10251. * copies of the Software, and to permit persons to whom the Software is
  10252. * furnished to do so, subject to the following conditions:
  10253. *
  10254. * The above copyright notice and this permission notice shall be included in
  10255. * all copies or substantial portions of the Software.
  10256. *
  10257. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  10258. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  10259. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  10260. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  10261. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  10262. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  10263. * THE SOFTWARE.
  10264. */
  10265. function createFocusTrapInstance(surfaceEl, acceptButtonEl) {
  10266. var focusTrapFactory = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : __WEBPACK_IMPORTED_MODULE_0_focus_trap___default.a;
  10267. return focusTrapFactory(surfaceEl, {
  10268. initialFocus: acceptButtonEl,
  10269. clickOutsideDeactivates: true
  10270. });
  10271. }
  10272. /***/ }),
  10273. /* 72 */
  10274. /***/ (function(module, exports, __webpack_require__) {
  10275. var tabbable = __webpack_require__(73);
  10276. var listeningFocusTrap = null;
  10277. function focusTrap(element, userOptions) {
  10278. var tabbableNodes = [];
  10279. var firstTabbableNode = null;
  10280. var lastTabbableNode = null;
  10281. var nodeFocusedBeforeActivation = null;
  10282. var active = false;
  10283. var paused = false;
  10284. var tabEvent = null;
  10285. var container = (typeof element === 'string')
  10286. ? document.querySelector(element)
  10287. : element;
  10288. var config = userOptions || {};
  10289. config.returnFocusOnDeactivate = (userOptions && userOptions.returnFocusOnDeactivate !== undefined)
  10290. ? userOptions.returnFocusOnDeactivate
  10291. : true;
  10292. config.escapeDeactivates = (userOptions && userOptions.escapeDeactivates !== undefined)
  10293. ? userOptions.escapeDeactivates
  10294. : true;
  10295. var trap = {
  10296. activate: activate,
  10297. deactivate: deactivate,
  10298. pause: pause,
  10299. unpause: unpause,
  10300. };
  10301. return trap;
  10302. function activate(activateOptions) {
  10303. if (active) return;
  10304. var defaultedActivateOptions = {
  10305. onActivate: (activateOptions && activateOptions.onActivate !== undefined)
  10306. ? activateOptions.onActivate
  10307. : config.onActivate,
  10308. };
  10309. active = true;
  10310. paused = false;
  10311. nodeFocusedBeforeActivation = document.activeElement;
  10312. if (defaultedActivateOptions.onActivate) {
  10313. defaultedActivateOptions.onActivate();
  10314. }
  10315. addListeners();
  10316. return trap;
  10317. }
  10318. function deactivate(deactivateOptions) {
  10319. if (!active) return;
  10320. var defaultedDeactivateOptions = {
  10321. returnFocus: (deactivateOptions && deactivateOptions.returnFocus !== undefined)
  10322. ? deactivateOptions.returnFocus
  10323. : config.returnFocusOnDeactivate,
  10324. onDeactivate: (deactivateOptions && deactivateOptions.onDeactivate !== undefined)
  10325. ? deactivateOptions.onDeactivate
  10326. : config.onDeactivate,
  10327. };
  10328. removeListeners();
  10329. if (defaultedDeactivateOptions.onDeactivate) {
  10330. defaultedDeactivateOptions.onDeactivate();
  10331. }
  10332. if (defaultedDeactivateOptions.returnFocus) {
  10333. setTimeout(function () {
  10334. tryFocus(nodeFocusedBeforeActivation);
  10335. }, 0);
  10336. }
  10337. active = false;
  10338. paused = false;
  10339. return this;
  10340. }
  10341. function pause() {
  10342. if (paused || !active) return;
  10343. paused = true;
  10344. removeListeners();
  10345. }
  10346. function unpause() {
  10347. if (!paused || !active) return;
  10348. paused = false;
  10349. addListeners();
  10350. }
  10351. function addListeners() {
  10352. if (!active) return;
  10353. // There can be only one listening focus trap at a time
  10354. if (listeningFocusTrap) {
  10355. listeningFocusTrap.pause();
  10356. }
  10357. listeningFocusTrap = trap;
  10358. updateTabbableNodes();
  10359. tryFocus(firstFocusNode());
  10360. document.addEventListener('focus', checkFocus, true);
  10361. document.addEventListener('click', checkClick, true);
  10362. document.addEventListener('mousedown', checkPointerDown, true);
  10363. document.addEventListener('touchstart', checkPointerDown, true);
  10364. document.addEventListener('keydown', checkKey, true);
  10365. return trap;
  10366. }
  10367. function removeListeners() {
  10368. if (!active || listeningFocusTrap !== trap) return;
  10369. document.removeEventListener('focus', checkFocus, true);
  10370. document.removeEventListener('click', checkClick, true);
  10371. document.removeEventListener('mousedown', checkPointerDown, true);
  10372. document.removeEventListener('touchstart', checkPointerDown, true);
  10373. document.removeEventListener('keydown', checkKey, true);
  10374. listeningFocusTrap = null;
  10375. return trap;
  10376. }
  10377. function getNodeForOption(optionName) {
  10378. var optionValue = config[optionName];
  10379. var node = optionValue;
  10380. if (!optionValue) {
  10381. return null;
  10382. }
  10383. if (typeof optionValue === 'string') {
  10384. node = document.querySelector(optionValue);
  10385. if (!node) {
  10386. throw new Error('`' + optionName + '` refers to no known node');
  10387. }
  10388. }
  10389. if (typeof optionValue === 'function') {
  10390. node = optionValue();
  10391. if (!node) {
  10392. throw new Error('`' + optionName + '` did not return a node');
  10393. }
  10394. }
  10395. return node;
  10396. }
  10397. function firstFocusNode() {
  10398. var node;
  10399. if (getNodeForOption('initialFocus') !== null) {
  10400. node = getNodeForOption('initialFocus');
  10401. } else if (container.contains(document.activeElement)) {
  10402. node = document.activeElement;
  10403. } else {
  10404. node = tabbableNodes[0] || getNodeForOption('fallbackFocus');
  10405. }
  10406. if (!node) {
  10407. throw new Error('You can\'t have a focus-trap without at least one focusable element');
  10408. }
  10409. return node;
  10410. }
  10411. // This needs to be done on mousedown and touchstart instead of click
  10412. // so that it precedes the focus event
  10413. function checkPointerDown(e) {
  10414. if (config.clickOutsideDeactivates && !container.contains(e.target)) {
  10415. deactivate({ returnFocus: false });
  10416. }
  10417. }
  10418. function checkClick(e) {
  10419. if (config.clickOutsideDeactivates) return;
  10420. if (container.contains(e.target)) return;
  10421. e.preventDefault();
  10422. e.stopImmediatePropagation();
  10423. }
  10424. function checkFocus(e) {
  10425. if (container.contains(e.target)) return;
  10426. e.preventDefault();
  10427. e.stopImmediatePropagation();
  10428. // Checking for a blur method here resolves a Firefox issue (#15)
  10429. if (typeof e.target.blur === 'function') e.target.blur();
  10430. if (tabEvent) {
  10431. readjustFocus(tabEvent);
  10432. }
  10433. }
  10434. function checkKey(e) {
  10435. if (e.key === 'Tab' || e.keyCode === 9) {
  10436. handleTab(e);
  10437. }
  10438. if (config.escapeDeactivates !== false && isEscapeEvent(e)) {
  10439. deactivate();
  10440. }
  10441. }
  10442. function handleTab(e) {
  10443. updateTabbableNodes();
  10444. if (e.target.hasAttribute('tabindex') && Number(e.target.getAttribute('tabindex')) < 0) {
  10445. return tabEvent = e;
  10446. }
  10447. e.preventDefault();
  10448. var currentFocusIndex = tabbableNodes.indexOf(e.target);
  10449. if (e.shiftKey) {
  10450. if (e.target === firstTabbableNode || tabbableNodes.indexOf(e.target) === -1) {
  10451. return tryFocus(lastTabbableNode);
  10452. }
  10453. return tryFocus(tabbableNodes[currentFocusIndex - 1]);
  10454. }
  10455. if (e.target === lastTabbableNode) return tryFocus(firstTabbableNode);
  10456. tryFocus(tabbableNodes[currentFocusIndex + 1]);
  10457. }
  10458. function updateTabbableNodes() {
  10459. tabbableNodes = tabbable(container);
  10460. firstTabbableNode = tabbableNodes[0];
  10461. lastTabbableNode = tabbableNodes[tabbableNodes.length - 1];
  10462. }
  10463. function readjustFocus(e) {
  10464. if (e.shiftKey) return tryFocus(lastTabbableNode);
  10465. tryFocus(firstTabbableNode);
  10466. }
  10467. }
  10468. function isEscapeEvent(e) {
  10469. return e.key === 'Escape' || e.key === 'Esc' || e.keyCode === 27;
  10470. }
  10471. function tryFocus(node) {
  10472. if (!node || !node.focus) return;
  10473. if (node === document.activeElement) return;
  10474. node.focus();
  10475. if (node.tagName.toLowerCase() === 'input') {
  10476. node.select();
  10477. }
  10478. }
  10479. module.exports = focusTrap;
  10480. /***/ }),
  10481. /* 73 */
  10482. /***/ (function(module, exports) {
  10483. module.exports = function(el, options) {
  10484. options = options || {};
  10485. var elementDocument = el.ownerDocument || el;
  10486. var basicTabbables = [];
  10487. var orderedTabbables = [];
  10488. // A node is "available" if
  10489. // - it's computed style
  10490. var isUnavailable = createIsUnavailable(elementDocument);
  10491. var candidateSelectors = [
  10492. 'input',
  10493. 'select',
  10494. 'a[href]',
  10495. 'textarea',
  10496. 'button',
  10497. '[tabindex]',
  10498. ];
  10499. var candidates = el.querySelectorAll(candidateSelectors.join(','));
  10500. if (options.includeContainer) {
  10501. var matches = Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
  10502. if (
  10503. candidateSelectors.some(function(candidateSelector) {
  10504. return matches.call(el, candidateSelector);
  10505. })
  10506. ) {
  10507. candidates = Array.prototype.slice.apply(candidates);
  10508. candidates.unshift(el);
  10509. }
  10510. }
  10511. var candidate, candidateIndex;
  10512. for (var i = 0, l = candidates.length; i < l; i++) {
  10513. candidate = candidates[i];
  10514. candidateIndex = parseInt(candidate.getAttribute('tabindex'), 10) || candidate.tabIndex;
  10515. if (
  10516. candidateIndex < 0
  10517. || (candidate.tagName === 'INPUT' && candidate.type === 'hidden')
  10518. || candidate.disabled
  10519. || isUnavailable(candidate, elementDocument)
  10520. ) {
  10521. continue;
  10522. }
  10523. if (candidateIndex === 0) {
  10524. basicTabbables.push(candidate);
  10525. } else {
  10526. orderedTabbables.push({
  10527. index: i,
  10528. tabIndex: candidateIndex,
  10529. node: candidate,
  10530. });
  10531. }
  10532. }
  10533. var tabbableNodes = orderedTabbables
  10534. .sort(function(a, b) {
  10535. return a.tabIndex === b.tabIndex ? a.index - b.index : a.tabIndex - b.tabIndex;
  10536. })
  10537. .map(function(a) {
  10538. return a.node
  10539. });
  10540. Array.prototype.push.apply(tabbableNodes, basicTabbables);
  10541. return tabbableNodes;
  10542. }
  10543. function createIsUnavailable(elementDocument) {
  10544. // Node cache must be refreshed on every check, in case
  10545. // the content of the element has changed
  10546. var isOffCache = [];
  10547. // "off" means `display: none;`, as opposed to "hidden",
  10548. // which means `visibility: hidden;`. getComputedStyle
  10549. // accurately reflects visiblity in context but not
  10550. // "off" state, so we need to recursively check parents.
  10551. function isOff(node, nodeComputedStyle) {
  10552. if (node === elementDocument.documentElement) return false;
  10553. // Find the cached node (Array.prototype.find not available in IE9)
  10554. for (var i = 0, length = isOffCache.length; i < length; i++) {
  10555. if (isOffCache[i][0] === node) return isOffCache[i][1];
  10556. }
  10557. nodeComputedStyle = nodeComputedStyle || elementDocument.defaultView.getComputedStyle(node);
  10558. var result = false;
  10559. if (nodeComputedStyle.display === 'none') {
  10560. result = true;
  10561. } else if (node.parentNode) {
  10562. result = isOff(node.parentNode);
  10563. }
  10564. isOffCache.push([node, result]);
  10565. return result;
  10566. }
  10567. return function isUnavailable(node) {
  10568. if (node === elementDocument.documentElement) return false;
  10569. var computedStyle = elementDocument.defaultView.getComputedStyle(node);
  10570. if (isOff(node, computedStyle)) return true;
  10571. return computedStyle.visibility === 'hidden';
  10572. }
  10573. }
  10574. /***/ }),
  10575. /* 74 */
  10576. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10577. "use strict";
  10578. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  10579. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCDrawer", function() { return MDCDrawer; });
  10580. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_index__ = __webpack_require__(3);
  10581. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__dismissible_foundation__ = __webpack_require__(30);
  10582. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__modal_foundation__ = __webpack_require__(75);
  10583. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__adapter__ = __webpack_require__(13);
  10584. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__material_list_index__ = __webpack_require__(14);
  10585. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__material_list_foundation__ = __webpack_require__(15);
  10586. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__constants__ = __webpack_require__(31);
  10587. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__util__ = __webpack_require__(76);
  10588. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_focus_trap__ = __webpack_require__(34);
  10589. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_focus_trap___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_focus_trap__);
  10590. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCDismissibleDrawerFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__dismissible_foundation__["a"]; });
  10591. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCModalDrawerFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__modal_foundation__["a"]; });
  10592. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "util", function() { return __WEBPACK_IMPORTED_MODULE_7__util__; });
  10593. 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; };
  10594. 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; }; }();
  10595. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  10596. 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; }
  10597. 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; }
  10598. /**
  10599. * @license
  10600. * Copyright 2016 Google Inc.
  10601. *
  10602. * Permission is hereby granted, free of charge, to any person obtaining a copy
  10603. * of this software and associated documentation files (the "Software"), to deal
  10604. * in the Software without restriction, including without limitation the rights
  10605. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10606. * copies of the Software, and to permit persons to whom the Software is
  10607. * furnished to do so, subject to the following conditions:
  10608. *
  10609. * The above copyright notice and this permission notice shall be included in
  10610. * all copies or substantial portions of the Software.
  10611. *
  10612. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  10613. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  10614. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  10615. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  10616. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  10617. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  10618. * THE SOFTWARE.
  10619. */
  10620. /**
  10621. * @extends {MDCComponent<!MDCDismissibleDrawerFoundation>}
  10622. * @final
  10623. */
  10624. var MDCDrawer = function (_MDCComponent) {
  10625. _inherits(MDCDrawer, _MDCComponent);
  10626. /**
  10627. * @param {...?} args
  10628. */
  10629. function MDCDrawer() {
  10630. var _ref;
  10631. _classCallCheck(this, MDCDrawer);
  10632. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  10633. args[_key] = arguments[_key];
  10634. }
  10635. /** @private {!Element} */
  10636. var _this = _possibleConstructorReturn(this, (_ref = MDCDrawer.__proto__ || Object.getPrototypeOf(MDCDrawer)).call.apply(_ref, [this].concat(args)));
  10637. _this.previousFocus_;
  10638. /** @private {!Function} */
  10639. _this.handleKeydown_;
  10640. /** @private {!Function} */
  10641. _this.handleTransitionEnd_;
  10642. /** @private {!Function} */
  10643. _this.focusTrapFactory_;
  10644. /** @private {!FocusTrapInstance} */
  10645. _this.focusTrap_;
  10646. /** @private {?Element} */
  10647. _this.scrim_;
  10648. /** @private {?Function} */
  10649. _this.handleScrimClick_;
  10650. /** @private {?MDCList} */
  10651. _this.list_;
  10652. return _this;
  10653. }
  10654. /**
  10655. * @param {!Element} root
  10656. * @return {!MDCDrawer}
  10657. */
  10658. _createClass(MDCDrawer, [{
  10659. key: 'initialize',
  10660. value: function initialize() {
  10661. var focusTrapFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : __WEBPACK_IMPORTED_MODULE_8_focus_trap___default.a;
  10662. var listFactory = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (el) {
  10663. return new __WEBPACK_IMPORTED_MODULE_4__material_list_index__["MDCList"](el);
  10664. };
  10665. var listEl = /** @type {!Element} */this.root_.querySelector('.' + __WEBPACK_IMPORTED_MODULE_5__material_list_foundation__["a" /* default */].cssClasses.ROOT);
  10666. if (listEl) {
  10667. this.list_ = listFactory(listEl);
  10668. this.list_.wrapFocus = true;
  10669. }
  10670. this.focusTrapFactory_ = focusTrapFactory;
  10671. }
  10672. }, {
  10673. key: 'initialSyncWithDOM',
  10674. value: function initialSyncWithDOM() {
  10675. var _this2 = this;
  10676. var MODAL = __WEBPACK_IMPORTED_MODULE_1__dismissible_foundation__["a" /* default */].cssClasses.MODAL;
  10677. if (this.root_.classList.contains(MODAL)) {
  10678. var SCRIM_SELECTOR = __WEBPACK_IMPORTED_MODULE_1__dismissible_foundation__["a" /* default */].strings.SCRIM_SELECTOR;
  10679. this.scrim_ = /** @type {!Element} */this.root_.parentElement.querySelector(SCRIM_SELECTOR);
  10680. this.handleScrimClick_ = function () {
  10681. return (/** @type {!MDCModalDrawerFoundation} */_this2.foundation_.handleScrimClick()
  10682. );
  10683. };
  10684. this.scrim_.addEventListener('click', this.handleScrimClick_);
  10685. this.focusTrap_ = __WEBPACK_IMPORTED_MODULE_7__util__["createFocusTrapInstance"](this.root_, this.focusTrapFactory_);
  10686. }
  10687. this.handleKeydown_ = function (evt) {
  10688. return _this2.foundation_.handleKeydown(evt);
  10689. };
  10690. this.handleTransitionEnd_ = function (evt) {
  10691. return _this2.foundation_.handleTransitionEnd(evt);
  10692. };
  10693. this.root_.addEventListener('keydown', this.handleKeydown_);
  10694. this.root_.addEventListener('transitionend', this.handleTransitionEnd_);
  10695. }
  10696. }, {
  10697. key: 'destroy',
  10698. value: function destroy() {
  10699. this.root_.removeEventListener('keydown', this.handleKeydown_);
  10700. this.root_.removeEventListener('transitionend', this.handleTransitionEnd_);
  10701. if (this.list_) {
  10702. this.list_.destroy();
  10703. }
  10704. var MODAL = __WEBPACK_IMPORTED_MODULE_1__dismissible_foundation__["a" /* default */].cssClasses.MODAL;
  10705. if (this.root_.classList.contains(MODAL)) {
  10706. this.scrim_.removeEventListener('click', /** @type {!Function} */this.handleScrimClick_);
  10707. // Ensure drawer is closed to hide scrim and release focus
  10708. this.open = false;
  10709. }
  10710. }
  10711. }, {
  10712. key: 'getDefaultFoundation',
  10713. value: function getDefaultFoundation() {
  10714. var _this3 = this;
  10715. /** @type {!MDCDrawerAdapter} */
  10716. var adapter = /** @type {!MDCDrawerAdapter} */_extends({
  10717. addClass: function addClass(className) {
  10718. return _this3.root_.classList.add(className);
  10719. },
  10720. removeClass: function removeClass(className) {
  10721. return _this3.root_.classList.remove(className);
  10722. },
  10723. hasClass: function hasClass(className) {
  10724. return _this3.root_.classList.contains(className);
  10725. },
  10726. elementHasClass: function elementHasClass(element, className) {
  10727. return element.classList.contains(className);
  10728. },
  10729. computeBoundingRect: function computeBoundingRect() {
  10730. return _this3.root_.getBoundingClientRect();
  10731. },
  10732. saveFocus: function saveFocus() {
  10733. _this3.previousFocus_ = document.activeElement;
  10734. },
  10735. restoreFocus: function restoreFocus() {
  10736. var previousFocus = _this3.previousFocus_ && _this3.previousFocus_.focus;
  10737. if (_this3.root_.contains(document.activeElement) && previousFocus) {
  10738. _this3.previousFocus_.focus();
  10739. }
  10740. },
  10741. focusActiveNavigationItem: function focusActiveNavigationItem() {
  10742. var activeNavItemEl = _this3.root_.querySelector('.' + __WEBPACK_IMPORTED_MODULE_5__material_list_foundation__["a" /* default */].cssClasses.LIST_ITEM_ACTIVATED_CLASS);
  10743. if (activeNavItemEl) {
  10744. activeNavItemEl.focus();
  10745. }
  10746. },
  10747. notifyClose: function notifyClose() {
  10748. return _this3.emit(__WEBPACK_IMPORTED_MODULE_6__constants__["b" /* strings */].CLOSE_EVENT, {}, true /* shouldBubble */);
  10749. },
  10750. notifyOpen: function notifyOpen() {
  10751. return _this3.emit(__WEBPACK_IMPORTED_MODULE_6__constants__["b" /* strings */].OPEN_EVENT, {}, true /* shouldBubble */);
  10752. },
  10753. trapFocus: function trapFocus() {
  10754. return _this3.focusTrap_.activate();
  10755. },
  10756. releaseFocus: function releaseFocus() {
  10757. return _this3.focusTrap_.deactivate();
  10758. }
  10759. });
  10760. var _MDCDismissibleDrawer = __WEBPACK_IMPORTED_MODULE_1__dismissible_foundation__["a" /* default */].cssClasses,
  10761. DISMISSIBLE = _MDCDismissibleDrawer.DISMISSIBLE,
  10762. MODAL = _MDCDismissibleDrawer.MODAL;
  10763. if (this.root_.classList.contains(DISMISSIBLE)) {
  10764. return new __WEBPACK_IMPORTED_MODULE_1__dismissible_foundation__["a" /* default */](adapter);
  10765. } else if (this.root_.classList.contains(MODAL)) {
  10766. return new __WEBPACK_IMPORTED_MODULE_2__modal_foundation__["a" /* default */](adapter);
  10767. } else {
  10768. throw new Error('MDCDrawer: Failed to instantiate component. Supported variants are ' + DISMISSIBLE + ' and ' + MODAL + '.');
  10769. }
  10770. }
  10771. }, {
  10772. key: 'open',
  10773. /**
  10774. * Returns true if drawer is in the open position.
  10775. * @return {boolean}
  10776. */
  10777. get: function get() {
  10778. return this.foundation_.isOpen();
  10779. }
  10780. /**
  10781. * Toggles the drawer open and closed.
  10782. * @param {boolean} isOpen
  10783. */
  10784. ,
  10785. set: function set(isOpen) {
  10786. if (isOpen) {
  10787. this.foundation_.open();
  10788. } else {
  10789. this.foundation_.close();
  10790. }
  10791. }
  10792. }], [{
  10793. key: 'attachTo',
  10794. value: function attachTo(root) {
  10795. return new MDCDrawer(root);
  10796. }
  10797. }]);
  10798. return MDCDrawer;
  10799. }(__WEBPACK_IMPORTED_MODULE_0__material_base_index__["MDCComponent"]);
  10800. /***/ }),
  10801. /* 75 */
  10802. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10803. "use strict";
  10804. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__adapter__ = __webpack_require__(13);
  10805. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__dismissible_foundation__ = __webpack_require__(30);
  10806. 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; }; }();
  10807. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  10808. 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; }
  10809. 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; }
  10810. /**
  10811. * @license
  10812. * Copyright 2018 Google Inc.
  10813. *
  10814. * Permission is hereby granted, free of charge, to any person obtaining a copy
  10815. * of this software and associated documentation files (the "Software"), to deal
  10816. * in the Software without restriction, including without limitation the rights
  10817. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10818. * copies of the Software, and to permit persons to whom the Software is
  10819. * furnished to do so, subject to the following conditions:
  10820. *
  10821. * The above copyright notice and this permission notice shall be included in
  10822. * all copies or substantial portions of the Software.
  10823. *
  10824. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  10825. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  10826. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  10827. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  10828. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  10829. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  10830. * THE SOFTWARE.
  10831. */
  10832. /**
  10833. * @extends {MDCDismissibleDrawerFoundation<!MDCDrawerAdapter>}
  10834. */
  10835. var MDCModalDrawerFoundation = function (_MDCDismissibleDrawer) {
  10836. _inherits(MDCModalDrawerFoundation, _MDCDismissibleDrawer);
  10837. function MDCModalDrawerFoundation() {
  10838. _classCallCheck(this, MDCModalDrawerFoundation);
  10839. return _possibleConstructorReturn(this, (MDCModalDrawerFoundation.__proto__ || Object.getPrototypeOf(MDCModalDrawerFoundation)).apply(this, arguments));
  10840. }
  10841. _createClass(MDCModalDrawerFoundation, [{
  10842. key: 'opened',
  10843. /**
  10844. * Called when drawer finishes open animation.
  10845. * @override
  10846. */
  10847. value: function opened() {
  10848. this.adapter_.trapFocus();
  10849. }
  10850. /**
  10851. * Called when drawer finishes close animation.
  10852. * @override
  10853. */
  10854. }, {
  10855. key: 'closed',
  10856. value: function closed() {
  10857. this.adapter_.releaseFocus();
  10858. }
  10859. /**
  10860. * Handles click event on scrim.
  10861. */
  10862. }, {
  10863. key: 'handleScrimClick',
  10864. value: function handleScrimClick() {
  10865. this.close();
  10866. }
  10867. }]);
  10868. return MDCModalDrawerFoundation;
  10869. }(__WEBPACK_IMPORTED_MODULE_1__dismissible_foundation__["a" /* default */]);
  10870. /* harmony default export */ __webpack_exports__["a"] = (MDCModalDrawerFoundation);
  10871. /***/ }),
  10872. /* 76 */
  10873. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10874. "use strict";
  10875. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  10876. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFocusTrapInstance", function() { return createFocusTrapInstance; });
  10877. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_focus_trap__ = __webpack_require__(34);
  10878. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_focus_trap___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_focus_trap__);
  10879. /**
  10880. * @license
  10881. * Copyright 2016 Google Inc.
  10882. *
  10883. * Permission is hereby granted, free of charge, to any person obtaining a copy
  10884. * of this software and associated documentation files (the "Software"), to deal
  10885. * in the Software without restriction, including without limitation the rights
  10886. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10887. * copies of the Software, and to permit persons to whom the Software is
  10888. * furnished to do so, subject to the following conditions:
  10889. *
  10890. * The above copyright notice and this permission notice shall be included in
  10891. * all copies or substantial portions of the Software.
  10892. *
  10893. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  10894. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  10895. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  10896. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  10897. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  10898. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  10899. * THE SOFTWARE.
  10900. */
  10901. /**
  10902. * @param {!Element} surfaceEl
  10903. * @param {!Function} focusTrapFactory
  10904. * @return {!FocusTrapInstance}
  10905. */
  10906. function createFocusTrapInstance(surfaceEl) {
  10907. var focusTrapFactory = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : __WEBPACK_IMPORTED_MODULE_0_focus_trap___default.a;
  10908. return focusTrapFactory(surfaceEl, {
  10909. clickOutsideDeactivates: true,
  10910. initialFocus: false, // Navigation drawer handles focusing on active nav item.
  10911. escapeDeactivates: false, // Navigation drawer handles ESC.
  10912. returnFocusOnDeactivate: false });
  10913. }
  10914. /***/ }),
  10915. /* 77 */
  10916. /***/ (function(module, exports) {
  10917. var candidateSelectors = [
  10918. 'input',
  10919. 'select',
  10920. 'textarea',
  10921. 'a[href]',
  10922. 'button',
  10923. '[tabindex]',
  10924. 'audio[controls]',
  10925. 'video[controls]',
  10926. '[contenteditable]:not([contenteditable="false"])',
  10927. ];
  10928. var candidateSelector = candidateSelectors.join(',');
  10929. var matches = Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
  10930. function tabbable(el, options) {
  10931. options = options || {};
  10932. var elementDocument = el.ownerDocument || el;
  10933. var regularTabbables = [];
  10934. var orderedTabbables = [];
  10935. var untouchabilityChecker = new UntouchabilityChecker(elementDocument);
  10936. var candidates = el.querySelectorAll(candidateSelector);
  10937. if (options.includeContainer) {
  10938. if (matches.call(el, candidateSelector)) {
  10939. candidates = Array.prototype.slice.apply(candidates);
  10940. candidates.unshift(el);
  10941. }
  10942. }
  10943. var i, candidate, candidateTabindex;
  10944. for (i = 0; i < candidates.length; i++) {
  10945. candidate = candidates[i];
  10946. if (!isNodeMatchingSelectorTabbable(candidate, untouchabilityChecker)) continue;
  10947. candidateTabindex = getTabindex(candidate);
  10948. if (candidateTabindex === 0) {
  10949. regularTabbables.push(candidate);
  10950. } else {
  10951. orderedTabbables.push({
  10952. documentOrder: i,
  10953. tabIndex: candidateTabindex,
  10954. node: candidate,
  10955. });
  10956. }
  10957. }
  10958. var tabbableNodes = orderedTabbables
  10959. .sort(sortOrderedTabbables)
  10960. .map(function(a) { return a.node })
  10961. .concat(regularTabbables);
  10962. return tabbableNodes;
  10963. }
  10964. tabbable.isTabbable = isTabbable;
  10965. tabbable.isFocusable = isFocusable;
  10966. function isNodeMatchingSelectorTabbable(node, untouchabilityChecker) {
  10967. if (
  10968. !isNodeMatchingSelectorFocusable(node, untouchabilityChecker)
  10969. || isNonTabbableRadio(node)
  10970. || getTabindex(node) < 0
  10971. ) {
  10972. return false;
  10973. }
  10974. return true;
  10975. }
  10976. function isTabbable(node, untouchabilityChecker) {
  10977. if (!node) throw new Error('No node provided');
  10978. if (matches.call(node, candidateSelector) === false) return false;
  10979. return isNodeMatchingSelectorTabbable(node, untouchabilityChecker);
  10980. }
  10981. function isNodeMatchingSelectorFocusable(node, untouchabilityChecker) {
  10982. untouchabilityChecker = untouchabilityChecker || new UntouchabilityChecker(node.ownerDocument || node);
  10983. if (
  10984. node.disabled
  10985. || isHiddenInput(node)
  10986. || untouchabilityChecker.isUntouchable(node)
  10987. ) {
  10988. return false;
  10989. }
  10990. return true;
  10991. }
  10992. var focusableCandidateSelector = candidateSelectors.concat('iframe').join(',');
  10993. function isFocusable(node, untouchabilityChecker) {
  10994. if (!node) throw new Error('No node provided');
  10995. if (matches.call(node, focusableCandidateSelector) === false) return false;
  10996. return isNodeMatchingSelectorFocusable(node, untouchabilityChecker);
  10997. }
  10998. function getTabindex(node) {
  10999. var tabindexAttr = parseInt(node.getAttribute('tabindex'), 10);
  11000. if (!isNaN(tabindexAttr)) return tabindexAttr;
  11001. // Browsers do not return `tabIndex` correctly for contentEditable nodes;
  11002. // so if they don't have a tabindex attribute specifically set, assume it's 0.
  11003. if (isContentEditable(node)) return 0;
  11004. return node.tabIndex;
  11005. }
  11006. function sortOrderedTabbables(a, b) {
  11007. return a.tabIndex === b.tabIndex ? a.documentOrder - b.documentOrder : a.tabIndex - b.tabIndex;
  11008. }
  11009. // Array.prototype.find not available in IE.
  11010. function find(list, predicate) {
  11011. for (var i = 0, length = list.length; i < length; i++) {
  11012. if (predicate(list[i])) return list[i];
  11013. }
  11014. }
  11015. function isContentEditable(node) {
  11016. return node.contentEditable === 'true';
  11017. }
  11018. function isInput(node) {
  11019. return node.tagName === 'INPUT';
  11020. }
  11021. function isHiddenInput(node) {
  11022. return isInput(node) && node.type === 'hidden';
  11023. }
  11024. function isRadio(node) {
  11025. return isInput(node) && node.type === 'radio';
  11026. }
  11027. function isNonTabbableRadio(node) {
  11028. return isRadio(node) && !isTabbableRadio(node);
  11029. }
  11030. function getCheckedRadio(nodes) {
  11031. for (var i = 0; i < nodes.length; i++) {
  11032. if (nodes[i].checked) {
  11033. return nodes[i];
  11034. }
  11035. }
  11036. }
  11037. function isTabbableRadio(node) {
  11038. if (!node.name) return true;
  11039. // This won't account for the edge case where you have radio groups with the same
  11040. // in separate forms on the same page.
  11041. var radioSet = node.ownerDocument.querySelectorAll('input[type="radio"][name="' + node.name + '"]');
  11042. var checked = getCheckedRadio(radioSet);
  11043. return !checked || checked === node;
  11044. }
  11045. // An element is "untouchable" if *it or one of its ancestors* has
  11046. // `visibility: hidden` or `display: none`.
  11047. function UntouchabilityChecker(elementDocument) {
  11048. this.doc = elementDocument;
  11049. // Node cache must be refreshed on every check, in case
  11050. // the content of the element has changed. The cache contains tuples
  11051. // mapping nodes to their boolean result.
  11052. this.cache = [];
  11053. }
  11054. // getComputedStyle accurately reflects `visibility: hidden` of ancestors
  11055. // but not `display: none`, so we need to recursively check parents.
  11056. UntouchabilityChecker.prototype.hasDisplayNone = function hasDisplayNone(node, nodeComputedStyle) {
  11057. if (node === this.doc.documentElement) return false;
  11058. // Search for a cached result.
  11059. var cached = find(this.cache, function(item) {
  11060. return item === node;
  11061. });
  11062. if (cached) return cached[1];
  11063. nodeComputedStyle = nodeComputedStyle || this.doc.defaultView.getComputedStyle(node);
  11064. var result = false;
  11065. if (nodeComputedStyle.display === 'none') {
  11066. result = true;
  11067. } else if (node.parentNode) {
  11068. result = this.hasDisplayNone(node.parentNode);
  11069. }
  11070. this.cache.push([node, result]);
  11071. return result;
  11072. }
  11073. UntouchabilityChecker.prototype.isUntouchable = function isUntouchable(node) {
  11074. if (node === this.doc.documentElement) return false;
  11075. var computedStyle = this.doc.defaultView.getComputedStyle(node);
  11076. if (this.hasDisplayNone(node, computedStyle)) return true;
  11077. return computedStyle.visibility === 'hidden';
  11078. }
  11079. module.exports = tabbable;
  11080. /***/ }),
  11081. /* 78 */
  11082. /***/ (function(module, exports) {
  11083. module.exports = extend
  11084. var hasOwnProperty = Object.prototype.hasOwnProperty;
  11085. function extend() {
  11086. var target = {}
  11087. for (var i = 0; i < arguments.length; i++) {
  11088. var source = arguments[i]
  11089. for (var key in source) {
  11090. if (hasOwnProperty.call(source, key)) {
  11091. target[key] = source[key]
  11092. }
  11093. }
  11094. }
  11095. return target
  11096. }
  11097. /***/ }),
  11098. /* 79 */
  11099. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11100. "use strict";
  11101. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  11102. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(35);
  11103. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(80);
  11104. 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; };
  11105. 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; }; }();
  11106. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11107. 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; }
  11108. 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; }
  11109. /**
  11110. * @license
  11111. * Copyright 2016 Google Inc.
  11112. *
  11113. * Permission is hereby granted, free of charge, to any person obtaining a copy
  11114. * of this software and associated documentation files (the "Software"), to deal
  11115. * in the Software without restriction, including without limitation the rights
  11116. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  11117. * copies of the Software, and to permit persons to whom the Software is
  11118. * furnished to do so, subject to the following conditions:
  11119. *
  11120. * The above copyright notice and this permission notice shall be included in
  11121. * all copies or substantial portions of the Software.
  11122. *
  11123. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  11124. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  11125. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  11126. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  11127. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  11128. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  11129. * THE SOFTWARE.
  11130. */
  11131. /**
  11132. * @extends {MDCFoundation<!MDCFloatingLabelAdapter>}
  11133. * @final
  11134. */
  11135. var MDCFloatingLabelFoundation = function (_MDCFoundation) {
  11136. _inherits(MDCFloatingLabelFoundation, _MDCFoundation);
  11137. _createClass(MDCFloatingLabelFoundation, null, [{
  11138. key: 'cssClasses',
  11139. /** @return enum {string} */
  11140. get: function get() {
  11141. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  11142. }
  11143. /**
  11144. * {@see MDCFloatingLabelAdapter} for typing information on parameters and return
  11145. * types.
  11146. * @return {!MDCFloatingLabelAdapter}
  11147. */
  11148. }, {
  11149. key: 'defaultAdapter',
  11150. get: function get() {
  11151. return (/** @type {!MDCFloatingLabelAdapter} */{
  11152. addClass: function addClass() {},
  11153. removeClass: function removeClass() {},
  11154. getWidth: function getWidth() {},
  11155. registerInteractionHandler: function registerInteractionHandler() {},
  11156. deregisterInteractionHandler: function deregisterInteractionHandler() {}
  11157. }
  11158. );
  11159. }
  11160. /**
  11161. * @param {!MDCFloatingLabelAdapter} adapter
  11162. */
  11163. }]);
  11164. function MDCFloatingLabelFoundation(adapter) {
  11165. _classCallCheck(this, MDCFloatingLabelFoundation);
  11166. /** @private {function(!Event): undefined} */
  11167. var _this = _possibleConstructorReturn(this, (MDCFloatingLabelFoundation.__proto__ || Object.getPrototypeOf(MDCFloatingLabelFoundation)).call(this, _extends(MDCFloatingLabelFoundation.defaultAdapter, adapter)));
  11168. _this.shakeAnimationEndHandler_ = function () {
  11169. return _this.handleShakeAnimationEnd_();
  11170. };
  11171. return _this;
  11172. }
  11173. _createClass(MDCFloatingLabelFoundation, [{
  11174. key: 'init',
  11175. value: function init() {
  11176. this.adapter_.registerInteractionHandler('animationend', this.shakeAnimationEndHandler_);
  11177. }
  11178. }, {
  11179. key: 'destroy',
  11180. value: function destroy() {
  11181. this.adapter_.deregisterInteractionHandler('animationend', this.shakeAnimationEndHandler_);
  11182. }
  11183. /**
  11184. * Returns the width of the label element.
  11185. * @return {number}
  11186. */
  11187. }, {
  11188. key: 'getWidth',
  11189. value: function getWidth() {
  11190. return this.adapter_.getWidth();
  11191. }
  11192. /**
  11193. * Styles the label to produce the label shake for errors.
  11194. * @param {boolean} shouldShake adds shake class if true,
  11195. * otherwise removes shake class.
  11196. */
  11197. }, {
  11198. key: 'shake',
  11199. value: function shake(shouldShake) {
  11200. var LABEL_SHAKE = MDCFloatingLabelFoundation.cssClasses.LABEL_SHAKE;
  11201. if (shouldShake) {
  11202. this.adapter_.addClass(LABEL_SHAKE);
  11203. } else {
  11204. this.adapter_.removeClass(LABEL_SHAKE);
  11205. }
  11206. }
  11207. /**
  11208. * Styles the label to float or dock.
  11209. * @param {boolean} shouldFloat adds float class if true, otherwise remove
  11210. * float and shake class to dock label.
  11211. */
  11212. }, {
  11213. key: 'float',
  11214. value: function float(shouldFloat) {
  11215. var _MDCFloatingLabelFoun = MDCFloatingLabelFoundation.cssClasses,
  11216. LABEL_FLOAT_ABOVE = _MDCFloatingLabelFoun.LABEL_FLOAT_ABOVE,
  11217. LABEL_SHAKE = _MDCFloatingLabelFoun.LABEL_SHAKE;
  11218. if (shouldFloat) {
  11219. this.adapter_.addClass(LABEL_FLOAT_ABOVE);
  11220. } else {
  11221. this.adapter_.removeClass(LABEL_FLOAT_ABOVE);
  11222. this.adapter_.removeClass(LABEL_SHAKE);
  11223. }
  11224. }
  11225. /**
  11226. * Handles an interaction event on the root element.
  11227. */
  11228. }, {
  11229. key: 'handleShakeAnimationEnd_',
  11230. value: function handleShakeAnimationEnd_() {
  11231. var LABEL_SHAKE = MDCFloatingLabelFoundation.cssClasses.LABEL_SHAKE;
  11232. this.adapter_.removeClass(LABEL_SHAKE);
  11233. }
  11234. }]);
  11235. return MDCFloatingLabelFoundation;
  11236. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  11237. /* harmony default export */ __webpack_exports__["a"] = (MDCFloatingLabelFoundation);
  11238. /***/ }),
  11239. /* 80 */
  11240. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11241. "use strict";
  11242. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  11243. /**
  11244. * @license
  11245. * Copyright 2016 Google Inc.
  11246. *
  11247. * Permission is hereby granted, free of charge, to any person obtaining a copy
  11248. * of this software and associated documentation files (the "Software"), to deal
  11249. * in the Software without restriction, including without limitation the rights
  11250. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  11251. * copies of the Software, and to permit persons to whom the Software is
  11252. * furnished to do so, subject to the following conditions:
  11253. *
  11254. * The above copyright notice and this permission notice shall be included in
  11255. * all copies or substantial portions of the Software.
  11256. *
  11257. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  11258. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  11259. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  11260. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  11261. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  11262. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  11263. * THE SOFTWARE.
  11264. */
  11265. /** @enum {string} */
  11266. var cssClasses = {
  11267. LABEL_FLOAT_ABOVE: 'mdc-floating-label--float-above',
  11268. LABEL_SHAKE: 'mdc-floating-label--shake'
  11269. };
  11270. /***/ }),
  11271. /* 81 */
  11272. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11273. "use strict";
  11274. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  11275. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCFormField", function() { return MDCFormField; });
  11276. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  11277. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(82);
  11278. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_selection_control_index__ = __webpack_require__(4);
  11279. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCFormFieldFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__foundation__["a"]; });
  11280. 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; }; }();
  11281. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11282. 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; }
  11283. 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; }
  11284. /**
  11285. * @license
  11286. * Copyright 2017 Google Inc.
  11287. *
  11288. * Permission is hereby granted, free of charge, to any person obtaining a copy
  11289. * of this software and associated documentation files (the "Software"), to deal
  11290. * in the Software without restriction, including without limitation the rights
  11291. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  11292. * copies of the Software, and to permit persons to whom the Software is
  11293. * furnished to do so, subject to the following conditions:
  11294. *
  11295. * The above copyright notice and this permission notice shall be included in
  11296. * all copies or substantial portions of the Software.
  11297. *
  11298. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  11299. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  11300. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  11301. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  11302. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  11303. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  11304. * THE SOFTWARE.
  11305. */
  11306. /* eslint-disable no-unused-vars */
  11307. /* eslint-enable no-unused-vars */
  11308. /**
  11309. * @extends MDCComponent<!MDCFormFieldFoundation>
  11310. */
  11311. var MDCFormField = function (_MDCComponent) {
  11312. _inherits(MDCFormField, _MDCComponent);
  11313. _createClass(MDCFormField, [{
  11314. key: 'input',
  11315. /** @param {?MDCSelectionControl} input */
  11316. set: function set(input) {
  11317. this.input_ = input;
  11318. }
  11319. /** @return {?MDCSelectionControl} */
  11320. ,
  11321. get: function get() {
  11322. return this.input_;
  11323. }
  11324. }], [{
  11325. key: 'attachTo',
  11326. value: function attachTo(root) {
  11327. return new MDCFormField(root);
  11328. }
  11329. }]);
  11330. function MDCFormField() {
  11331. var _ref;
  11332. _classCallCheck(this, MDCFormField);
  11333. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  11334. args[_key] = arguments[_key];
  11335. }
  11336. /** @private {?MDCSelectionControl} */
  11337. var _this = _possibleConstructorReturn(this, (_ref = MDCFormField.__proto__ || Object.getPrototypeOf(MDCFormField)).call.apply(_ref, [this].concat(args)));
  11338. _this.input_;
  11339. return _this;
  11340. }
  11341. /**
  11342. * @return {!Element}
  11343. * @private
  11344. */
  11345. _createClass(MDCFormField, [{
  11346. key: 'getDefaultFoundation',
  11347. /** @return {!MDCFormFieldFoundation} */
  11348. value: function getDefaultFoundation() {
  11349. var _this2 = this;
  11350. return new __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]({
  11351. registerInteractionHandler: function registerInteractionHandler(type, handler) {
  11352. return _this2.label_.addEventListener(type, handler);
  11353. },
  11354. deregisterInteractionHandler: function deregisterInteractionHandler(type, handler) {
  11355. return _this2.label_.removeEventListener(type, handler);
  11356. },
  11357. activateInputRipple: function activateInputRipple() {
  11358. if (_this2.input_ && _this2.input_.ripple) {
  11359. _this2.input_.ripple.activate();
  11360. }
  11361. },
  11362. deactivateInputRipple: function deactivateInputRipple() {
  11363. if (_this2.input_ && _this2.input_.ripple) {
  11364. _this2.input_.ripple.deactivate();
  11365. }
  11366. }
  11367. });
  11368. }
  11369. }, {
  11370. key: 'label_',
  11371. get: function get() {
  11372. var LABEL_SELECTOR = __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.LABEL_SELECTOR;
  11373. return (/** @type {!Element} */this.root_.querySelector(LABEL_SELECTOR)
  11374. );
  11375. }
  11376. }]);
  11377. return MDCFormField;
  11378. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  11379. /***/ }),
  11380. /* 82 */
  11381. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11382. "use strict";
  11383. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  11384. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(83);
  11385. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(84);
  11386. 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; };
  11387. 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; }; }();
  11388. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11389. 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; }
  11390. 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; }
  11391. /**
  11392. * @license
  11393. * Copyright 2017 Google Inc.
  11394. *
  11395. * Permission is hereby granted, free of charge, to any person obtaining a copy
  11396. * of this software and associated documentation files (the "Software"), to deal
  11397. * in the Software without restriction, including without limitation the rights
  11398. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  11399. * copies of the Software, and to permit persons to whom the Software is
  11400. * furnished to do so, subject to the following conditions:
  11401. *
  11402. * The above copyright notice and this permission notice shall be included in
  11403. * all copies or substantial portions of the Software.
  11404. *
  11405. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  11406. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  11407. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  11408. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  11409. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  11410. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  11411. * THE SOFTWARE.
  11412. */
  11413. /**
  11414. * @extends {MDCFoundation<!MDCFormFieldAdapter>}
  11415. */
  11416. var MDCFormFieldFoundation = function (_MDCFoundation) {
  11417. _inherits(MDCFormFieldFoundation, _MDCFoundation);
  11418. _createClass(MDCFormFieldFoundation, null, [{
  11419. key: 'cssClasses',
  11420. /** @return enum {cssClasses} */
  11421. get: function get() {
  11422. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  11423. }
  11424. /** @return enum {strings} */
  11425. }, {
  11426. key: 'strings',
  11427. get: function get() {
  11428. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  11429. }
  11430. /** @return {!MDCFormFieldAdapter} */
  11431. }, {
  11432. key: 'defaultAdapter',
  11433. get: function get() {
  11434. return {
  11435. registerInteractionHandler: function registerInteractionHandler() /* type: string, handler: EventListener */{},
  11436. deregisterInteractionHandler: function deregisterInteractionHandler() /* type: string, handler: EventListener */{},
  11437. activateInputRipple: function activateInputRipple() {},
  11438. deactivateInputRipple: function deactivateInputRipple() {}
  11439. };
  11440. }
  11441. }]);
  11442. function MDCFormFieldFoundation(adapter) {
  11443. _classCallCheck(this, MDCFormFieldFoundation);
  11444. /** @private {!EventListener} */
  11445. var _this = _possibleConstructorReturn(this, (MDCFormFieldFoundation.__proto__ || Object.getPrototypeOf(MDCFormFieldFoundation)).call(this, _extends(MDCFormFieldFoundation.defaultAdapter, adapter)));
  11446. _this.clickHandler_ = /** @type {!EventListener} */function () {
  11447. return _this.handleClick_();
  11448. };
  11449. return _this;
  11450. }
  11451. _createClass(MDCFormFieldFoundation, [{
  11452. key: 'init',
  11453. value: function init() {
  11454. this.adapter_.registerInteractionHandler('click', this.clickHandler_);
  11455. }
  11456. }, {
  11457. key: 'destroy',
  11458. value: function destroy() {
  11459. this.adapter_.deregisterInteractionHandler('click', this.clickHandler_);
  11460. }
  11461. /** @private */
  11462. }, {
  11463. key: 'handleClick_',
  11464. value: function handleClick_() {
  11465. var _this2 = this;
  11466. this.adapter_.activateInputRipple();
  11467. requestAnimationFrame(function () {
  11468. return _this2.adapter_.deactivateInputRipple();
  11469. });
  11470. }
  11471. }]);
  11472. return MDCFormFieldFoundation;
  11473. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  11474. /* harmony default export */ __webpack_exports__["a"] = (MDCFormFieldFoundation);
  11475. /***/ }),
  11476. /* 83 */
  11477. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11478. "use strict";
  11479. 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; }; }();
  11480. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11481. /**
  11482. * @license
  11483. * Copyright 2016 Google Inc.
  11484. *
  11485. * Permission is hereby granted, free of charge, to any person obtaining a copy
  11486. * of this software and associated documentation files (the "Software"), to deal
  11487. * in the Software without restriction, including without limitation the rights
  11488. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  11489. * copies of the Software, and to permit persons to whom the Software is
  11490. * furnished to do so, subject to the following conditions:
  11491. *
  11492. * The above copyright notice and this permission notice shall be included in
  11493. * all copies or substantial portions of the Software.
  11494. *
  11495. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  11496. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  11497. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  11498. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  11499. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  11500. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  11501. * THE SOFTWARE.
  11502. */
  11503. /* eslint no-unused-vars: [2, {"args": "none"}] */
  11504. /**
  11505. * Adapter for MDC Form Field. Provides an interface for managing
  11506. * - event handlers
  11507. * - ripple activation
  11508. *
  11509. * Additionally, provides type information for the adapter to the Closure
  11510. * compiler.
  11511. *
  11512. * Implement this adapter for your framework of choice to delegate updates to
  11513. * the component in your framework of choice. See architecture documentation
  11514. * for more details.
  11515. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  11516. *
  11517. * @record
  11518. */
  11519. var MDCFormFieldAdapter = function () {
  11520. function MDCFormFieldAdapter() {
  11521. _classCallCheck(this, MDCFormFieldAdapter);
  11522. }
  11523. _createClass(MDCFormFieldAdapter, [{
  11524. key: "registerInteractionHandler",
  11525. /**
  11526. * @param {string} type
  11527. * @param {!EventListener} handler
  11528. */
  11529. value: function registerInteractionHandler(type, handler) {}
  11530. /**
  11531. * @param {string} type
  11532. * @param {!EventListener} handler
  11533. */
  11534. }, {
  11535. key: "deregisterInteractionHandler",
  11536. value: function deregisterInteractionHandler(type, handler) {}
  11537. }, {
  11538. key: "activateInputRipple",
  11539. value: function activateInputRipple() {}
  11540. }, {
  11541. key: "deactivateInputRipple",
  11542. value: function deactivateInputRipple() {}
  11543. }]);
  11544. return MDCFormFieldAdapter;
  11545. }();
  11546. /* unused harmony default export */ var _unused_webpack_default_export = (MDCFormFieldAdapter);
  11547. /***/ }),
  11548. /* 84 */
  11549. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11550. "use strict";
  11551. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  11552. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  11553. /**
  11554. * @license
  11555. * Copyright 2017 Google Inc.
  11556. *
  11557. * Permission is hereby granted, free of charge, to any person obtaining a copy
  11558. * of this software and associated documentation files (the "Software"), to deal
  11559. * in the Software without restriction, including without limitation the rights
  11560. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  11561. * copies of the Software, and to permit persons to whom the Software is
  11562. * furnished to do so, subject to the following conditions:
  11563. *
  11564. * The above copyright notice and this permission notice shall be included in
  11565. * all copies or substantial portions of the Software.
  11566. *
  11567. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  11568. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  11569. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  11570. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  11571. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  11572. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  11573. * THE SOFTWARE.
  11574. */
  11575. /** @enum {string} */
  11576. var cssClasses = {
  11577. ROOT: 'mdc-form-field'
  11578. };
  11579. /** @enum {string} */
  11580. var strings = {
  11581. LABEL_SELECTOR: '.mdc-form-field > label'
  11582. };
  11583. /***/ }),
  11584. /* 85 */
  11585. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11586. "use strict";
  11587. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  11588. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCGridList", function() { return MDCGridList; });
  11589. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_index__ = __webpack_require__(3);
  11590. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(86);
  11591. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCGridListFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__foundation__["a"]; });
  11592. 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; }; }();
  11593. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11594. 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; }
  11595. 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; }
  11596. /**
  11597. * @license
  11598. * Copyright 2016 Google Inc.
  11599. *
  11600. * Permission is hereby granted, free of charge, to any person obtaining a copy
  11601. * of this software and associated documentation files (the "Software"), to deal
  11602. * in the Software without restriction, including without limitation the rights
  11603. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  11604. * copies of the Software, and to permit persons to whom the Software is
  11605. * furnished to do so, subject to the following conditions:
  11606. *
  11607. * The above copyright notice and this permission notice shall be included in
  11608. * all copies or substantial portions of the Software.
  11609. *
  11610. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  11611. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  11612. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  11613. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  11614. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  11615. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  11616. * THE SOFTWARE.
  11617. */
  11618. var MDCGridList = function (_MDCComponent) {
  11619. _inherits(MDCGridList, _MDCComponent);
  11620. function MDCGridList() {
  11621. _classCallCheck(this, MDCGridList);
  11622. return _possibleConstructorReturn(this, (MDCGridList.__proto__ || Object.getPrototypeOf(MDCGridList)).apply(this, arguments));
  11623. }
  11624. _createClass(MDCGridList, [{
  11625. key: 'getDefaultFoundation',
  11626. value: function getDefaultFoundation() {
  11627. var _this2 = this;
  11628. return new __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]({
  11629. getOffsetWidth: function getOffsetWidth() {
  11630. return _this2.root_.offsetWidth;
  11631. },
  11632. getNumberOfTiles: function getNumberOfTiles() {
  11633. return _this2.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.TILE_SELECTOR).length;
  11634. },
  11635. getOffsetWidthForTileAtIndex: function getOffsetWidthForTileAtIndex(index) {
  11636. return _this2.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.TILE_SELECTOR)[index].offsetWidth;
  11637. },
  11638. setStyleForTilesElement: function setStyleForTilesElement(property, value) {
  11639. _this2.root_.querySelector(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.TILES_SELECTOR).style[property] = value;
  11640. },
  11641. registerResizeHandler: function registerResizeHandler(handler) {
  11642. return window.addEventListener('resize', handler);
  11643. },
  11644. deregisterResizeHandler: function deregisterResizeHandler(handler) {
  11645. return window.removeEventListener('resize', handler);
  11646. }
  11647. });
  11648. }
  11649. }], [{
  11650. key: 'attachTo',
  11651. value: function attachTo(root) {
  11652. return new MDCGridList(root);
  11653. }
  11654. }]);
  11655. return MDCGridList;
  11656. }(__WEBPACK_IMPORTED_MODULE_0__material_base_index__["MDCComponent"]);
  11657. /***/ }),
  11658. /* 86 */
  11659. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11660. "use strict";
  11661. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_index__ = __webpack_require__(3);
  11662. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(87);
  11663. 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; };
  11664. 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; }; }();
  11665. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11666. 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; }
  11667. 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; }
  11668. /**
  11669. * @license
  11670. * Copyright 2016 Google Inc.
  11671. *
  11672. * Permission is hereby granted, free of charge, to any person obtaining a copy
  11673. * of this software and associated documentation files (the "Software"), to deal
  11674. * in the Software without restriction, including without limitation the rights
  11675. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  11676. * copies of the Software, and to permit persons to whom the Software is
  11677. * furnished to do so, subject to the following conditions:
  11678. *
  11679. * The above copyright notice and this permission notice shall be included in
  11680. * all copies or substantial portions of the Software.
  11681. *
  11682. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  11683. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  11684. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  11685. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  11686. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  11687. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  11688. * THE SOFTWARE.
  11689. */
  11690. var MDCGridListFoundation = function (_MDCFoundation) {
  11691. _inherits(MDCGridListFoundation, _MDCFoundation);
  11692. _createClass(MDCGridListFoundation, null, [{
  11693. key: 'strings',
  11694. get: function get() {
  11695. return __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* strings */];
  11696. }
  11697. }, {
  11698. key: 'defaultAdapter',
  11699. get: function get() {
  11700. return {
  11701. getOffsetWidth: function getOffsetWidth() {
  11702. return (/* number */0
  11703. );
  11704. },
  11705. getNumberOfTiles: function getNumberOfTiles() {
  11706. return (/* number */0
  11707. );
  11708. },
  11709. getOffsetWidthForTileAtIndex: function getOffsetWidthForTileAtIndex() {
  11710. return (/* index: number */ /* number */0
  11711. );
  11712. },
  11713. setStyleForTilesElement: function setStyleForTilesElement() /* property: string, value: string */{},
  11714. registerResizeHandler: function registerResizeHandler() /* handler: EventListener */{},
  11715. deregisterResizeHandler: function deregisterResizeHandler() /* handler: EventListener */{}
  11716. };
  11717. }
  11718. }]);
  11719. function MDCGridListFoundation(adapter) {
  11720. _classCallCheck(this, MDCGridListFoundation);
  11721. var _this = _possibleConstructorReturn(this, (MDCGridListFoundation.__proto__ || Object.getPrototypeOf(MDCGridListFoundation)).call(this, _extends(MDCGridListFoundation.defaultAdapter, adapter)));
  11722. _this.resizeHandler_ = function () {
  11723. return _this.alignCenter();
  11724. };
  11725. _this.resizeFrame_ = 0;
  11726. return _this;
  11727. }
  11728. _createClass(MDCGridListFoundation, [{
  11729. key: 'init',
  11730. value: function init() {
  11731. this.alignCenter();
  11732. this.adapter_.registerResizeHandler(this.resizeHandler_);
  11733. }
  11734. }, {
  11735. key: 'destroy',
  11736. value: function destroy() {
  11737. this.adapter_.deregisterResizeHandler(this.resizeHandler_);
  11738. }
  11739. }, {
  11740. key: 'alignCenter',
  11741. value: function alignCenter() {
  11742. var _this2 = this;
  11743. if (this.resizeFrame_ !== 0) {
  11744. cancelAnimationFrame(this.resizeFrame_);
  11745. }
  11746. this.resizeFrame_ = requestAnimationFrame(function () {
  11747. _this2.alignCenter_();
  11748. _this2.resizeFrame_ = 0;
  11749. });
  11750. }
  11751. }, {
  11752. key: 'alignCenter_',
  11753. value: function alignCenter_() {
  11754. if (this.adapter_.getNumberOfTiles() == 0) {
  11755. return;
  11756. }
  11757. var gridWidth = this.adapter_.getOffsetWidth();
  11758. var itemWidth = this.adapter_.getOffsetWidthForTileAtIndex(0);
  11759. var tilesWidth = itemWidth * Math.floor(gridWidth / itemWidth);
  11760. this.adapter_.setStyleForTilesElement('width', tilesWidth + 'px');
  11761. }
  11762. }]);
  11763. return MDCGridListFoundation;
  11764. }(__WEBPACK_IMPORTED_MODULE_0__material_base_index__["MDCFoundation"]);
  11765. /* harmony default export */ __webpack_exports__["a"] = (MDCGridListFoundation);
  11766. /***/ }),
  11767. /* 87 */
  11768. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11769. "use strict";
  11770. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return strings; });
  11771. /**
  11772. * @license
  11773. * Copyright 2016 Google Inc.
  11774. *
  11775. * Permission is hereby granted, free of charge, to any person obtaining a copy
  11776. * of this software and associated documentation files (the "Software"), to deal
  11777. * in the Software without restriction, including without limitation the rights
  11778. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  11779. * copies of the Software, and to permit persons to whom the Software is
  11780. * furnished to do so, subject to the following conditions:
  11781. *
  11782. * The above copyright notice and this permission notice shall be included in
  11783. * all copies or substantial portions of the Software.
  11784. *
  11785. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  11786. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  11787. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  11788. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  11789. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  11790. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  11791. * THE SOFTWARE.
  11792. */
  11793. var strings = {
  11794. TILES_SELECTOR: '.mdc-grid-list__tiles',
  11795. TILE_SELECTOR: '.mdc-grid-tile'
  11796. };
  11797. /***/ }),
  11798. /* 88 */
  11799. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11800. "use strict";
  11801. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  11802. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCIconButtonToggle", function() { return MDCIconButtonToggle; });
  11803. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  11804. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(89);
  11805. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_ripple_index__ = __webpack_require__(2);
  11806. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCIconButtonToggleFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__foundation__["a"]; });
  11807. 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); } };
  11808. 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; }; }();
  11809. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11810. 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; }
  11811. 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; }
  11812. /**
  11813. * @license
  11814. * Copyright 2018 Google Inc.
  11815. *
  11816. * Permission is hereby granted, free of charge, to any person obtaining a copy
  11817. * of this software and associated documentation files (the "Software"), to deal
  11818. * in the Software without restriction, including without limitation the rights
  11819. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  11820. * copies of the Software, and to permit persons to whom the Software is
  11821. * furnished to do so, subject to the following conditions:
  11822. *
  11823. * The above copyright notice and this permission notice shall be included in
  11824. * all copies or substantial portions of the Software.
  11825. *
  11826. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  11827. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  11828. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  11829. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  11830. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  11831. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  11832. * THE SOFTWARE.
  11833. */
  11834. /**
  11835. * @extends {MDCComponent<!MDCIconButtonToggleFoundation>}
  11836. */
  11837. var MDCIconButtonToggle = function (_MDCComponent) {
  11838. _inherits(MDCIconButtonToggle, _MDCComponent);
  11839. _createClass(MDCIconButtonToggle, null, [{
  11840. key: 'attachTo',
  11841. value: function attachTo(root) {
  11842. return new MDCIconButtonToggle(root);
  11843. }
  11844. }]);
  11845. function MDCIconButtonToggle() {
  11846. var _ref;
  11847. _classCallCheck(this, MDCIconButtonToggle);
  11848. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  11849. args[_key] = arguments[_key];
  11850. }
  11851. /** @private {!MDCRipple} */
  11852. var _this = _possibleConstructorReturn(this, (_ref = MDCIconButtonToggle.__proto__ || Object.getPrototypeOf(MDCIconButtonToggle)).call.apply(_ref, [this].concat(args)));
  11853. _this.ripple_ = _this.initRipple_();
  11854. /** @private {!Function} */
  11855. _this.handleClick_;
  11856. return _this;
  11857. }
  11858. /**
  11859. * @return {!MDCRipple}
  11860. * @private
  11861. */
  11862. _createClass(MDCIconButtonToggle, [{
  11863. key: 'initRipple_',
  11864. value: function initRipple_() {
  11865. var ripple = new __WEBPACK_IMPORTED_MODULE_2__material_ripple_index__["MDCRipple"](this.root_);
  11866. ripple.unbounded = true;
  11867. return ripple;
  11868. }
  11869. }, {
  11870. key: 'destroy',
  11871. value: function destroy() {
  11872. this.root_.removeEventListener('click', this.handleClick_);
  11873. this.ripple_.destroy();
  11874. _get(MDCIconButtonToggle.prototype.__proto__ || Object.getPrototypeOf(MDCIconButtonToggle.prototype), 'destroy', this).call(this);
  11875. }
  11876. /** @return {!MDCIconButtonToggleFoundation} */
  11877. }, {
  11878. key: 'getDefaultFoundation',
  11879. value: function getDefaultFoundation() {
  11880. var _this2 = this;
  11881. return new __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]({
  11882. addClass: function addClass(className) {
  11883. return _this2.root_.classList.add(className);
  11884. },
  11885. removeClass: function removeClass(className) {
  11886. return _this2.root_.classList.remove(className);
  11887. },
  11888. hasClass: function hasClass(className) {
  11889. return _this2.root_.classList.contains(className);
  11890. },
  11891. setAttr: function setAttr(attrName, attrValue) {
  11892. return _this2.root_.setAttribute(attrName, attrValue);
  11893. },
  11894. notifyChange: function notifyChange(evtData) {
  11895. return _this2.emit(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.CHANGE_EVENT, evtData);
  11896. }
  11897. });
  11898. }
  11899. }, {
  11900. key: 'initialSyncWithDOM',
  11901. value: function initialSyncWithDOM() {
  11902. this.handleClick_ = this.foundation_.handleClick.bind(this.foundation_);
  11903. this.root_.addEventListener('click', this.handleClick_);
  11904. }
  11905. /** @return {!MDCRipple} */
  11906. }, {
  11907. key: 'ripple',
  11908. get: function get() {
  11909. return this.ripple_;
  11910. }
  11911. /** @return {boolean} */
  11912. }, {
  11913. key: 'on',
  11914. get: function get() {
  11915. return this.foundation_.isOn();
  11916. }
  11917. /** @param {boolean} isOn */
  11918. ,
  11919. set: function set(isOn) {
  11920. this.foundation_.toggle(isOn);
  11921. }
  11922. }]);
  11923. return MDCIconButtonToggle;
  11924. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  11925. /***/ }),
  11926. /* 89 */
  11927. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11928. "use strict";
  11929. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  11930. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(90);
  11931. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(91);
  11932. 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; };
  11933. 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; }; }();
  11934. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11935. 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; }
  11936. 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; }
  11937. /**
  11938. * @license
  11939. * Copyright 2018 Google Inc.
  11940. *
  11941. * Permission is hereby granted, free of charge, to any person obtaining a copy
  11942. * of this software and associated documentation files (the "Software"), to deal
  11943. * in the Software without restriction, including without limitation the rights
  11944. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  11945. * copies of the Software, and to permit persons to whom the Software is
  11946. * furnished to do so, subject to the following conditions:
  11947. *
  11948. * The above copyright notice and this permission notice shall be included in
  11949. * all copies or substantial portions of the Software.
  11950. *
  11951. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  11952. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  11953. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  11954. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  11955. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  11956. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  11957. * THE SOFTWARE.
  11958. */
  11959. /* eslint-disable no-unused-vars */
  11960. /**
  11961. * @extends {MDCFoundation<!MDCIconButtonToggleAdapter>}
  11962. */
  11963. var MDCIconButtonToggleFoundation = function (_MDCFoundation) {
  11964. _inherits(MDCIconButtonToggleFoundation, _MDCFoundation);
  11965. _createClass(MDCIconButtonToggleFoundation, null, [{
  11966. key: 'cssClasses',
  11967. get: function get() {
  11968. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  11969. }
  11970. }, {
  11971. key: 'strings',
  11972. get: function get() {
  11973. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  11974. }
  11975. }, {
  11976. key: 'defaultAdapter',
  11977. get: function get() {
  11978. return {
  11979. addClass: function addClass() {},
  11980. removeClass: function removeClass() {},
  11981. hasClass: function hasClass() {},
  11982. setAttr: function setAttr() {},
  11983. notifyChange: function notifyChange() {}
  11984. };
  11985. }
  11986. }]);
  11987. function MDCIconButtonToggleFoundation(adapter) {
  11988. _classCallCheck(this, MDCIconButtonToggleFoundation);
  11989. /** @private {boolean} */
  11990. var _this = _possibleConstructorReturn(this, (MDCIconButtonToggleFoundation.__proto__ || Object.getPrototypeOf(MDCIconButtonToggleFoundation)).call(this, _extends(MDCIconButtonToggleFoundation.defaultAdapter, adapter)));
  11991. _this.disabled_ = false;
  11992. return _this;
  11993. }
  11994. _createClass(MDCIconButtonToggleFoundation, [{
  11995. key: 'init',
  11996. value: function init() {
  11997. this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_PRESSED, '' + this.isOn());
  11998. }
  11999. }, {
  12000. key: 'handleClick',
  12001. value: function handleClick() {
  12002. this.toggle();
  12003. this.adapter_.notifyChange( /** @type {!IconButtonToggleEvent} */{ isOn: this.isOn() });
  12004. }
  12005. /** @return {boolean} */
  12006. }, {
  12007. key: 'isOn',
  12008. value: function isOn() {
  12009. return this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ICON_BUTTON_ON);
  12010. }
  12011. /** @param {boolean=} isOn */
  12012. }, {
  12013. key: 'toggle',
  12014. value: function toggle() {
  12015. var isOn = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !this.isOn();
  12016. if (isOn) {
  12017. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ICON_BUTTON_ON);
  12018. } else {
  12019. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ICON_BUTTON_ON);
  12020. }
  12021. this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_PRESSED, '' + isOn);
  12022. }
  12023. }]);
  12024. return MDCIconButtonToggleFoundation;
  12025. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  12026. /** @record */
  12027. var IconButtonToggleState = function IconButtonToggleState() {
  12028. _classCallCheck(this, IconButtonToggleState);
  12029. };
  12030. /* harmony default export */ __webpack_exports__["a"] = (MDCIconButtonToggleFoundation);
  12031. /***/ }),
  12032. /* 90 */
  12033. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12034. "use strict";
  12035. /* unused harmony export MDCIconButtonToggleAdapter */
  12036. /* unused harmony export IconButtonToggleEvent */
  12037. 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; }; }();
  12038. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  12039. /**
  12040. * @license
  12041. * Copyright 2018 Google Inc.
  12042. *
  12043. * Permission is hereby granted, free of charge, to any person obtaining a copy
  12044. * of this software and associated documentation files (the "Software"), to deal
  12045. * in the Software without restriction, including without limitation the rights
  12046. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  12047. * copies of the Software, and to permit persons to whom the Software is
  12048. * furnished to do so, subject to the following conditions:
  12049. *
  12050. * The above copyright notice and this permission notice shall be included in
  12051. * all copies or substantial portions of the Software.
  12052. *
  12053. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  12054. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  12055. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  12056. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  12057. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  12058. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  12059. * THE SOFTWARE.
  12060. */
  12061. /* eslint no-unused-vars: [2, {"args": "none"}] */
  12062. /**
  12063. * Adapter for MDC Icon Button Toggle. Provides an interface for managing
  12064. * - classes
  12065. * - dom
  12066. * - inner text
  12067. * - event handlers
  12068. * - event dispatch
  12069. *
  12070. * Additionally, provides type information for the adapter to the Closure
  12071. * compiler.
  12072. *
  12073. * Implement this adapter for your framework of choice to delegate updates to
  12074. * the component in your framework of choice. See architecture documentation
  12075. * for more details.
  12076. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  12077. *
  12078. * @record
  12079. */
  12080. var MDCIconButtonToggleAdapter = function () {
  12081. function MDCIconButtonToggleAdapter() {
  12082. _classCallCheck(this, MDCIconButtonToggleAdapter);
  12083. }
  12084. _createClass(MDCIconButtonToggleAdapter, [{
  12085. key: "addClass",
  12086. /** @param {string} className */
  12087. value: function addClass(className) {}
  12088. /** @param {string} className */
  12089. }, {
  12090. key: "removeClass",
  12091. value: function removeClass(className) {}
  12092. /**
  12093. * @param {string} className
  12094. * @return {boolean}
  12095. * */
  12096. }, {
  12097. key: "hasClass",
  12098. value: function hasClass(className) {}
  12099. /**
  12100. * @param {string} attrName
  12101. * @param {string} attrValue
  12102. */
  12103. }, {
  12104. key: "setAttr",
  12105. value: function setAttr(attrName, attrValue) {}
  12106. /** @param {!IconButtonToggleEvent} evtData */
  12107. }, {
  12108. key: "notifyChange",
  12109. value: function notifyChange(evtData) {}
  12110. }]);
  12111. return MDCIconButtonToggleAdapter;
  12112. }();
  12113. /**
  12114. * @typedef {{
  12115. * isOn: boolean,
  12116. * }}
  12117. */
  12118. var IconButtonToggleEvent = void 0;
  12119. /***/ }),
  12120. /* 91 */
  12121. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12122. "use strict";
  12123. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  12124. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  12125. /**
  12126. * @license
  12127. * Copyright 2018 Google Inc.
  12128. *
  12129. * Permission is hereby granted, free of charge, to any person obtaining a copy
  12130. * of this software and associated documentation files (the "Software"), to deal
  12131. * in the Software without restriction, including without limitation the rights
  12132. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  12133. * copies of the Software, and to permit persons to whom the Software is
  12134. * furnished to do so, subject to the following conditions:
  12135. *
  12136. * The above copyright notice and this permission notice shall be included in
  12137. * all copies or substantial portions of the Software.
  12138. *
  12139. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  12140. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  12141. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  12142. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  12143. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  12144. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  12145. * THE SOFTWARE.
  12146. */
  12147. /** @enum {string} */
  12148. var cssClasses = {
  12149. ROOT: 'mdc-icon-button',
  12150. ICON_BUTTON_ON: 'mdc-icon-button--on'
  12151. };
  12152. /** @enum {string} */
  12153. var strings = {
  12154. ARIA_PRESSED: 'aria-pressed',
  12155. ARIA_LABEL: 'aria-label',
  12156. CHANGE_EVENT: 'MDCIconButtonToggle:change'
  12157. };
  12158. /***/ }),
  12159. /* 92 */
  12160. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12161. "use strict";
  12162. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  12163. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCIconToggle", function() { return MDCIconToggle; });
  12164. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  12165. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(93);
  12166. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_ripple_index__ = __webpack_require__(2);
  12167. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCIconToggleFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__foundation__["a"]; });
  12168. 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; };
  12169. 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); } };
  12170. 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; }; }();
  12171. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  12172. 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; }
  12173. 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; }
  12174. /**
  12175. * @license
  12176. * Copyright 2016 Google Inc.
  12177. *
  12178. * Permission is hereby granted, free of charge, to any person obtaining a copy
  12179. * of this software and associated documentation files (the "Software"), to deal
  12180. * in the Software without restriction, including without limitation the rights
  12181. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  12182. * copies of the Software, and to permit persons to whom the Software is
  12183. * furnished to do so, subject to the following conditions:
  12184. *
  12185. * The above copyright notice and this permission notice shall be included in
  12186. * all copies or substantial portions of the Software.
  12187. *
  12188. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  12189. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  12190. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  12191. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  12192. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  12193. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  12194. * THE SOFTWARE.
  12195. */
  12196. /**
  12197. * @extends {MDCComponent<!MDCIconToggleFoundation>}
  12198. */
  12199. var MDCIconToggle = function (_MDCComponent) {
  12200. _inherits(MDCIconToggle, _MDCComponent);
  12201. _createClass(MDCIconToggle, null, [{
  12202. key: 'attachTo',
  12203. value: function attachTo(root) {
  12204. return new MDCIconToggle(root);
  12205. }
  12206. }]);
  12207. function MDCIconToggle() {
  12208. var _ref;
  12209. _classCallCheck(this, MDCIconToggle);
  12210. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  12211. args[_key] = arguments[_key];
  12212. }
  12213. /** @private {!MDCRipple} */
  12214. var _this = _possibleConstructorReturn(this, (_ref = MDCIconToggle.__proto__ || Object.getPrototypeOf(MDCIconToggle)).call.apply(_ref, [this].concat(args)));
  12215. _this.ripple_ = _this.initRipple_();
  12216. return _this;
  12217. }
  12218. /** @return {!Element} */
  12219. _createClass(MDCIconToggle, [{
  12220. key: 'initRipple_',
  12221. /**
  12222. * @return {!MDCRipple}
  12223. * @private
  12224. */
  12225. value: function initRipple_() {
  12226. var _this2 = this;
  12227. var adapter = _extends(__WEBPACK_IMPORTED_MODULE_2__material_ripple_index__["MDCRipple"].createAdapter(this), {
  12228. isUnbounded: function isUnbounded() {
  12229. return true;
  12230. },
  12231. isSurfaceActive: function isSurfaceActive() {
  12232. return _this2.foundation_.isKeyboardActivated();
  12233. }
  12234. });
  12235. var foundation = new __WEBPACK_IMPORTED_MODULE_2__material_ripple_index__["MDCRippleFoundation"](adapter);
  12236. return new __WEBPACK_IMPORTED_MODULE_2__material_ripple_index__["MDCRipple"](this.root_, foundation);
  12237. }
  12238. }, {
  12239. key: 'destroy',
  12240. value: function destroy() {
  12241. this.ripple_.destroy();
  12242. _get(MDCIconToggle.prototype.__proto__ || Object.getPrototypeOf(MDCIconToggle.prototype), 'destroy', this).call(this);
  12243. }
  12244. /** @return {!MDCIconToggleFoundation} */
  12245. }, {
  12246. key: 'getDefaultFoundation',
  12247. value: function getDefaultFoundation() {
  12248. var _this3 = this;
  12249. return new __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]({
  12250. addClass: function addClass(className) {
  12251. return _this3.iconEl_.classList.add(className);
  12252. },
  12253. removeClass: function removeClass(className) {
  12254. return _this3.iconEl_.classList.remove(className);
  12255. },
  12256. registerInteractionHandler: function registerInteractionHandler(type, handler) {
  12257. return _this3.root_.addEventListener(type, handler);
  12258. },
  12259. deregisterInteractionHandler: function deregisterInteractionHandler(type, handler) {
  12260. return _this3.root_.removeEventListener(type, handler);
  12261. },
  12262. setText: function setText(text) {
  12263. return _this3.iconEl_.textContent = text;
  12264. },
  12265. getTabIndex: function getTabIndex() {
  12266. return (/* number */_this3.root_.tabIndex
  12267. );
  12268. },
  12269. setTabIndex: function setTabIndex(tabIndex) {
  12270. return _this3.root_.tabIndex = tabIndex;
  12271. },
  12272. getAttr: function getAttr(name, value) {
  12273. return _this3.root_.getAttribute(name, value);
  12274. },
  12275. setAttr: function setAttr(name, value) {
  12276. return _this3.root_.setAttribute(name, value);
  12277. },
  12278. rmAttr: function rmAttr(name) {
  12279. return _this3.root_.removeAttribute(name);
  12280. },
  12281. notifyChange: function notifyChange(evtData) {
  12282. return _this3.emit(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.CHANGE_EVENT, evtData);
  12283. }
  12284. });
  12285. }
  12286. }, {
  12287. key: 'initialSyncWithDOM',
  12288. value: function initialSyncWithDOM() {
  12289. this.on = this.root_.getAttribute(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.ARIA_PRESSED) === 'true';
  12290. this.disabled = this.root_.getAttribute(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.ARIA_DISABLED) === 'true';
  12291. }
  12292. /** @return {!MDCRipple} */
  12293. }, {
  12294. key: 'refreshToggleData',
  12295. value: function refreshToggleData() {
  12296. this.foundation_.refreshToggleData();
  12297. }
  12298. }, {
  12299. key: 'iconEl_',
  12300. get: function get() {
  12301. var sel = this.root_.dataset['iconInnerSelector'];
  12302. return sel ?
  12303. /** @type {!Element} */this.root_.querySelector(sel) : this.root_;
  12304. }
  12305. }, {
  12306. key: 'ripple',
  12307. get: function get() {
  12308. return this.ripple_;
  12309. }
  12310. /** @return {boolean} */
  12311. }, {
  12312. key: 'on',
  12313. get: function get() {
  12314. return this.foundation_.isOn();
  12315. }
  12316. /** @param {boolean} isOn */
  12317. ,
  12318. set: function set(isOn) {
  12319. this.foundation_.toggle(isOn);
  12320. }
  12321. /** @return {boolean} */
  12322. }, {
  12323. key: 'disabled',
  12324. get: function get() {
  12325. return this.foundation_.isDisabled();
  12326. }
  12327. /** @param {boolean} isDisabled */
  12328. ,
  12329. set: function set(isDisabled) {
  12330. this.foundation_.setDisabled(isDisabled);
  12331. }
  12332. }]);
  12333. return MDCIconToggle;
  12334. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  12335. /***/ }),
  12336. /* 93 */
  12337. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12338. "use strict";
  12339. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  12340. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(94);
  12341. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(95);
  12342. 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; };
  12343. 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; }; }();
  12344. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  12345. 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; }
  12346. 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; }
  12347. /**
  12348. * @license
  12349. * Copyright 2016 Google Inc.
  12350. *
  12351. * Permission is hereby granted, free of charge, to any person obtaining a copy
  12352. * of this software and associated documentation files (the "Software"), to deal
  12353. * in the Software without restriction, including without limitation the rights
  12354. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  12355. * copies of the Software, and to permit persons to whom the Software is
  12356. * furnished to do so, subject to the following conditions:
  12357. *
  12358. * The above copyright notice and this permission notice shall be included in
  12359. * all copies or substantial portions of the Software.
  12360. *
  12361. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  12362. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  12363. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  12364. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  12365. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  12366. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  12367. * THE SOFTWARE.
  12368. */
  12369. /* eslint-disable no-unused-vars */
  12370. /**
  12371. * @extends {MDCFoundation<!MDCIconToggleAdapter>}
  12372. */
  12373. var MDCIconToggleFoundation = function (_MDCFoundation) {
  12374. _inherits(MDCIconToggleFoundation, _MDCFoundation);
  12375. _createClass(MDCIconToggleFoundation, null, [{
  12376. key: 'cssClasses',
  12377. get: function get() {
  12378. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  12379. }
  12380. }, {
  12381. key: 'strings',
  12382. get: function get() {
  12383. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  12384. }
  12385. }, {
  12386. key: 'defaultAdapter',
  12387. get: function get() {
  12388. return {
  12389. addClass: function addClass() /* className: string */{},
  12390. removeClass: function removeClass() /* className: string */{},
  12391. registerInteractionHandler: function registerInteractionHandler() /* type: string, handler: EventListener */{},
  12392. deregisterInteractionHandler: function deregisterInteractionHandler() /* type: string, handler: EventListener */{},
  12393. setText: function setText() /* text: string */{},
  12394. getTabIndex: function getTabIndex() {
  12395. return (/* number */0
  12396. );
  12397. },
  12398. setTabIndex: function setTabIndex() /* tabIndex: number */{},
  12399. getAttr: function getAttr() {
  12400. return (/* name: string */ /* string */''
  12401. );
  12402. },
  12403. setAttr: function setAttr() /* name: string, value: string */{},
  12404. rmAttr: function rmAttr() /* name: string */{},
  12405. notifyChange: function notifyChange() /* evtData: IconToggleEvent */{}
  12406. };
  12407. }
  12408. }]);
  12409. function MDCIconToggleFoundation(adapter) {
  12410. _classCallCheck(this, MDCIconToggleFoundation);
  12411. /** @private {boolean} */
  12412. var _this = _possibleConstructorReturn(this, (MDCIconToggleFoundation.__proto__ || Object.getPrototypeOf(MDCIconToggleFoundation)).call(this, _extends(MDCIconToggleFoundation.defaultAdapter, adapter)));
  12413. _this.on_ = false;
  12414. /** @private {boolean} */
  12415. _this.disabled_ = false;
  12416. /** @private {number} */
  12417. _this.savedTabIndex_ = -1;
  12418. /** @private {?IconToggleState} */
  12419. _this.toggleOnData_ = null;
  12420. /** @private {?IconToggleState} */
  12421. _this.toggleOffData_ = null;
  12422. _this.clickHandler_ = /** @private {!EventListener} */function () {
  12423. return _this.toggleFromEvt_();
  12424. };
  12425. /** @private {boolean} */
  12426. _this.isHandlingKeydown_ = false;
  12427. _this.keydownHandler_ = /** @private {!EventListener} */function ( /** @type {!KeyboardKey} */evt) {
  12428. if (isSpace(evt)) {
  12429. _this.isHandlingKeydown_ = true;
  12430. return evt.preventDefault();
  12431. }
  12432. };
  12433. _this.keyupHandler_ = /** @private {!EventListener} */function ( /** @type {!KeyboardKey} */evt) {
  12434. if (isSpace(evt)) {
  12435. _this.isHandlingKeydown_ = false;
  12436. _this.toggleFromEvt_();
  12437. }
  12438. };
  12439. return _this;
  12440. }
  12441. _createClass(MDCIconToggleFoundation, [{
  12442. key: 'init',
  12443. value: function init() {
  12444. this.refreshToggleData();
  12445. this.savedTabIndex_ = this.adapter_.getTabIndex();
  12446. this.adapter_.registerInteractionHandler('click', this.clickHandler_);
  12447. this.adapter_.registerInteractionHandler('keydown', this.keydownHandler_);
  12448. this.adapter_.registerInteractionHandler('keyup', this.keyupHandler_);
  12449. }
  12450. }, {
  12451. key: 'refreshToggleData',
  12452. value: function refreshToggleData() {
  12453. var _MDCIconToggleFoundat = MDCIconToggleFoundation.strings,
  12454. DATA_TOGGLE_ON = _MDCIconToggleFoundat.DATA_TOGGLE_ON,
  12455. DATA_TOGGLE_OFF = _MDCIconToggleFoundat.DATA_TOGGLE_OFF;
  12456. this.toggleOnData_ = this.parseJsonDataAttr_(DATA_TOGGLE_ON);
  12457. this.toggleOffData_ = this.parseJsonDataAttr_(DATA_TOGGLE_OFF);
  12458. }
  12459. }, {
  12460. key: 'destroy',
  12461. value: function destroy() {
  12462. this.adapter_.deregisterInteractionHandler('click', this.clickHandler_);
  12463. this.adapter_.deregisterInteractionHandler('keydown', this.keydownHandler_);
  12464. this.adapter_.deregisterInteractionHandler('keyup', this.keyupHandler_);
  12465. }
  12466. /** @private */
  12467. }, {
  12468. key: 'toggleFromEvt_',
  12469. value: function toggleFromEvt_() {
  12470. this.toggle();
  12471. var isOn = this.on_;
  12472. this.adapter_.notifyChange( /** @type {!IconToggleEvent} */{ isOn: isOn });
  12473. }
  12474. /** @return {boolean} */
  12475. }, {
  12476. key: 'isOn',
  12477. value: function isOn() {
  12478. return this.on_;
  12479. }
  12480. /** @param {boolean=} isOn */
  12481. }, {
  12482. key: 'toggle',
  12483. value: function toggle() {
  12484. var isOn = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !this.on_;
  12485. this.on_ = isOn;
  12486. var _MDCIconToggleFoundat2 = MDCIconToggleFoundation.strings,
  12487. ARIA_LABEL = _MDCIconToggleFoundat2.ARIA_LABEL,
  12488. ARIA_PRESSED = _MDCIconToggleFoundat2.ARIA_PRESSED;
  12489. if (this.on_) {
  12490. this.adapter_.setAttr(ARIA_PRESSED, 'true');
  12491. } else {
  12492. this.adapter_.setAttr(ARIA_PRESSED, 'false');
  12493. }
  12494. var _ref = this.on_ ? this.toggleOffData_ : this.toggleOnData_,
  12495. classToRemove = _ref.cssClass;
  12496. if (classToRemove) {
  12497. this.adapter_.removeClass(classToRemove);
  12498. }
  12499. var _ref2 = this.on_ ? this.toggleOnData_ : this.toggleOffData_,
  12500. content = _ref2.content,
  12501. label = _ref2.label,
  12502. cssClass = _ref2.cssClass;
  12503. if (cssClass) {
  12504. this.adapter_.addClass(cssClass);
  12505. }
  12506. if (content) {
  12507. this.adapter_.setText(content);
  12508. }
  12509. if (label) {
  12510. this.adapter_.setAttr(ARIA_LABEL, label);
  12511. }
  12512. }
  12513. /**
  12514. * @param {string} dataAttr
  12515. * @return {!IconToggleState}
  12516. */
  12517. }, {
  12518. key: 'parseJsonDataAttr_',
  12519. value: function parseJsonDataAttr_(dataAttr) {
  12520. var val = this.adapter_.getAttr(dataAttr);
  12521. if (!val) {
  12522. return {};
  12523. }
  12524. return (/** @type {!IconToggleState} */JSON.parse(val)
  12525. );
  12526. }
  12527. /** @return {boolean} */
  12528. }, {
  12529. key: 'isDisabled',
  12530. value: function isDisabled() {
  12531. return this.disabled_;
  12532. }
  12533. /** @param {boolean} isDisabled */
  12534. }, {
  12535. key: 'setDisabled',
  12536. value: function setDisabled(isDisabled) {
  12537. this.disabled_ = isDisabled;
  12538. var DISABLED = MDCIconToggleFoundation.cssClasses.DISABLED;
  12539. var ARIA_DISABLED = MDCIconToggleFoundation.strings.ARIA_DISABLED;
  12540. if (this.disabled_) {
  12541. this.savedTabIndex_ = this.adapter_.getTabIndex();
  12542. this.adapter_.setTabIndex(-1);
  12543. this.adapter_.setAttr(ARIA_DISABLED, 'true');
  12544. this.adapter_.addClass(DISABLED);
  12545. } else {
  12546. this.adapter_.setTabIndex(this.savedTabIndex_);
  12547. this.adapter_.rmAttr(ARIA_DISABLED);
  12548. this.adapter_.removeClass(DISABLED);
  12549. }
  12550. }
  12551. /** @return {boolean} */
  12552. }, {
  12553. key: 'isKeyboardActivated',
  12554. value: function isKeyboardActivated() {
  12555. return this.isHandlingKeydown_;
  12556. }
  12557. }]);
  12558. return MDCIconToggleFoundation;
  12559. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  12560. /**
  12561. * @typedef {{
  12562. * key: string,
  12563. * keyCode: number
  12564. * }}
  12565. */
  12566. var KeyboardKey = void 0;
  12567. /**
  12568. * @param {!KeyboardKey} keyboardKey
  12569. * @return {boolean}
  12570. */
  12571. function isSpace(keyboardKey) {
  12572. return keyboardKey.key === 'Space' || keyboardKey.keyCode === 32;
  12573. }
  12574. /** @record */
  12575. var IconToggleState = function IconToggleState() {
  12576. _classCallCheck(this, IconToggleState);
  12577. };
  12578. /**
  12579. * The aria-label value of the icon toggle, or undefined if there is no aria-label.
  12580. * @export {string|undefined}
  12581. */
  12582. IconToggleState.prototype.label;
  12583. /**
  12584. * The text for the icon toggle, or undefined if there is no text.
  12585. * @export {string|undefined}
  12586. */
  12587. IconToggleState.prototype.content;
  12588. /**
  12589. * The CSS class to add to the icon toggle, or undefined if there is no CSS class.
  12590. * @export {string|undefined}
  12591. */
  12592. IconToggleState.prototype.cssClass;
  12593. /* harmony default export */ __webpack_exports__["a"] = (MDCIconToggleFoundation);
  12594. /***/ }),
  12595. /* 94 */
  12596. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12597. "use strict";
  12598. /* unused harmony export MDCIconToggleAdapter */
  12599. /* unused harmony export IconToggleEvent */
  12600. 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; }; }();
  12601. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  12602. /**
  12603. * @license
  12604. * Copyright 2017 Google Inc.
  12605. *
  12606. * Permission is hereby granted, free of charge, to any person obtaining a copy
  12607. * of this software and associated documentation files (the "Software"), to deal
  12608. * in the Software without restriction, including without limitation the rights
  12609. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  12610. * copies of the Software, and to permit persons to whom the Software is
  12611. * furnished to do so, subject to the following conditions:
  12612. *
  12613. * The above copyright notice and this permission notice shall be included in
  12614. * all copies or substantial portions of the Software.
  12615. *
  12616. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  12617. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  12618. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  12619. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  12620. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  12621. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  12622. * THE SOFTWARE.
  12623. */
  12624. /* eslint no-unused-vars: [2, {"args": "none"}] */
  12625. /**
  12626. * Adapter for MDC Icon Toggle. Provides an interface for managing
  12627. * - classes
  12628. * - dom
  12629. * - inner text
  12630. * - event handlers
  12631. * - event dispatch
  12632. *
  12633. * Additionally, provides type information for the adapter to the Closure
  12634. * compiler.
  12635. *
  12636. * Implement this adapter for your framework of choice to delegate updates to
  12637. * the component in your framework of choice. See architecture documentation
  12638. * for more details.
  12639. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  12640. *
  12641. * @record
  12642. */
  12643. var MDCIconToggleAdapter = function () {
  12644. function MDCIconToggleAdapter() {
  12645. _classCallCheck(this, MDCIconToggleAdapter);
  12646. }
  12647. _createClass(MDCIconToggleAdapter, [{
  12648. key: "addClass",
  12649. /** @param {string} className */
  12650. value: function addClass(className) {}
  12651. /** @param {string} className */
  12652. }, {
  12653. key: "removeClass",
  12654. value: function removeClass(className) {}
  12655. /**
  12656. * @param {string} type
  12657. * @param {!EventListener} handler
  12658. */
  12659. }, {
  12660. key: "registerInteractionHandler",
  12661. value: function registerInteractionHandler(type, handler) {}
  12662. /**
  12663. * @param {string} type
  12664. * @param {!EventListener} handler
  12665. */
  12666. }, {
  12667. key: "deregisterInteractionHandler",
  12668. value: function deregisterInteractionHandler(type, handler) {}
  12669. /** @param {string} text */
  12670. }, {
  12671. key: "setText",
  12672. value: function setText(text) {}
  12673. /** @return {number} */
  12674. }, {
  12675. key: "getTabIndex",
  12676. value: function getTabIndex() {}
  12677. /** @param {number} tabIndex */
  12678. }, {
  12679. key: "setTabIndex",
  12680. value: function setTabIndex(tabIndex) {}
  12681. /**
  12682. * @param {string} name
  12683. * @return {string}
  12684. */
  12685. }, {
  12686. key: "getAttr",
  12687. value: function getAttr(name) {}
  12688. /**
  12689. * @param {string} name
  12690. * @param {string} value
  12691. */
  12692. }, {
  12693. key: "setAttr",
  12694. value: function setAttr(name, value) {}
  12695. /** @param {string} name */
  12696. }, {
  12697. key: "rmAttr",
  12698. value: function rmAttr(name) {}
  12699. /** @param {!IconToggleEvent} evtData */
  12700. }, {
  12701. key: "notifyChange",
  12702. value: function notifyChange(evtData) {}
  12703. }]);
  12704. return MDCIconToggleAdapter;
  12705. }();
  12706. /**
  12707. * @typedef {{
  12708. * isOn: boolean,
  12709. * }}
  12710. */
  12711. var IconToggleEvent = void 0;
  12712. /***/ }),
  12713. /* 95 */
  12714. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12715. "use strict";
  12716. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  12717. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  12718. /**
  12719. * @license
  12720. * Copyright 2016 Google Inc.
  12721. *
  12722. * Permission is hereby granted, free of charge, to any person obtaining a copy
  12723. * of this software and associated documentation files (the "Software"), to deal
  12724. * in the Software without restriction, including without limitation the rights
  12725. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  12726. * copies of the Software, and to permit persons to whom the Software is
  12727. * furnished to do so, subject to the following conditions:
  12728. *
  12729. * The above copyright notice and this permission notice shall be included in
  12730. * all copies or substantial portions of the Software.
  12731. *
  12732. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  12733. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  12734. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  12735. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  12736. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  12737. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  12738. * THE SOFTWARE.
  12739. */
  12740. /** @enum {string} */
  12741. var cssClasses = {
  12742. ROOT: 'mdc-icon-toggle',
  12743. DISABLED: 'mdc-icon-toggle--disabled'
  12744. };
  12745. /** @enum {string} */
  12746. var strings = {
  12747. DATA_TOGGLE_ON: 'data-toggle-on',
  12748. DATA_TOGGLE_OFF: 'data-toggle-off',
  12749. ARIA_PRESSED: 'aria-pressed',
  12750. ARIA_DISABLED: 'aria-disabled',
  12751. ARIA_LABEL: 'aria-label',
  12752. CHANGE_EVENT: 'MDCIconToggle:change'
  12753. };
  12754. /***/ }),
  12755. /* 96 */
  12756. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12757. "use strict";
  12758. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  12759. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCLinearProgress", function() { return MDCLinearProgress; });
  12760. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_index__ = __webpack_require__(3);
  12761. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(97);
  12762. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCLinearProgressFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__foundation__["a"]; });
  12763. 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; }; }();
  12764. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  12765. 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; }
  12766. 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; }
  12767. /**
  12768. * @license
  12769. * Copyright 2017 Google Inc.
  12770. *
  12771. * Permission is hereby granted, free of charge, to any person obtaining a copy
  12772. * of this software and associated documentation files (the "Software"), to deal
  12773. * in the Software without restriction, including without limitation the rights
  12774. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  12775. * copies of the Software, and to permit persons to whom the Software is
  12776. * furnished to do so, subject to the following conditions:
  12777. *
  12778. * The above copyright notice and this permission notice shall be included in
  12779. * all copies or substantial portions of the Software.
  12780. *
  12781. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  12782. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  12783. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  12784. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  12785. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  12786. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  12787. * THE SOFTWARE.
  12788. */
  12789. var MDCLinearProgress = function (_MDCComponent) {
  12790. _inherits(MDCLinearProgress, _MDCComponent);
  12791. function MDCLinearProgress() {
  12792. _classCallCheck(this, MDCLinearProgress);
  12793. return _possibleConstructorReturn(this, (MDCLinearProgress.__proto__ || Object.getPrototypeOf(MDCLinearProgress)).apply(this, arguments));
  12794. }
  12795. _createClass(MDCLinearProgress, [{
  12796. key: 'open',
  12797. value: function open() {
  12798. this.foundation_.open();
  12799. }
  12800. }, {
  12801. key: 'close',
  12802. value: function close() {
  12803. this.foundation_.close();
  12804. }
  12805. }, {
  12806. key: 'getDefaultFoundation',
  12807. value: function getDefaultFoundation() {
  12808. var _this2 = this;
  12809. return new __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]({
  12810. addClass: function addClass(className) {
  12811. return _this2.root_.classList.add(className);
  12812. },
  12813. getPrimaryBar: function getPrimaryBar() {
  12814. return _this2.root_.querySelector(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.PRIMARY_BAR_SELECTOR);
  12815. },
  12816. getBuffer: function getBuffer() {
  12817. return _this2.root_.querySelector(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.BUFFER_SELECTOR);
  12818. },
  12819. hasClass: function hasClass(className) {
  12820. return _this2.root_.classList.contains(className);
  12821. },
  12822. removeClass: function removeClass(className) {
  12823. return _this2.root_.classList.remove(className);
  12824. },
  12825. setStyle: function setStyle(el, styleProperty, value) {
  12826. return el.style[styleProperty] = value;
  12827. }
  12828. });
  12829. }
  12830. }, {
  12831. key: 'determinate',
  12832. set: function set(value) {
  12833. this.foundation_.setDeterminate(value);
  12834. }
  12835. }, {
  12836. key: 'progress',
  12837. set: function set(value) {
  12838. this.foundation_.setProgress(value);
  12839. }
  12840. }, {
  12841. key: 'buffer',
  12842. set: function set(value) {
  12843. this.foundation_.setBuffer(value);
  12844. }
  12845. }, {
  12846. key: 'reverse',
  12847. set: function set(value) {
  12848. this.foundation_.setReverse(value);
  12849. }
  12850. }], [{
  12851. key: 'attachTo',
  12852. value: function attachTo(root) {
  12853. return new MDCLinearProgress(root);
  12854. }
  12855. }]);
  12856. return MDCLinearProgress;
  12857. }(__WEBPACK_IMPORTED_MODULE_0__material_base_index__["MDCComponent"]);
  12858. /***/ }),
  12859. /* 97 */
  12860. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12861. "use strict";
  12862. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_index__ = __webpack_require__(3);
  12863. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_animation_index__ = __webpack_require__(9);
  12864. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(98);
  12865. 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; };
  12866. 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; }; }();
  12867. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  12868. 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; }
  12869. 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; }
  12870. /**
  12871. * @license
  12872. * Copyright 2017 Google Inc.
  12873. *
  12874. * Permission is hereby granted, free of charge, to any person obtaining a copy
  12875. * of this software and associated documentation files (the "Software"), to deal
  12876. * in the Software without restriction, including without limitation the rights
  12877. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  12878. * copies of the Software, and to permit persons to whom the Software is
  12879. * furnished to do so, subject to the following conditions:
  12880. *
  12881. * The above copyright notice and this permission notice shall be included in
  12882. * all copies or substantial portions of the Software.
  12883. *
  12884. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  12885. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  12886. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  12887. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  12888. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  12889. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  12890. * THE SOFTWARE.
  12891. */
  12892. var MDCLinearProgressFoundation = function (_MDCFoundation) {
  12893. _inherits(MDCLinearProgressFoundation, _MDCFoundation);
  12894. _createClass(MDCLinearProgressFoundation, null, [{
  12895. key: 'cssClasses',
  12896. get: function get() {
  12897. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  12898. }
  12899. }, {
  12900. key: 'strings',
  12901. get: function get() {
  12902. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  12903. }
  12904. }, {
  12905. key: 'defaultAdapter',
  12906. get: function get() {
  12907. return {
  12908. addClass: function addClass() /* className: string */{},
  12909. getPrimaryBar: function getPrimaryBar() /* el: Element */{},
  12910. getBuffer: function getBuffer() /* el: Element */{},
  12911. hasClass: function hasClass() {
  12912. return (/* className: string */false
  12913. );
  12914. },
  12915. removeClass: function removeClass() /* className: string */{},
  12916. setStyle: function setStyle() /* el: Element, styleProperty: string, value: string */{}
  12917. };
  12918. }
  12919. }]);
  12920. function MDCLinearProgressFoundation(adapter) {
  12921. _classCallCheck(this, MDCLinearProgressFoundation);
  12922. return _possibleConstructorReturn(this, (MDCLinearProgressFoundation.__proto__ || Object.getPrototypeOf(MDCLinearProgressFoundation)).call(this, _extends(MDCLinearProgressFoundation.defaultAdapter, adapter)));
  12923. }
  12924. _createClass(MDCLinearProgressFoundation, [{
  12925. key: 'init',
  12926. value: function init() {
  12927. this.determinate_ = !this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].INDETERMINATE_CLASS);
  12928. this.reverse_ = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].REVERSED_CLASS);
  12929. this.progress_ = 0;
  12930. }
  12931. }, {
  12932. key: 'setDeterminate',
  12933. value: function setDeterminate(isDeterminate) {
  12934. this.determinate_ = isDeterminate;
  12935. if (this.determinate_) {
  12936. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].INDETERMINATE_CLASS);
  12937. this.setScale_(this.adapter_.getPrimaryBar(), this.progress_);
  12938. } else {
  12939. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].INDETERMINATE_CLASS);
  12940. this.setScale_(this.adapter_.getPrimaryBar(), 1);
  12941. this.setScale_(this.adapter_.getBuffer(), 1);
  12942. }
  12943. }
  12944. }, {
  12945. key: 'setProgress',
  12946. value: function setProgress(value) {
  12947. this.progress_ = value;
  12948. if (this.determinate_) {
  12949. this.setScale_(this.adapter_.getPrimaryBar(), value);
  12950. }
  12951. }
  12952. }, {
  12953. key: 'setBuffer',
  12954. value: function setBuffer(value) {
  12955. if (this.determinate_) {
  12956. this.setScale_(this.adapter_.getBuffer(), value);
  12957. }
  12958. }
  12959. }, {
  12960. key: 'setReverse',
  12961. value: function setReverse(isReversed) {
  12962. this.reverse_ = isReversed;
  12963. if (this.reverse_) {
  12964. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].REVERSED_CLASS);
  12965. } else {
  12966. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].REVERSED_CLASS);
  12967. }
  12968. }
  12969. }, {
  12970. key: 'open',
  12971. value: function open() {
  12972. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CLOSED_CLASS);
  12973. }
  12974. }, {
  12975. key: 'close',
  12976. value: function close() {
  12977. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CLOSED_CLASS);
  12978. }
  12979. }, {
  12980. key: 'setScale_',
  12981. value: function setScale_(el, scaleValue) {
  12982. var _this2 = this;
  12983. var value = 'scaleX(' + scaleValue + ')';
  12984. __WEBPACK_IMPORTED_MODULE_1__material_animation_index__["c" /* transformStyleProperties */].forEach(function (transformStyleProperty) {
  12985. _this2.adapter_.setStyle(el, transformStyleProperty, value);
  12986. });
  12987. }
  12988. }]);
  12989. return MDCLinearProgressFoundation;
  12990. }(__WEBPACK_IMPORTED_MODULE_0__material_base_index__["MDCFoundation"]);
  12991. /* harmony default export */ __webpack_exports__["a"] = (MDCLinearProgressFoundation);
  12992. /***/ }),
  12993. /* 98 */
  12994. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12995. "use strict";
  12996. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  12997. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  12998. /**
  12999. * @license
  13000. * Copyright 2017 Google Inc.
  13001. *
  13002. * Permission is hereby granted, free of charge, to any person obtaining a copy
  13003. * of this software and associated documentation files (the "Software"), to deal
  13004. * in the Software without restriction, including without limitation the rights
  13005. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  13006. * copies of the Software, and to permit persons to whom the Software is
  13007. * furnished to do so, subject to the following conditions:
  13008. *
  13009. * The above copyright notice and this permission notice shall be included in
  13010. * all copies or substantial portions of the Software.
  13011. *
  13012. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13013. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  13014. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  13015. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  13016. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  13017. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  13018. * THE SOFTWARE.
  13019. */
  13020. var cssClasses = {
  13021. CLOSED_CLASS: 'mdc-linear-progress--closed',
  13022. INDETERMINATE_CLASS: 'mdc-linear-progress--indeterminate',
  13023. REVERSED_CLASS: 'mdc-linear-progress--reversed'
  13024. };
  13025. var strings = {
  13026. PRIMARY_BAR_SELECTOR: '.mdc-linear-progress__primary-bar',
  13027. BUFFER_SELECTOR: '.mdc-linear-progress__buffer'
  13028. };
  13029. /***/ }),
  13030. /* 99 */
  13031. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13032. "use strict";
  13033. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  13034. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(36);
  13035. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(100);
  13036. 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; };
  13037. 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; }; }();
  13038. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13039. 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; }
  13040. 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; }
  13041. /**
  13042. * @license
  13043. * Copyright 2018 Google Inc.
  13044. *
  13045. * Permission is hereby granted, free of charge, to any person obtaining a copy
  13046. * of this software and associated documentation files (the "Software"), to deal
  13047. * in the Software without restriction, including without limitation the rights
  13048. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  13049. * copies of the Software, and to permit persons to whom the Software is
  13050. * furnished to do so, subject to the following conditions:
  13051. *
  13052. * The above copyright notice and this permission notice shall be included in
  13053. * all copies or substantial portions of the Software.
  13054. *
  13055. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13056. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  13057. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  13058. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  13059. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  13060. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  13061. * THE SOFTWARE.
  13062. */
  13063. /**
  13064. * @extends {MDCFoundation<!MDCLineRippleAdapter>}
  13065. * @final
  13066. */
  13067. var MDCLineRippleFoundation = function (_MDCFoundation) {
  13068. _inherits(MDCLineRippleFoundation, _MDCFoundation);
  13069. _createClass(MDCLineRippleFoundation, null, [{
  13070. key: 'cssClasses',
  13071. /** @return enum {string} */
  13072. get: function get() {
  13073. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  13074. }
  13075. /**
  13076. * {@see MDCLineRippleAdapter} for typing information on parameters and return
  13077. * types.
  13078. * @return {!MDCLineRippleAdapter}
  13079. */
  13080. }, {
  13081. key: 'defaultAdapter',
  13082. get: function get() {
  13083. return (/** @type {!MDCLineRippleAdapter} */{
  13084. addClass: function addClass() {},
  13085. removeClass: function removeClass() {},
  13086. hasClass: function hasClass() {},
  13087. setStyle: function setStyle() {},
  13088. registerEventHandler: function registerEventHandler() {},
  13089. deregisterEventHandler: function deregisterEventHandler() {}
  13090. }
  13091. );
  13092. }
  13093. /**
  13094. * @param {!MDCLineRippleAdapter=} adapter
  13095. */
  13096. }]);
  13097. function MDCLineRippleFoundation(adapter) {
  13098. _classCallCheck(this, MDCLineRippleFoundation);
  13099. /** @private {function(!Event): undefined} */
  13100. var _this = _possibleConstructorReturn(this, (MDCLineRippleFoundation.__proto__ || Object.getPrototypeOf(MDCLineRippleFoundation)).call(this, _extends(MDCLineRippleFoundation.defaultAdapter, adapter)));
  13101. _this.transitionEndHandler_ = function (evt) {
  13102. return _this.handleTransitionEnd(evt);
  13103. };
  13104. return _this;
  13105. }
  13106. _createClass(MDCLineRippleFoundation, [{
  13107. key: 'init',
  13108. value: function init() {
  13109. this.adapter_.registerEventHandler('transitionend', this.transitionEndHandler_);
  13110. }
  13111. }, {
  13112. key: 'destroy',
  13113. value: function destroy() {
  13114. this.adapter_.deregisterEventHandler('transitionend', this.transitionEndHandler_);
  13115. }
  13116. /**
  13117. * Activates the line ripple
  13118. */
  13119. }, {
  13120. key: 'activate',
  13121. value: function activate() {
  13122. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LINE_RIPPLE_DEACTIVATING);
  13123. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LINE_RIPPLE_ACTIVE);
  13124. }
  13125. /**
  13126. * Sets the center of the ripple animation to the given X coordinate.
  13127. * @param {number} xCoordinate
  13128. */
  13129. }, {
  13130. key: 'setRippleCenter',
  13131. value: function setRippleCenter(xCoordinate) {
  13132. this.adapter_.setStyle('transform-origin', xCoordinate + 'px center');
  13133. }
  13134. /**
  13135. * Deactivates the line ripple
  13136. */
  13137. }, {
  13138. key: 'deactivate',
  13139. value: function deactivate() {
  13140. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LINE_RIPPLE_DEACTIVATING);
  13141. }
  13142. /**
  13143. * Handles a transition end event
  13144. * @param {!Event} evt
  13145. */
  13146. }, {
  13147. key: 'handleTransitionEnd',
  13148. value: function handleTransitionEnd(evt) {
  13149. // Wait for the line ripple to be either transparent or opaque
  13150. // before emitting the animation end event
  13151. var isDeactivating = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LINE_RIPPLE_DEACTIVATING);
  13152. if (evt.propertyName === 'opacity') {
  13153. if (isDeactivating) {
  13154. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LINE_RIPPLE_ACTIVE);
  13155. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LINE_RIPPLE_DEACTIVATING);
  13156. }
  13157. }
  13158. }
  13159. }]);
  13160. return MDCLineRippleFoundation;
  13161. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  13162. /* harmony default export */ __webpack_exports__["a"] = (MDCLineRippleFoundation);
  13163. /***/ }),
  13164. /* 100 */
  13165. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13166. "use strict";
  13167. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  13168. /**
  13169. * @license
  13170. * Copyright 2018 Google Inc.
  13171. *
  13172. * Permission is hereby granted, free of charge, to any person obtaining a copy
  13173. * of this software and associated documentation files (the "Software"), to deal
  13174. * in the Software without restriction, including without limitation the rights
  13175. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  13176. * copies of the Software, and to permit persons to whom the Software is
  13177. * furnished to do so, subject to the following conditions:
  13178. *
  13179. * The above copyright notice and this permission notice shall be included in
  13180. * all copies or substantial portions of the Software.
  13181. *
  13182. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13183. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  13184. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  13185. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  13186. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  13187. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  13188. * THE SOFTWARE.
  13189. */
  13190. /** @enum {string} */
  13191. var cssClasses = {
  13192. LINE_RIPPLE_ACTIVE: 'mdc-line-ripple--active',
  13193. LINE_RIPPLE_DEACTIVATING: 'mdc-line-ripple--deactivating'
  13194. };
  13195. /***/ }),
  13196. /* 101 */
  13197. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13198. "use strict";
  13199. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  13200. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCMenu", function() { return MDCMenu; });
  13201. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  13202. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(102);
  13203. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(37);
  13204. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_menu_surface_index__ = __webpack_require__(40);
  13205. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__material_menu_surface_foundation__ = __webpack_require__(18);
  13206. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__material_list_index__ = __webpack_require__(14);
  13207. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCMenuFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__foundation__["a"]; });
  13208. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "AnchorMargin", function() { return __WEBPACK_IMPORTED_MODULE_4__material_menu_surface_foundation__["a"]; });
  13209. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Corner", function() { return __WEBPACK_IMPORTED_MODULE_3__material_menu_surface_index__["Corner"]; });
  13210. 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; }; }();
  13211. 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); } };
  13212. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13213. 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; }
  13214. 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; }
  13215. /**
  13216. * @license
  13217. * Copyright 2018 Google Inc.
  13218. *
  13219. * Permission is hereby granted, free of charge, to any person obtaining a copy
  13220. * of this software and associated documentation files (the "Software"), to deal
  13221. * in the Software without restriction, including without limitation the rights
  13222. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  13223. * copies of the Software, and to permit persons to whom the Software is
  13224. * furnished to do so, subject to the following conditions:
  13225. *
  13226. * The above copyright notice and this permission notice shall be included in
  13227. * all copies or substantial portions of the Software.
  13228. *
  13229. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13230. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  13231. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  13232. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  13233. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  13234. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  13235. * THE SOFTWARE.
  13236. */
  13237. /**
  13238. * @extends MDCComponent<!MDCMenuFoundation>
  13239. */
  13240. var MDCMenu = function (_MDCComponent) {
  13241. _inherits(MDCMenu, _MDCComponent);
  13242. /** @param {...?} args */
  13243. function MDCMenu() {
  13244. var _ref;
  13245. _classCallCheck(this, MDCMenu);
  13246. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  13247. args[_key] = arguments[_key];
  13248. }
  13249. /** @private {!MDCMenuSurface} */
  13250. var _this = _possibleConstructorReturn(this, (_ref = MDCMenu.__proto__ || Object.getPrototypeOf(MDCMenu)).call.apply(_ref, [this].concat(args)));
  13251. _this.menuSurface_;
  13252. /** @private {!MDCList} */
  13253. _this.list_;
  13254. /** @private {!Function} */
  13255. _this.handleKeydown_;
  13256. /** @private {!Function} */
  13257. _this.handleClick_;
  13258. /** @private {!Function} */
  13259. _this.afterOpenedCallback_;
  13260. return _this;
  13261. }
  13262. /**
  13263. * @param {!HTMLElement} root
  13264. * @return {!MDCMenu}
  13265. */
  13266. _createClass(MDCMenu, [{
  13267. key: 'initialize',
  13268. value: function initialize() {
  13269. var menuSurfaceFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (el) {
  13270. return new __WEBPACK_IMPORTED_MODULE_3__material_menu_surface_index__["MDCMenuSurface"](el);
  13271. };
  13272. var listFactory = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (el) {
  13273. return new __WEBPACK_IMPORTED_MODULE_5__material_list_index__["MDCList"](el);
  13274. };
  13275. this.menuSurface_ = menuSurfaceFactory(this.root_);
  13276. var list = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].LIST_SELECTOR);
  13277. if (list) {
  13278. this.list_ = listFactory(list);
  13279. this.list_.wrapFocus = true;
  13280. }
  13281. }
  13282. }, {
  13283. key: 'initialSyncWithDOM',
  13284. value: function initialSyncWithDOM() {
  13285. var _this2 = this;
  13286. this.afterOpenedCallback_ = function () {
  13287. return _this2.handleAfterOpened_();
  13288. };
  13289. this.handleKeydown_ = function (evt) {
  13290. return _this2.foundation_.handleKeydown(evt);
  13291. };
  13292. this.handleClick_ = function (evt) {
  13293. return _this2.foundation_.handleClick(evt);
  13294. };
  13295. this.menuSurface_.listen(__WEBPACK_IMPORTED_MODULE_4__material_menu_surface_foundation__["b" /* MDCMenuSurfaceFoundation */].strings.OPENED_EVENT, this.afterOpenedCallback_);
  13296. this.listen('keydown', this.handleKeydown_);
  13297. this.listen('click', this.handleClick_);
  13298. }
  13299. }, {
  13300. key: 'destroy',
  13301. value: function destroy() {
  13302. if (this.list_) {
  13303. this.list_.destroy();
  13304. }
  13305. this.menuSurface_.destroy();
  13306. this.menuSurface_.unlisten(__WEBPACK_IMPORTED_MODULE_4__material_menu_surface_foundation__["b" /* MDCMenuSurfaceFoundation */].strings.OPENED_EVENT, this.afterOpenedCallback_);
  13307. this.unlisten('keydown', this.handleKeydown_);
  13308. this.unlisten('click', this.handleClick_);
  13309. _get(MDCMenu.prototype.__proto__ || Object.getPrototypeOf(MDCMenu.prototype), 'destroy', this).call(this);
  13310. }
  13311. /** @return {boolean} */
  13312. }, {
  13313. key: 'setAnchorCorner',
  13314. /**
  13315. * @param {!Corner} corner Default anchor corner alignment of top-left
  13316. * menu corner.
  13317. */
  13318. value: function setAnchorCorner(corner) {
  13319. this.menuSurface_.setAnchorCorner(corner);
  13320. }
  13321. /**
  13322. * @param {!AnchorMargin} margin
  13323. */
  13324. }, {
  13325. key: 'setAnchorMargin',
  13326. value: function setAnchorMargin(margin) {
  13327. this.menuSurface_.setAnchorMargin(margin);
  13328. }
  13329. /**
  13330. * Return the items within the menu. Note that this only contains the set of elements within
  13331. * the items container that are proper list items, and not supplemental / presentational DOM
  13332. * elements.
  13333. * @return {!Array<!HTMLElement>}
  13334. */
  13335. }, {
  13336. key: 'getOptionByIndex',
  13337. /**
  13338. * Return the item within the menu at the index specified.
  13339. * @param {number} index
  13340. * @return {?HTMLElement}
  13341. */
  13342. value: function getOptionByIndex(index) {
  13343. var items = this.items;
  13344. if (index < items.length) {
  13345. return this.items[index];
  13346. } else {
  13347. return null;
  13348. }
  13349. }
  13350. /** @param {boolean} quickOpen */
  13351. }, {
  13352. key: 'setFixedPosition',
  13353. /** @param {boolean} isFixed */
  13354. value: function setFixedPosition(isFixed) {
  13355. this.menuSurface_.setFixedPosition(isFixed);
  13356. }
  13357. }, {
  13358. key: 'hoistMenuToBody',
  13359. value: function hoistMenuToBody() {
  13360. this.menuSurface_.hoistMenuToBody();
  13361. }
  13362. /** @param {boolean} isHoisted */
  13363. }, {
  13364. key: 'setIsHoisted',
  13365. value: function setIsHoisted(isHoisted) {
  13366. this.menuSurface_.setIsHoisted(isHoisted);
  13367. }
  13368. /**
  13369. * @param {number} x
  13370. * @param {number} y
  13371. */
  13372. }, {
  13373. key: 'setAbsolutePosition',
  13374. value: function setAbsolutePosition(x, y) {
  13375. this.menuSurface_.setAbsolutePosition(x, y);
  13376. }
  13377. /**
  13378. * Sets the element that the menu-surface is anchored to.
  13379. * @param {!HTMLElement} element
  13380. */
  13381. }, {
  13382. key: 'setAnchorElement',
  13383. value: function setAnchorElement(element) {
  13384. this.menuSurface_.anchorElement = element;
  13385. }
  13386. }, {
  13387. key: 'handleAfterOpened_',
  13388. value: function handleAfterOpened_() {
  13389. var list = this.items;
  13390. if (list.length > 0) {
  13391. list[0].focus();
  13392. }
  13393. }
  13394. /** @return {!MDCMenuFoundation} */
  13395. }, {
  13396. key: 'getDefaultFoundation',
  13397. value: function getDefaultFoundation() {
  13398. var _this3 = this;
  13399. return new __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* MDCMenuFoundation */]({
  13400. addClassToElementAtIndex: function addClassToElementAtIndex(index, className) {
  13401. var list = _this3.items;
  13402. list[index].classList.add(className);
  13403. },
  13404. removeClassFromElementAtIndex: function removeClassFromElementAtIndex(index, className) {
  13405. var list = _this3.items;
  13406. list[index].classList.remove(className);
  13407. },
  13408. addAttributeToElementAtIndex: function addAttributeToElementAtIndex(index, attr, value) {
  13409. var list = _this3.items;
  13410. list[index].setAttribute(attr, value);
  13411. },
  13412. removeAttributeFromElementAtIndex: function removeAttributeFromElementAtIndex(index, attr) {
  13413. var list = _this3.items;
  13414. list[index].removeAttribute(attr);
  13415. },
  13416. elementContainsClass: function elementContainsClass(element, className) {
  13417. return element.classList.contains(className);
  13418. },
  13419. closeSurface: function closeSurface() {
  13420. return _this3.open = false;
  13421. },
  13422. getElementIndex: function getElementIndex(element) {
  13423. return _this3.items.indexOf(element);
  13424. },
  13425. getParentElement: function getParentElement(element) {
  13426. return element.parentElement;
  13427. },
  13428. getSelectedElementIndex: function getSelectedElementIndex(selectionGroup) {
  13429. return _this3.items.indexOf(selectionGroup.querySelector('.' + __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].MENU_SELECTED_LIST_ITEM));
  13430. },
  13431. notifySelected: function notifySelected(evtData) {
  13432. return _this3.emit(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].SELECTED_EVENT, {
  13433. index: evtData.index,
  13434. item: _this3.items[evtData.index]
  13435. });
  13436. },
  13437. getCheckboxAtIndex: function getCheckboxAtIndex(index) {
  13438. var list = _this3.items;
  13439. return list[index].querySelector(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].CHECKBOX_SELECTOR);
  13440. },
  13441. toggleCheckbox: function toggleCheckbox(checkBox) {
  13442. checkBox.checked = !checkBox.checked;
  13443. var event = document.createEvent('Event');
  13444. event.initEvent('change', false, true);
  13445. checkBox.dispatchEvent(event);
  13446. }
  13447. });
  13448. }
  13449. }, {
  13450. key: 'open',
  13451. get: function get() {
  13452. return this.menuSurface_.open;
  13453. }
  13454. /** @param {boolean} value */
  13455. ,
  13456. set: function set(value) {
  13457. this.menuSurface_.open = value;
  13458. }
  13459. }, {
  13460. key: 'items',
  13461. get: function get() {
  13462. return this.list_.listElements;
  13463. }
  13464. }, {
  13465. key: 'quickOpen',
  13466. set: function set(quickOpen) {
  13467. this.menuSurface_.quickOpen = quickOpen;
  13468. }
  13469. }], [{
  13470. key: 'attachTo',
  13471. value: function attachTo(root) {
  13472. return new MDCMenu(root);
  13473. }
  13474. }]);
  13475. return MDCMenu;
  13476. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  13477. /***/ }),
  13478. /* 102 */
  13479. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13480. "use strict";
  13481. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCMenuFoundation; });
  13482. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  13483. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(103);
  13484. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(37);
  13485. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_menu_surface_foundation__ = __webpack_require__(18);
  13486. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__material_list_foundation__ = __webpack_require__(15);
  13487. 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; };
  13488. 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; }; }();
  13489. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13490. 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; }
  13491. 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; }
  13492. /**
  13493. * @license
  13494. * Copyright 2018 Google Inc.
  13495. *
  13496. * Permission is hereby granted, free of charge, to any person obtaining a copy
  13497. * of this software and associated documentation files (the "Software"), to deal
  13498. * in the Software without restriction, including without limitation the rights
  13499. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  13500. * copies of the Software, and to permit persons to whom the Software is
  13501. * furnished to do so, subject to the following conditions:
  13502. *
  13503. * The above copyright notice and this permission notice shall be included in
  13504. * all copies or substantial portions of the Software.
  13505. *
  13506. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13507. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  13508. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  13509. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  13510. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  13511. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  13512. * THE SOFTWARE.
  13513. */
  13514. var ELEMENTS_KEY_ALLOWED_IN = ['input', 'button', 'textarea', 'select'];
  13515. /**
  13516. * @extends {MDCFoundation<!MDCMenuAdapter>}
  13517. */
  13518. var MDCMenuFoundation = function (_MDCFoundation) {
  13519. _inherits(MDCMenuFoundation, _MDCFoundation);
  13520. _createClass(MDCMenuFoundation, null, [{
  13521. key: 'cssClasses',
  13522. /** @return enum{cssClasses} */
  13523. get: function get() {
  13524. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  13525. }
  13526. /** @return enum{strings} */
  13527. }, {
  13528. key: 'strings',
  13529. get: function get() {
  13530. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  13531. }
  13532. /**
  13533. * {@see MDCMenuAdapter} for typing information on parameters and return
  13534. * types.
  13535. * @return {!MDCMenuAdapter}
  13536. */
  13537. }, {
  13538. key: 'defaultAdapter',
  13539. get: function get() {
  13540. return (/** @type {!MDCMenuAdapter} */{
  13541. addClassToElementAtIndex: function addClassToElementAtIndex() {},
  13542. removeClassFromElementAtIndex: function removeClassFromElementAtIndex() {},
  13543. addAttributeToElementAtIndex: function addAttributeToElementAtIndex() {},
  13544. removeAttributeFromElementAtIndex: function removeAttributeFromElementAtIndex() {},
  13545. elementContainsClass: function elementContainsClass() {},
  13546. closeSurface: function closeSurface() {},
  13547. getElementIndex: function getElementIndex() {},
  13548. getParentElement: function getParentElement() {},
  13549. getSelectedElementIndex: function getSelectedElementIndex() {},
  13550. notifySelected: function notifySelected() {},
  13551. getCheckboxAtIndex: function getCheckboxAtIndex() {},
  13552. toggleCheckbox: function toggleCheckbox() {}
  13553. }
  13554. );
  13555. }
  13556. /** @param {!MDCMenuAdapter} adapter */
  13557. }]);
  13558. function MDCMenuFoundation(adapter) {
  13559. _classCallCheck(this, MDCMenuFoundation);
  13560. /** @type {number} */
  13561. var _this = _possibleConstructorReturn(this, (MDCMenuFoundation.__proto__ || Object.getPrototypeOf(MDCMenuFoundation)).call(this, _extends(MDCMenuFoundation.defaultAdapter, adapter)));
  13562. _this.closeAnimationEndTimerId_ = 0;
  13563. return _this;
  13564. }
  13565. _createClass(MDCMenuFoundation, [{
  13566. key: 'destroy',
  13567. value: function destroy() {
  13568. if (this.closeAnimationEndTimerId_) {
  13569. clearTimeout(this.closeAnimationEndTimerId_);
  13570. }
  13571. this.adapter_.closeSurface();
  13572. }
  13573. /**
  13574. * Handler function for the keydown events.
  13575. * @param {!Event} evt
  13576. */
  13577. }, {
  13578. key: 'handleKeydown',
  13579. value: function handleKeydown(evt) {
  13580. var key = evt.key,
  13581. keyCode = evt.keyCode;
  13582. var isSpace = key === 'Space' || keyCode === 32;
  13583. var isEnter = key === 'Enter' || keyCode === 13;
  13584. var isTab = key === 'Tab' || keyCode === 9;
  13585. if (isSpace || isEnter) {
  13586. this.handleAction_(evt);
  13587. } else if (isTab) {
  13588. this.adapter_.closeSurface();
  13589. }
  13590. }
  13591. /**
  13592. * Handler function for the click events.
  13593. * @param {!Event} evt
  13594. */
  13595. }, {
  13596. key: 'handleClick',
  13597. value: function handleClick(evt) {
  13598. this.handleAction_(evt);
  13599. }
  13600. /**
  13601. * Combined action handling for click/keypress events.
  13602. * @param {!Event} evt
  13603. * @private
  13604. */
  13605. }, {
  13606. key: 'handleAction_',
  13607. value: function handleAction_(evt) {
  13608. var listItem = this.getListItem_( /** @type {HTMLElement} */evt.target);
  13609. if (listItem) {
  13610. this.handleSelection_(listItem);
  13611. this.preventDefaultEvent_(evt);
  13612. }
  13613. }
  13614. /**
  13615. * Handler for a selected list item.
  13616. * @param {?HTMLElement} listItem
  13617. * @private
  13618. */
  13619. }, {
  13620. key: 'handleSelection_',
  13621. value: function handleSelection_(listItem) {
  13622. var _this2 = this;
  13623. var index = this.adapter_.getElementIndex(listItem);
  13624. if (index < 0) {
  13625. return;
  13626. }
  13627. this.adapter_.notifySelected({ index: index });
  13628. this.adapter_.closeSurface();
  13629. var checkbox = this.adapter_.getCheckboxAtIndex(index);
  13630. if (checkbox) {
  13631. this.adapter_.toggleCheckbox( /** @type {!HTMLElement} */checkbox);
  13632. }
  13633. // Wait for the menu to close before adding/removing classes that affect styles.
  13634. this.closeAnimationEndTimerId_ = setTimeout(function () {
  13635. var selectionGroup = _this2.getSelectionGroup_(listItem);
  13636. if (selectionGroup !== null) {
  13637. _this2.handleSelectionGroup_( /** @type {!HTMLElement} */selectionGroup, index);
  13638. }
  13639. }, __WEBPACK_IMPORTED_MODULE_3__material_menu_surface_foundation__["b" /* MDCMenuSurfaceFoundation */].numbers.TRANSITION_CLOSE_DURATION);
  13640. }
  13641. /**
  13642. * Handles toggling the selected classes in a selection group when a
  13643. * selection is made.
  13644. * @param {!HTMLElement} selectionGroup
  13645. * @param {number} index The selected index value
  13646. * @private
  13647. */
  13648. }, {
  13649. key: 'handleSelectionGroup_',
  13650. value: function handleSelectionGroup_(selectionGroup, index) {
  13651. // De-select the previous selection in this group.
  13652. var selectedIndex = this.adapter_.getSelectedElementIndex(selectionGroup);
  13653. if (selectedIndex >= 0) {
  13654. this.adapter_.removeAttributeFromElementAtIndex(selectedIndex, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_SELECTED_ATTR);
  13655. this.adapter_.removeClassFromElementAtIndex(selectedIndex, __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].MENU_SELECTED_LIST_ITEM);
  13656. }
  13657. // Select the new list item in this group.
  13658. this.adapter_.addClassToElementAtIndex(index, __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].MENU_SELECTED_LIST_ITEM);
  13659. this.adapter_.addAttributeToElementAtIndex(index, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_SELECTED_ATTR, 'true');
  13660. }
  13661. /**
  13662. * Returns the parent selection group of an element if one exists.
  13663. * @param listItem
  13664. * @return {?HTMLElement} parent selection group element or null.
  13665. * @private
  13666. */
  13667. }, {
  13668. key: 'getSelectionGroup_',
  13669. value: function getSelectionGroup_(listItem) {
  13670. var parent = this.adapter_.getParentElement(listItem);
  13671. var isGroup = this.adapter_.elementContainsClass(parent, __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].MENU_SELECTION_GROUP);
  13672. // Iterate through ancestors until we find the group or get to the list.
  13673. while (!isGroup && !this.adapter_.elementContainsClass(parent, __WEBPACK_IMPORTED_MODULE_4__material_list_foundation__["a" /* default */].cssClasses.ROOT)) {
  13674. parent = this.adapter_.getParentElement(parent);
  13675. isGroup = this.adapter_.elementContainsClass(parent, __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].MENU_SELECTION_GROUP);
  13676. }
  13677. if (isGroup) {
  13678. return parent;
  13679. } else {
  13680. return null;
  13681. }
  13682. }
  13683. /**
  13684. * Find the first ancestor with the mdc-list-item class.
  13685. * @param {?HTMLElement} target
  13686. * @return {?HTMLElement}
  13687. * @private
  13688. */
  13689. }, {
  13690. key: 'getListItem_',
  13691. value: function getListItem_(target) {
  13692. var isListItem = this.adapter_.elementContainsClass(target, __WEBPACK_IMPORTED_MODULE_4__material_list_foundation__["a" /* default */].cssClasses.LIST_ITEM_CLASS);
  13693. while (!isListItem) {
  13694. target = this.adapter_.getParentElement(target);
  13695. if (target) {
  13696. isListItem = this.adapter_.elementContainsClass(target, __WEBPACK_IMPORTED_MODULE_4__material_list_foundation__["a" /* default */].cssClasses.LIST_ITEM_CLASS);
  13697. } else {
  13698. // target has no parent element.
  13699. return null;
  13700. }
  13701. }
  13702. return target;
  13703. }
  13704. /**
  13705. * Ensures that preventDefault is only called if the containing element doesn't
  13706. * consume the event, and it will cause an unintended scroll.
  13707. * @param {!Event} evt
  13708. * @private
  13709. */
  13710. }, {
  13711. key: 'preventDefaultEvent_',
  13712. value: function preventDefaultEvent_(evt) {
  13713. var target = /** @type {!HTMLElement} */evt.target;
  13714. var tagName = ('' + target.tagName).toLowerCase();
  13715. if (ELEMENTS_KEY_ALLOWED_IN.indexOf(tagName) === -1) {
  13716. evt.preventDefault();
  13717. }
  13718. }
  13719. }]);
  13720. return MDCMenuFoundation;
  13721. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  13722. /***/ }),
  13723. /* 103 */
  13724. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13725. "use strict";
  13726. /* unused harmony export MDCMenuAdapter */
  13727. 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; }; }();
  13728. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13729. /**
  13730. * @license
  13731. * Copyright 2018 Google Inc.
  13732. *
  13733. * Permission is hereby granted, free of charge, to any person obtaining a copy
  13734. * of this software and associated documentation files (the "Software"), to deal
  13735. * in the Software without restriction, including without limitation the rights
  13736. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  13737. * copies of the Software, and to permit persons to whom the Software is
  13738. * furnished to do so, subject to the following conditions:
  13739. *
  13740. * The above copyright notice and this permission notice shall be included in
  13741. * all copies or substantial portions of the Software.
  13742. *
  13743. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13744. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  13745. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  13746. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  13747. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  13748. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  13749. * THE SOFTWARE.
  13750. */
  13751. /* eslint no-unused-vars: [2, {"args": "none"}] */
  13752. /**
  13753. * Adapter for MDC Menu. Provides an interface for managing
  13754. * - selected element classes
  13755. * - get focused elements
  13756. * - toggling a checkbox inside a list item
  13757. *
  13758. * Additionally, provides type information for the adapter to the Closure
  13759. * compiler.
  13760. *
  13761. * Implement this adapter for your framework of choice to delegate updates to
  13762. * the component in your framework of choice. See architecture documentation
  13763. * for more details.
  13764. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  13765. *
  13766. * @record
  13767. */
  13768. var MDCMenuAdapter = function () {
  13769. function MDCMenuAdapter() {
  13770. _classCallCheck(this, MDCMenuAdapter);
  13771. }
  13772. _createClass(MDCMenuAdapter, [{
  13773. key: "addClassToElementAtIndex",
  13774. /**
  13775. * Adds a class to the element at the index provided.
  13776. * @param {number} index
  13777. * @param {string} className
  13778. */
  13779. value: function addClassToElementAtIndex(index, className) {}
  13780. /**
  13781. * Removes a class from the element at the index provided
  13782. * @param {number} index
  13783. * @param {string} className
  13784. */
  13785. }, {
  13786. key: "removeClassFromElementAtIndex",
  13787. value: function removeClassFromElementAtIndex(index, className) {}
  13788. /**
  13789. * Adds an attribute, with value, to the element at the index provided.
  13790. * @param {number} index
  13791. * @param {string} attr
  13792. * @param {string} value
  13793. */
  13794. }, {
  13795. key: "addAttributeToElementAtIndex",
  13796. value: function addAttributeToElementAtIndex(index, attr, value) {}
  13797. /**
  13798. * Removes an attribute from an element at the index provided.
  13799. * @param {number} index
  13800. * @param {string} attr
  13801. */
  13802. }, {
  13803. key: "removeAttributeFromElementAtIndex",
  13804. value: function removeAttributeFromElementAtIndex(index, attr) {}
  13805. /**
  13806. * Returns true if the element contains the className.
  13807. * @param {?HTMLElement} element
  13808. * @param {string} className
  13809. * @return {boolean} true if the element contains the className
  13810. */
  13811. }, {
  13812. key: "elementContainsClass",
  13813. value: function elementContainsClass(element, className) {}
  13814. /**
  13815. * Closes the menu-surface.
  13816. */
  13817. }, {
  13818. key: "closeSurface",
  13819. value: function closeSurface() {}
  13820. /**
  13821. * Returns the index for the element provided.
  13822. * @param {?HTMLElement} element
  13823. * @return {number} index of the element in the list or -1 if it is not in the list.
  13824. */
  13825. }, {
  13826. key: "getElementIndex",
  13827. value: function getElementIndex(element) {}
  13828. /**
  13829. * Returns the parentElement of the provided element.
  13830. * @param {?HTMLElement} element
  13831. * @return {?HTMLElement} parentElement of the element provided.
  13832. */
  13833. }, {
  13834. key: "getParentElement",
  13835. value: function getParentElement(element) {}
  13836. /**
  13837. * Returns the element within the selectionGroup containing the selected element class.
  13838. * @param {!HTMLElement} selectionGroup
  13839. * @return {number} element within the selectionGroup that contains the selected element class.
  13840. */
  13841. }, {
  13842. key: "getSelectedElementIndex",
  13843. value: function getSelectedElementIndex(selectionGroup) {}
  13844. /**
  13845. * Emits an event using the evtData.
  13846. * @param {{
  13847. * index: number
  13848. * }} evtData
  13849. */
  13850. }, {
  13851. key: "notifySelected",
  13852. value: function notifySelected(evtData) {}
  13853. /**
  13854. * Returns the checkbox contained within the element at the index specified.
  13855. * @param {number} index
  13856. * @return {?HTMLElement} checkbox
  13857. */
  13858. }, {
  13859. key: "getCheckboxAtIndex",
  13860. value: function getCheckboxAtIndex(index) {}
  13861. /**
  13862. * Toggles the checkbox within a list item.
  13863. * @param {!HTMLElement} target
  13864. */
  13865. }, {
  13866. key: "toggleCheckbox",
  13867. value: function toggleCheckbox(target) {}
  13868. }]);
  13869. return MDCMenuAdapter;
  13870. }();
  13871. /***/ }),
  13872. /* 104 */
  13873. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13874. "use strict";
  13875. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  13876. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTransformPropertyName", function() { return getTransformPropertyName; });
  13877. /**
  13878. * @license
  13879. * Copyright 2018 Google Inc.
  13880. *
  13881. * Permission is hereby granted, free of charge, to any person obtaining a copy
  13882. * of this software and associated documentation files (the "Software"), to deal
  13883. * in the Software without restriction, including without limitation the rights
  13884. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  13885. * copies of the Software, and to permit persons to whom the Software is
  13886. * furnished to do so, subject to the following conditions:
  13887. *
  13888. * The above copyright notice and this permission notice shall be included in
  13889. * all copies or substantial portions of the Software.
  13890. *
  13891. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13892. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  13893. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  13894. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  13895. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  13896. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  13897. * THE SOFTWARE.
  13898. */
  13899. /** @type {string|undefined} */
  13900. var storedTransformPropertyName_ = void 0;
  13901. /**
  13902. * Returns the name of the correct transform property to use on the current browser.
  13903. * @param {!Window} globalObj
  13904. * @param {boolean=} forceRefresh
  13905. * @return {string}
  13906. */
  13907. function getTransformPropertyName(globalObj) {
  13908. var forceRefresh = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  13909. if (storedTransformPropertyName_ === undefined || forceRefresh) {
  13910. var el = globalObj.document.createElement('div');
  13911. var transformPropertyName = 'transform' in el.style ? 'transform' : 'webkitTransform';
  13912. storedTransformPropertyName_ = transformPropertyName;
  13913. }
  13914. return storedTransformPropertyName_;
  13915. }
  13916. /***/ }),
  13917. /* 105 */
  13918. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13919. "use strict";
  13920. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  13921. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(41);
  13922. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(42);
  13923. 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; };
  13924. 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; }; }();
  13925. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13926. 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; }
  13927. 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; }
  13928. /**
  13929. * @license
  13930. * Copyright 2017 Google Inc.
  13931. *
  13932. * Permission is hereby granted, free of charge, to any person obtaining a copy
  13933. * of this software and associated documentation files (the "Software"), to deal
  13934. * in the Software without restriction, including without limitation the rights
  13935. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  13936. * copies of the Software, and to permit persons to whom the Software is
  13937. * furnished to do so, subject to the following conditions:
  13938. *
  13939. * The above copyright notice and this permission notice shall be included in
  13940. * all copies or substantial portions of the Software.
  13941. *
  13942. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13943. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  13944. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  13945. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  13946. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  13947. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  13948. * THE SOFTWARE.
  13949. */
  13950. /**
  13951. * @extends {MDCFoundation<!MDCNotchedOutlineAdapter>}
  13952. * @final
  13953. */
  13954. var MDCNotchedOutlineFoundation = function (_MDCFoundation) {
  13955. _inherits(MDCNotchedOutlineFoundation, _MDCFoundation);
  13956. _createClass(MDCNotchedOutlineFoundation, null, [{
  13957. key: 'strings',
  13958. /** @return enum {string} */
  13959. get: function get() {
  13960. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  13961. }
  13962. /** @return enum {string} */
  13963. }, {
  13964. key: 'cssClasses',
  13965. get: function get() {
  13966. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  13967. }
  13968. /**
  13969. * {@see MDCNotchedOutlineAdapter} for typing information on parameters and return
  13970. * types.
  13971. * @return {!MDCNotchedOutlineAdapter}
  13972. */
  13973. }, {
  13974. key: 'defaultAdapter',
  13975. get: function get() {
  13976. return (/** @type {!MDCNotchedOutlineAdapter} */{
  13977. getWidth: function getWidth() {},
  13978. getHeight: function getHeight() {},
  13979. addClass: function addClass() {},
  13980. removeClass: function removeClass() {},
  13981. setOutlinePathAttr: function setOutlinePathAttr() {},
  13982. getIdleOutlineStyleValue: function getIdleOutlineStyleValue() {}
  13983. }
  13984. );
  13985. }
  13986. /**
  13987. * @param {!MDCNotchedOutlineAdapter} adapter
  13988. */
  13989. }]);
  13990. function MDCNotchedOutlineFoundation(adapter) {
  13991. _classCallCheck(this, MDCNotchedOutlineFoundation);
  13992. return _possibleConstructorReturn(this, (MDCNotchedOutlineFoundation.__proto__ || Object.getPrototypeOf(MDCNotchedOutlineFoundation)).call(this, _extends(MDCNotchedOutlineFoundation.defaultAdapter, adapter)));
  13993. }
  13994. /**
  13995. * Adds the outline notched selector and updates the notch width
  13996. * calculated based off of notchWidth and isRtl.
  13997. * @param {number} notchWidth
  13998. * @param {boolean=} isRtl
  13999. */
  14000. _createClass(MDCNotchedOutlineFoundation, [{
  14001. key: 'notch',
  14002. value: function notch(notchWidth) {
  14003. var isRtl = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  14004. var OUTLINE_NOTCHED = MDCNotchedOutlineFoundation.cssClasses.OUTLINE_NOTCHED;
  14005. this.adapter_.addClass(OUTLINE_NOTCHED);
  14006. this.updateSvgPath_(notchWidth, isRtl);
  14007. }
  14008. /**
  14009. * Removes notched outline selector to close the notch in the outline.
  14010. */
  14011. }, {
  14012. key: 'closeNotch',
  14013. value: function closeNotch() {
  14014. var OUTLINE_NOTCHED = MDCNotchedOutlineFoundation.cssClasses.OUTLINE_NOTCHED;
  14015. this.adapter_.removeClass(OUTLINE_NOTCHED);
  14016. }
  14017. /**
  14018. * Updates the SVG path of the focus outline element based on the notchWidth
  14019. * and the RTL context.
  14020. * @param {number} notchWidth
  14021. * @param {boolean=} isRtl
  14022. * @private
  14023. */
  14024. }, {
  14025. key: 'updateSvgPath_',
  14026. value: function updateSvgPath_(notchWidth, isRtl) {
  14027. // Fall back to reading a specific corner's style because Firefox doesn't report the style on border-radius.
  14028. var radiusStyleValue = this.adapter_.getIdleOutlineStyleValue('border-radius') || this.adapter_.getIdleOutlineStyleValue('border-top-left-radius');
  14029. var radius = parseFloat(radiusStyleValue);
  14030. var width = this.adapter_.getWidth();
  14031. var height = this.adapter_.getHeight();
  14032. var cornerWidth = radius + 1.2;
  14033. var leadingStrokeLength = Math.abs(12 - cornerWidth);
  14034. // If the notchWidth is 0, the the notched outline doesn't need to add padding.
  14035. var paddedNotchWidth = 0;
  14036. if (notchWidth > 0) {
  14037. paddedNotchWidth = notchWidth + 8;
  14038. }
  14039. // The right, bottom, and left sides of the outline follow the same SVG path.
  14040. 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;
  14041. var path = void 0;
  14042. if (!isRtl) {
  14043. path = 'M' + (cornerWidth + leadingStrokeLength + paddedNotchWidth) + ',' + 1 + 'h' + (width - 2 * cornerWidth - paddedNotchWidth - leadingStrokeLength) + pathMiddle + 'h' + leadingStrokeLength;
  14044. } else {
  14045. path = 'M' + (width - cornerWidth - leadingStrokeLength) + ',' + 1 + 'h' + leadingStrokeLength + pathMiddle + 'h' + (width - 2 * cornerWidth - paddedNotchWidth - leadingStrokeLength);
  14046. }
  14047. this.adapter_.setOutlinePathAttr(path);
  14048. }
  14049. }]);
  14050. return MDCNotchedOutlineFoundation;
  14051. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  14052. /* harmony default export */ __webpack_exports__["a"] = (MDCNotchedOutlineFoundation);
  14053. /***/ }),
  14054. /* 106 */
  14055. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14056. "use strict";
  14057. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  14058. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCRadio", function() { return MDCRadio; });
  14059. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  14060. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_selection_control_index__ = __webpack_require__(4);
  14061. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(107);
  14062. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_ripple_index__ = __webpack_require__(2);
  14063. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCRadioFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  14064. 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; };
  14065. 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); } };
  14066. 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; }; }();
  14067. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  14068. 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; }
  14069. 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; }
  14070. /**
  14071. * @license
  14072. * Copyright 2016 Google Inc.
  14073. *
  14074. * Permission is hereby granted, free of charge, to any person obtaining a copy
  14075. * of this software and associated documentation files (the "Software"), to deal
  14076. * in the Software without restriction, including without limitation the rights
  14077. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  14078. * copies of the Software, and to permit persons to whom the Software is
  14079. * furnished to do so, subject to the following conditions:
  14080. *
  14081. * The above copyright notice and this permission notice shall be included in
  14082. * all copies or substantial portions of the Software.
  14083. *
  14084. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14085. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14086. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  14087. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  14088. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  14089. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  14090. * THE SOFTWARE.
  14091. */
  14092. /* eslint-disable no-unused-vars */
  14093. /* eslint-enable no-unused-vars */
  14094. /**
  14095. * @extends MDCComponent<!MDCRadioFoundation>
  14096. * @implements {MDCSelectionControl}
  14097. */
  14098. var MDCRadio = function (_MDCComponent) {
  14099. _inherits(MDCRadio, _MDCComponent);
  14100. _createClass(MDCRadio, [{
  14101. key: 'checked',
  14102. /** @return {boolean} */
  14103. get: function get() {
  14104. return this.foundation_.isChecked();
  14105. }
  14106. /** @param {boolean} checked */
  14107. ,
  14108. set: function set(checked) {
  14109. this.foundation_.setChecked(checked);
  14110. }
  14111. /** @return {boolean} */
  14112. }, {
  14113. key: 'disabled',
  14114. get: function get() {
  14115. return this.foundation_.isDisabled();
  14116. }
  14117. /** @param {boolean} disabled */
  14118. ,
  14119. set: function set(disabled) {
  14120. this.foundation_.setDisabled(disabled);
  14121. }
  14122. /** @return {?string} */
  14123. }, {
  14124. key: 'value',
  14125. get: function get() {
  14126. return this.foundation_.getValue();
  14127. }
  14128. /** @param {?string} value */
  14129. ,
  14130. set: function set(value) {
  14131. this.foundation_.setValue(value);
  14132. }
  14133. /** @return {!MDCRipple} */
  14134. }, {
  14135. key: 'ripple',
  14136. get: function get() {
  14137. return this.ripple_;
  14138. }
  14139. }], [{
  14140. key: 'attachTo',
  14141. value: function attachTo(root) {
  14142. return new MDCRadio(root);
  14143. }
  14144. }]);
  14145. function MDCRadio() {
  14146. var _ref;
  14147. _classCallCheck(this, MDCRadio);
  14148. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  14149. args[_key] = arguments[_key];
  14150. }
  14151. /** @private {!MDCRipple} */
  14152. var _this = _possibleConstructorReturn(this, (_ref = MDCRadio.__proto__ || Object.getPrototypeOf(MDCRadio)).call.apply(_ref, [this].concat(args)));
  14153. _this.ripple_ = _this.initRipple_();
  14154. return _this;
  14155. }
  14156. /**
  14157. * @return {!MDCRipple}
  14158. * @private
  14159. */
  14160. _createClass(MDCRadio, [{
  14161. key: 'initRipple_',
  14162. value: function initRipple_() {
  14163. var _this2 = this;
  14164. var adapter = _extends(__WEBPACK_IMPORTED_MODULE_3__material_ripple_index__["MDCRipple"].createAdapter(this), {
  14165. isUnbounded: function isUnbounded() {
  14166. return true;
  14167. },
  14168. // Radio buttons technically go "active" whenever there is *any* keyboard interaction. This is not the
  14169. // UI we desire.
  14170. isSurfaceActive: function isSurfaceActive() {
  14171. return false;
  14172. },
  14173. registerInteractionHandler: function registerInteractionHandler(type, handler) {
  14174. return _this2.nativeControl_.addEventListener(type, handler);
  14175. },
  14176. deregisterInteractionHandler: function deregisterInteractionHandler(type, handler) {
  14177. return _this2.nativeControl_.removeEventListener(type, handler);
  14178. }
  14179. });
  14180. var foundation = new __WEBPACK_IMPORTED_MODULE_3__material_ripple_index__["MDCRippleFoundation"](adapter);
  14181. return new __WEBPACK_IMPORTED_MODULE_3__material_ripple_index__["MDCRipple"](this.root_, foundation);
  14182. }
  14183. /**
  14184. * Returns the state of the native control element, or null if the native control element is not present.
  14185. * @return {?MDCSelectionControlState}
  14186. * @private
  14187. */
  14188. }, {
  14189. key: 'destroy',
  14190. value: function destroy() {
  14191. this.ripple_.destroy();
  14192. _get(MDCRadio.prototype.__proto__ || Object.getPrototypeOf(MDCRadio.prototype), 'destroy', this).call(this);
  14193. }
  14194. /** @return {!MDCRadioFoundation} */
  14195. }, {
  14196. key: 'getDefaultFoundation',
  14197. value: function getDefaultFoundation() {
  14198. var _this3 = this;
  14199. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]({
  14200. addClass: function addClass(className) {
  14201. return _this3.root_.classList.add(className);
  14202. },
  14203. removeClass: function removeClass(className) {
  14204. return _this3.root_.classList.remove(className);
  14205. },
  14206. getNativeControl: function getNativeControl() {
  14207. return _this3.root_.querySelector(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.NATIVE_CONTROL_SELECTOR);
  14208. }
  14209. });
  14210. }
  14211. }, {
  14212. key: 'nativeControl_',
  14213. get: function get() {
  14214. var NATIVE_CONTROL_SELECTOR = __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.NATIVE_CONTROL_SELECTOR;
  14215. var el = /** @type {?MDCSelectionControlState} */this.root_.querySelector(NATIVE_CONTROL_SELECTOR);
  14216. return el;
  14217. }
  14218. }]);
  14219. return MDCRadio;
  14220. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  14221. /***/ }),
  14222. /* 107 */
  14223. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14224. "use strict";
  14225. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  14226. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_selection_control_index__ = __webpack_require__(4);
  14227. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__adapter__ = __webpack_require__(108);
  14228. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__constants__ = __webpack_require__(109);
  14229. 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; }; }();
  14230. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  14231. 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; }
  14232. 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; }
  14233. /**
  14234. * @license
  14235. * Copyright 2016 Google Inc.
  14236. *
  14237. * Permission is hereby granted, free of charge, to any person obtaining a copy
  14238. * of this software and associated documentation files (the "Software"), to deal
  14239. * in the Software without restriction, including without limitation the rights
  14240. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  14241. * copies of the Software, and to permit persons to whom the Software is
  14242. * furnished to do so, subject to the following conditions:
  14243. *
  14244. * The above copyright notice and this permission notice shall be included in
  14245. * all copies or substantial portions of the Software.
  14246. *
  14247. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14248. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14249. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  14250. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  14251. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  14252. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  14253. * THE SOFTWARE.
  14254. */
  14255. /* eslint-disable no-unused-vars */
  14256. /* eslint-enable no-unused-vars */
  14257. /**
  14258. * @extends {MDCFoundation<!MDCRadioAdapter>}
  14259. */
  14260. var MDCRadioFoundation = function (_MDCFoundation) {
  14261. _inherits(MDCRadioFoundation, _MDCFoundation);
  14262. function MDCRadioFoundation() {
  14263. _classCallCheck(this, MDCRadioFoundation);
  14264. return _possibleConstructorReturn(this, (MDCRadioFoundation.__proto__ || Object.getPrototypeOf(MDCRadioFoundation)).apply(this, arguments));
  14265. }
  14266. _createClass(MDCRadioFoundation, [{
  14267. key: 'isChecked',
  14268. /** @return {boolean} */
  14269. value: function isChecked() {
  14270. return this.getNativeControl_().checked;
  14271. }
  14272. /** @param {boolean} checked */
  14273. }, {
  14274. key: 'setChecked',
  14275. value: function setChecked(checked) {
  14276. this.getNativeControl_().checked = checked;
  14277. }
  14278. /** @return {boolean} */
  14279. }, {
  14280. key: 'isDisabled',
  14281. value: function isDisabled() {
  14282. return this.getNativeControl_().disabled;
  14283. }
  14284. /** @param {boolean} disabled */
  14285. }, {
  14286. key: 'setDisabled',
  14287. value: function setDisabled(disabled) {
  14288. var DISABLED = MDCRadioFoundation.cssClasses.DISABLED;
  14289. this.getNativeControl_().disabled = disabled;
  14290. if (disabled) {
  14291. this.adapter_.addClass(DISABLED);
  14292. } else {
  14293. this.adapter_.removeClass(DISABLED);
  14294. }
  14295. }
  14296. /** @return {?string} */
  14297. }, {
  14298. key: 'getValue',
  14299. value: function getValue() {
  14300. return this.getNativeControl_().value;
  14301. }
  14302. /** @param {?string} value */
  14303. }, {
  14304. key: 'setValue',
  14305. value: function setValue(value) {
  14306. this.getNativeControl_().value = value;
  14307. }
  14308. /**
  14309. * @return {!MDCSelectionControlState}
  14310. * @private
  14311. */
  14312. }, {
  14313. key: 'getNativeControl_',
  14314. value: function getNativeControl_() {
  14315. return this.adapter_.getNativeControl() || {
  14316. checked: false,
  14317. disabled: false,
  14318. value: null
  14319. };
  14320. }
  14321. }], [{
  14322. key: 'cssClasses',
  14323. /** @return enum {cssClasses} */
  14324. get: function get() {
  14325. return __WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */];
  14326. }
  14327. /** @return enum {strings} */
  14328. }, {
  14329. key: 'strings',
  14330. get: function get() {
  14331. return __WEBPACK_IMPORTED_MODULE_3__constants__["b" /* strings */];
  14332. }
  14333. /** @return {!MDCRadioAdapter} */
  14334. }, {
  14335. key: 'defaultAdapter',
  14336. get: function get() {
  14337. return (/** @type {!MDCRadioAdapter} */{
  14338. addClass: function addClass() /* className: string */{},
  14339. removeClass: function removeClass() /* className: string */{},
  14340. getNativeControl: function getNativeControl() /* !MDCSelectionControlState */{}
  14341. }
  14342. );
  14343. }
  14344. }]);
  14345. return MDCRadioFoundation;
  14346. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  14347. /* harmony default export */ __webpack_exports__["a"] = (MDCRadioFoundation);
  14348. /***/ }),
  14349. /* 108 */
  14350. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14351. "use strict";
  14352. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_selection_control_index__ = __webpack_require__(4);
  14353. 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; }; }();
  14354. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  14355. /**
  14356. * @license
  14357. * Copyright 2016 Google Inc.
  14358. *
  14359. * Permission is hereby granted, free of charge, to any person obtaining a copy
  14360. * of this software and associated documentation files (the "Software"), to deal
  14361. * in the Software without restriction, including without limitation the rights
  14362. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  14363. * copies of the Software, and to permit persons to whom the Software is
  14364. * furnished to do so, subject to the following conditions:
  14365. *
  14366. * The above copyright notice and this permission notice shall be included in
  14367. * all copies or substantial portions of the Software.
  14368. *
  14369. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14370. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14371. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  14372. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  14373. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  14374. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  14375. * THE SOFTWARE.
  14376. */
  14377. /* eslint-disable no-unused-vars */
  14378. /* eslint no-unused-vars: [2, {"args": "none"}] */
  14379. /**
  14380. * Adapter for MDC Radio. Provides an interface for managing
  14381. * - classes
  14382. * - dom
  14383. *
  14384. * Additionally, provides type information for the adapter to the Closure
  14385. * compiler.
  14386. *
  14387. * Implement this adapter for your framework of choice to delegate updates to
  14388. * the component in your framework of choice. See architecture documentation
  14389. * for more details.
  14390. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  14391. *
  14392. * @record
  14393. */
  14394. var MDCRadioAdapter = function () {
  14395. function MDCRadioAdapter() {
  14396. _classCallCheck(this, MDCRadioAdapter);
  14397. }
  14398. _createClass(MDCRadioAdapter, [{
  14399. key: 'addClass',
  14400. /** @param {string} className */
  14401. value: function addClass(className) {}
  14402. /** @param {string} className */
  14403. }, {
  14404. key: 'removeClass',
  14405. value: function removeClass(className) {}
  14406. /** @return {!MDCSelectionControlState} */
  14407. }, {
  14408. key: 'getNativeControl',
  14409. value: function getNativeControl() {}
  14410. }]);
  14411. return MDCRadioAdapter;
  14412. }();
  14413. /* unused harmony default export */ var _unused_webpack_default_export = (MDCRadioAdapter);
  14414. /***/ }),
  14415. /* 109 */
  14416. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14417. "use strict";
  14418. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  14419. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  14420. /**
  14421. * @license
  14422. * Copyright 2016 Google Inc.
  14423. *
  14424. * Permission is hereby granted, free of charge, to any person obtaining a copy
  14425. * of this software and associated documentation files (the "Software"), to deal
  14426. * in the Software without restriction, including without limitation the rights
  14427. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  14428. * copies of the Software, and to permit persons to whom the Software is
  14429. * furnished to do so, subject to the following conditions:
  14430. *
  14431. * The above copyright notice and this permission notice shall be included in
  14432. * all copies or substantial portions of the Software.
  14433. *
  14434. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14435. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14436. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  14437. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  14438. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  14439. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  14440. * THE SOFTWARE.
  14441. */
  14442. /** @enum {string} */
  14443. var strings = {
  14444. NATIVE_CONTROL_SELECTOR: '.mdc-radio__native-control'
  14445. };
  14446. /** @enum {string} */
  14447. var cssClasses = {
  14448. ROOT: 'mdc-radio',
  14449. DISABLED: 'mdc-radio--disabled'
  14450. };
  14451. /***/ }),
  14452. /* 110 */
  14453. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14454. "use strict";
  14455. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  14456. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSelect", function() { return MDCSelect; });
  14457. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_index__ = __webpack_require__(3);
  14458. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_floating_label_index__ = __webpack_require__(16);
  14459. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_line_ripple_index__ = __webpack_require__(17);
  14460. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_ripple_index__ = __webpack_require__(2);
  14461. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__material_notched_outline_index__ = __webpack_require__(19);
  14462. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__foundation__ = __webpack_require__(111);
  14463. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__adapter__ = __webpack_require__(43);
  14464. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__constants__ = __webpack_require__(44);
  14465. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSelectFoundation", function() { return __WEBPACK_IMPORTED_MODULE_5__foundation__["a"]; });
  14466. 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; };
  14467. 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; }; }();
  14468. 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); } };
  14469. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  14470. 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; }
  14471. 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; }
  14472. /**
  14473. * @license
  14474. * Copyright 2016 Google Inc.
  14475. *
  14476. * Permission is hereby granted, free of charge, to any person obtaining a copy
  14477. * of this software and associated documentation files (the "Software"), to deal
  14478. * in the Software without restriction, including without limitation the rights
  14479. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  14480. * copies of the Software, and to permit persons to whom the Software is
  14481. * furnished to do so, subject to the following conditions:
  14482. *
  14483. * The above copyright notice and this permission notice shall be included in
  14484. * all copies or substantial portions of the Software.
  14485. *
  14486. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14487. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14488. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  14489. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  14490. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  14491. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  14492. * THE SOFTWARE.
  14493. */
  14494. /**
  14495. * @extends MDCComponent<!MDCSelectFoundation>
  14496. */
  14497. var MDCSelect = function (_MDCComponent) {
  14498. _inherits(MDCSelect, _MDCComponent);
  14499. /**
  14500. * @param {...?} args
  14501. */
  14502. function MDCSelect() {
  14503. var _ref;
  14504. _classCallCheck(this, MDCSelect);
  14505. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  14506. args[_key] = arguments[_key];
  14507. }
  14508. /** @private {?Element} */
  14509. var _this = _possibleConstructorReturn(this, (_ref = MDCSelect.__proto__ || Object.getPrototypeOf(MDCSelect)).call.apply(_ref, [this].concat(args)));
  14510. _this.nativeControl_;
  14511. /** @type {?MDCRipple} */
  14512. _this.ripple;
  14513. /** @private {?MDCLineRipple} */
  14514. _this.lineRipple_;
  14515. /** @private {?MDCFloatingLabel} */
  14516. _this.label_;
  14517. /** @private {?MDCNotchedOutline} */
  14518. _this.outline_;
  14519. /** @private {!Function} */
  14520. _this.handleChange_;
  14521. /** @private {!Function} */
  14522. _this.handleFocus_;
  14523. /** @private {!Function} */
  14524. _this.handleBlur_;
  14525. /** @private {!Function} */
  14526. _this.handleClick_;
  14527. return _this;
  14528. }
  14529. /**
  14530. * @param {!Element} root
  14531. * @return {!MDCSelect}
  14532. */
  14533. _createClass(MDCSelect, [{
  14534. key: 'layout',
  14535. /**
  14536. * Recomputes the outline SVG path for the outline element.
  14537. */
  14538. value: function layout() {
  14539. var openNotch = this.nativeControl_.value.length > 0;
  14540. this.foundation_.notchOutline(openNotch);
  14541. }
  14542. /**
  14543. * @param {(function(!Element): !MDCLineRipple)=} lineRippleFactory A function which creates a new MDCLineRipple.
  14544. * @param {(function(!Element): !MDCFloatingLabel)=} labelFactory A function which creates a new MDCFloatingLabel.
  14545. * @param {(function(!Element): !MDCNotchedOutline)=} outlineFactory A function which creates a new MDCNotchedOutline.
  14546. */
  14547. }, {
  14548. key: 'initialize',
  14549. value: function initialize() {
  14550. var labelFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (el) {
  14551. return new __WEBPACK_IMPORTED_MODULE_1__material_floating_label_index__["MDCFloatingLabel"](el);
  14552. };
  14553. var lineRippleFactory = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (el) {
  14554. return new __WEBPACK_IMPORTED_MODULE_2__material_line_ripple_index__["MDCLineRipple"](el);
  14555. };
  14556. var outlineFactory = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function (el) {
  14557. return new __WEBPACK_IMPORTED_MODULE_4__material_notched_outline_index__["MDCNotchedOutline"](el);
  14558. };
  14559. this.nativeControl_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].NATIVE_CONTROL_SELECTOR);
  14560. var labelElement = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].LABEL_SELECTOR);
  14561. if (labelElement) {
  14562. this.label_ = labelFactory(labelElement);
  14563. }
  14564. var lineRippleElement = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].LINE_RIPPLE_SELECTOR);
  14565. if (lineRippleElement) {
  14566. this.lineRipple_ = lineRippleFactory(lineRippleElement);
  14567. }
  14568. var outlineElement = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].OUTLINE_SELECTOR);
  14569. if (outlineElement) {
  14570. this.outline_ = outlineFactory(outlineElement);
  14571. }
  14572. if (!this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_7__constants__["a" /* cssClasses */].OUTLINED)) {
  14573. this.ripple = this.initRipple_();
  14574. }
  14575. }
  14576. /**
  14577. * @private
  14578. * @return {!MDCRipple}
  14579. */
  14580. }, {
  14581. key: 'initRipple_',
  14582. value: function initRipple_() {
  14583. var _this2 = this;
  14584. var adapter = _extends(__WEBPACK_IMPORTED_MODULE_3__material_ripple_index__["MDCRipple"].createAdapter(this), {
  14585. registerInteractionHandler: function registerInteractionHandler(type, handler) {
  14586. return _this2.nativeControl_.addEventListener(type, handler);
  14587. },
  14588. deregisterInteractionHandler: function deregisterInteractionHandler(type, handler) {
  14589. return _this2.nativeControl_.removeEventListener(type, handler);
  14590. }
  14591. });
  14592. var foundation = new __WEBPACK_IMPORTED_MODULE_3__material_ripple_index__["MDCRippleFoundation"](adapter);
  14593. return new __WEBPACK_IMPORTED_MODULE_3__material_ripple_index__["MDCRipple"](this.root_, foundation);
  14594. }
  14595. /**
  14596. * Initializes the select's event listeners and internal state based
  14597. * on the environment's state.
  14598. */
  14599. }, {
  14600. key: 'initialSyncWithDOM',
  14601. value: function initialSyncWithDOM() {
  14602. var _this3 = this;
  14603. this.handleChange_ = function () {
  14604. return _this3.foundation_.handleChange();
  14605. };
  14606. this.handleFocus_ = function () {
  14607. return _this3.foundation_.handleFocus();
  14608. };
  14609. this.handleBlur_ = function () {
  14610. return _this3.foundation_.handleBlur();
  14611. };
  14612. this.handleClick_ = function (evt) {
  14613. return _this3.setTransformOrigin_(evt);
  14614. };
  14615. this.nativeControl_.addEventListener('change', this.handleChange_);
  14616. this.nativeControl_.addEventListener('focus', this.handleFocus_);
  14617. this.nativeControl_.addEventListener('blur', this.handleBlur_);
  14618. if (this.lineRipple_) {
  14619. ['mousedown', 'touchstart'].forEach(function (evtType) {
  14620. _this3.nativeControl_.addEventListener(evtType, _this3.handleClick_);
  14621. });
  14622. }
  14623. // Initially sync floating label
  14624. this.foundation_.handleChange();
  14625. if (this.nativeControl_.disabled) {
  14626. this.disabled = true;
  14627. }
  14628. }
  14629. }, {
  14630. key: 'destroy',
  14631. value: function destroy() {
  14632. var _this4 = this;
  14633. this.nativeControl_.removeEventListener('change', this.handleChange_);
  14634. this.nativeControl_.removeEventListener('focus', this.handleFocus_);
  14635. this.nativeControl_.removeEventListener('blur', this.handleBlur_);
  14636. ['mousedown', 'touchstart'].forEach(function (evtType) {
  14637. _this4.nativeControl_.removeEventListener(evtType, _this4.handleClick_);
  14638. });
  14639. if (this.ripple) {
  14640. this.ripple.destroy();
  14641. }
  14642. if (this.outline_) {
  14643. this.outline_.destroy();
  14644. }
  14645. _get(MDCSelect.prototype.__proto__ || Object.getPrototypeOf(MDCSelect.prototype), 'destroy', this).call(this);
  14646. }
  14647. /**
  14648. * @return {!MDCSelectFoundation}
  14649. */
  14650. }, {
  14651. key: 'getDefaultFoundation',
  14652. value: function getDefaultFoundation() {
  14653. var _this5 = this;
  14654. return new __WEBPACK_IMPORTED_MODULE_5__foundation__["a" /* default */](
  14655. /** @type {!MDCSelectAdapter} */_extends({
  14656. addClass: function addClass(className) {
  14657. return _this5.root_.classList.add(className);
  14658. },
  14659. removeClass: function removeClass(className) {
  14660. return _this5.root_.classList.remove(className);
  14661. },
  14662. hasClass: function hasClass(className) {
  14663. return _this5.root_.classList.contains(className);
  14664. },
  14665. getValue: function getValue() {
  14666. return _this5.nativeControl_.value;
  14667. },
  14668. isRtl: function isRtl() {
  14669. return window.getComputedStyle(_this5.root_).getPropertyValue('direction') === 'rtl';
  14670. },
  14671. activateBottomLine: function activateBottomLine() {
  14672. if (_this5.lineRipple_) {
  14673. _this5.lineRipple_.activate();
  14674. }
  14675. },
  14676. deactivateBottomLine: function deactivateBottomLine() {
  14677. if (_this5.lineRipple_) {
  14678. _this5.lineRipple_.deactivate();
  14679. }
  14680. }
  14681. }, this.getOutlineAdapterMethods_(), this.getLabelAdapterMethods_()));
  14682. }
  14683. /**
  14684. * @return {!{
  14685. * hasOutline: function(): boolean,
  14686. * notchOutline: function(number, boolean): undefined,
  14687. * closeOutline: function(): undefined,
  14688. * }}
  14689. */
  14690. }, {
  14691. key: 'getOutlineAdapterMethods_',
  14692. value: function getOutlineAdapterMethods_() {
  14693. var _this6 = this;
  14694. return {
  14695. hasOutline: function hasOutline() {
  14696. return !!_this6.outline_;
  14697. },
  14698. notchOutline: function notchOutline(labelWidth, isRtl) {
  14699. if (_this6.outline_) {
  14700. _this6.outline_.notch(labelWidth, isRtl);
  14701. }
  14702. },
  14703. closeOutline: function closeOutline() {
  14704. if (_this6.outline_) {
  14705. _this6.outline_.closeNotch();
  14706. }
  14707. }
  14708. };
  14709. }
  14710. /**
  14711. * @return {!{
  14712. * hasLabel: function(): boolean,
  14713. * floatLabel: function(boolean): undefined,
  14714. * getLabelWidth: function(): number,
  14715. * }}
  14716. */
  14717. }, {
  14718. key: 'getLabelAdapterMethods_',
  14719. value: function getLabelAdapterMethods_() {
  14720. var _this7 = this;
  14721. return {
  14722. hasLabel: function hasLabel() {
  14723. return !!_this7.label_;
  14724. },
  14725. floatLabel: function floatLabel(shouldFloat) {
  14726. if (_this7.label_) {
  14727. _this7.label_.float(shouldFloat);
  14728. }
  14729. },
  14730. getLabelWidth: function getLabelWidth() {
  14731. return _this7.label_ ? _this7.label_.getWidth() : 0;
  14732. }
  14733. };
  14734. }
  14735. /**
  14736. * Sets the line ripple's transform origin, so that the line ripple activate
  14737. * animation will animate out from the user's click location.
  14738. * @param {!(MouseEvent|TouchEvent)} evt
  14739. */
  14740. }, {
  14741. key: 'setTransformOrigin_',
  14742. value: function setTransformOrigin_(evt) {
  14743. var targetClientRect = evt.target.getBoundingClientRect();
  14744. var xCoordinate = evt.clientX;
  14745. var normalizedX = xCoordinate - targetClientRect.left;
  14746. this.lineRipple_.setRippleCenter(normalizedX);
  14747. }
  14748. }, {
  14749. key: 'value',
  14750. /**
  14751. * @return {string} The value of the select.
  14752. */
  14753. get: function get() {
  14754. return this.nativeControl_.value;
  14755. }
  14756. /**
  14757. * @param {string} value The value to set on the select.
  14758. */
  14759. ,
  14760. set: function set(value) {
  14761. this.nativeControl_.value = value;
  14762. this.foundation_.handleChange();
  14763. }
  14764. /**
  14765. * @return {number} The selected index of the select.
  14766. */
  14767. }, {
  14768. key: 'selectedIndex',
  14769. get: function get() {
  14770. return this.nativeControl_.selectedIndex;
  14771. }
  14772. /**
  14773. * @param {number} selectedIndex The index of the option to be set on the select.
  14774. */
  14775. ,
  14776. set: function set(selectedIndex) {
  14777. this.nativeControl_.selectedIndex = selectedIndex;
  14778. this.foundation_.handleChange();
  14779. }
  14780. /**
  14781. * @return {boolean} True if the select is disabled.
  14782. */
  14783. }, {
  14784. key: 'disabled',
  14785. get: function get() {
  14786. return this.nativeControl_.disabled;
  14787. }
  14788. /**
  14789. * @param {boolean} disabled Sets the select disabled or enabled.
  14790. */
  14791. ,
  14792. set: function set(disabled) {
  14793. this.nativeControl_.disabled = disabled;
  14794. this.foundation_.updateDisabledStyle(disabled);
  14795. }
  14796. }], [{
  14797. key: 'attachTo',
  14798. value: function attachTo(root) {
  14799. return new MDCSelect(root);
  14800. }
  14801. }]);
  14802. return MDCSelect;
  14803. }(__WEBPACK_IMPORTED_MODULE_0__material_base_index__["MDCComponent"]);
  14804. /***/ }),
  14805. /* 111 */
  14806. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14807. "use strict";
  14808. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_index__ = __webpack_require__(3);
  14809. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(43);
  14810. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(44);
  14811. 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; };
  14812. 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; }; }();
  14813. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  14814. 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; }
  14815. 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; }
  14816. /**
  14817. * @license
  14818. * Copyright 2016 Google Inc.
  14819. *
  14820. * Permission is hereby granted, free of charge, to any person obtaining a copy
  14821. * of this software and associated documentation files (the "Software"), to deal
  14822. * in the Software without restriction, including without limitation the rights
  14823. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  14824. * copies of the Software, and to permit persons to whom the Software is
  14825. * furnished to do so, subject to the following conditions:
  14826. *
  14827. * The above copyright notice and this permission notice shall be included in
  14828. * all copies or substantial portions of the Software.
  14829. *
  14830. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14831. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14832. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  14833. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  14834. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  14835. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  14836. * THE SOFTWARE.
  14837. */
  14838. /* eslint-disable no-unused-vars */
  14839. /* eslint-enable no-unused-vars */
  14840. /**
  14841. * @extends {MDCFoundation<!MDCSelectAdapter>}
  14842. * @final
  14843. */
  14844. var MDCSelectFoundation = function (_MDCFoundation) {
  14845. _inherits(MDCSelectFoundation, _MDCFoundation);
  14846. _createClass(MDCSelectFoundation, null, [{
  14847. key: 'cssClasses',
  14848. /** @return enum {string} */
  14849. get: function get() {
  14850. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  14851. }
  14852. /** @return enum {number} */
  14853. }, {
  14854. key: 'numbers',
  14855. get: function get() {
  14856. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */];
  14857. }
  14858. /** @return enum {string} */
  14859. }, {
  14860. key: 'strings',
  14861. get: function get() {
  14862. return __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */];
  14863. }
  14864. /**
  14865. * {@see MDCSelectAdapter} for typing information on parameters and return
  14866. * types.
  14867. * @return {!MDCSelectAdapter}
  14868. */
  14869. }, {
  14870. key: 'defaultAdapter',
  14871. get: function get() {
  14872. return (/** @type {!MDCSelectAdapter} */{
  14873. addClass: function addClass() /* className: string */{},
  14874. removeClass: function removeClass() /* className: string */{},
  14875. hasClass: function hasClass() {
  14876. return (/* className: string */false
  14877. );
  14878. },
  14879. activateBottomLine: function activateBottomLine() {},
  14880. deactivateBottomLine: function deactivateBottomLine() {},
  14881. getValue: function getValue() {},
  14882. isRtl: function isRtl() {
  14883. return false;
  14884. },
  14885. hasLabel: function hasLabel() {
  14886. return false;
  14887. },
  14888. floatLabel: function floatLabel() /* value: boolean */{},
  14889. getLabelWidth: function getLabelWidth() {},
  14890. hasOutline: function hasOutline() {
  14891. return false;
  14892. },
  14893. notchOutline: function notchOutline() /* labelWidth: number, isRtl: boolean */{},
  14894. closeOutline: function closeOutline() {}
  14895. }
  14896. );
  14897. }
  14898. /**
  14899. * @param {!MDCSelectAdapter} adapter
  14900. */
  14901. }]);
  14902. function MDCSelectFoundation(adapter) {
  14903. _classCallCheck(this, MDCSelectFoundation);
  14904. return _possibleConstructorReturn(this, (MDCSelectFoundation.__proto__ || Object.getPrototypeOf(MDCSelectFoundation)).call(this, _extends(MDCSelectFoundation.defaultAdapter, adapter)));
  14905. }
  14906. /**
  14907. * Updates the styles of the select to show the disasbled state.
  14908. * @param {boolean} disabled
  14909. */
  14910. _createClass(MDCSelectFoundation, [{
  14911. key: 'updateDisabledStyle',
  14912. value: function updateDisabledStyle(disabled) {
  14913. var DISABLED = MDCSelectFoundation.cssClasses.DISABLED;
  14914. if (disabled) {
  14915. this.adapter_.addClass(DISABLED);
  14916. } else {
  14917. this.adapter_.removeClass(DISABLED);
  14918. }
  14919. }
  14920. /**
  14921. * Handles value changes, via change event or programmatic updates.
  14922. */
  14923. }, {
  14924. key: 'handleChange',
  14925. value: function handleChange() {
  14926. var optionHasValue = this.adapter_.getValue().length > 0;
  14927. this.adapter_.floatLabel(optionHasValue);
  14928. this.notchOutline(optionHasValue);
  14929. }
  14930. /**
  14931. * Handles focus events from root element.
  14932. */
  14933. }, {
  14934. key: 'handleFocus',
  14935. value: function handleFocus() {
  14936. this.adapter_.floatLabel(true);
  14937. this.notchOutline(true);
  14938. this.adapter_.activateBottomLine();
  14939. }
  14940. /**
  14941. * Handles blur events from root element.
  14942. */
  14943. }, {
  14944. key: 'handleBlur',
  14945. value: function handleBlur() {
  14946. this.handleChange();
  14947. this.adapter_.deactivateBottomLine();
  14948. }
  14949. /**
  14950. * Opens/closes the notched outline.
  14951. * @param {boolean} openNotch
  14952. */
  14953. }, {
  14954. key: 'notchOutline',
  14955. value: function notchOutline(openNotch) {
  14956. if (!this.adapter_.hasOutline()) {
  14957. return;
  14958. }
  14959. if (openNotch) {
  14960. var labelScale = __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].LABEL_SCALE;
  14961. var labelWidth = this.adapter_.getLabelWidth() * labelScale;
  14962. var isRtl = this.adapter_.isRtl();
  14963. this.adapter_.notchOutline(labelWidth, isRtl);
  14964. } else {
  14965. this.adapter_.closeOutline();
  14966. }
  14967. }
  14968. }]);
  14969. return MDCSelectFoundation;
  14970. }(__WEBPACK_IMPORTED_MODULE_0__material_base_index__["MDCFoundation"]);
  14971. /* harmony default export */ __webpack_exports__["a"] = (MDCSelectFoundation);
  14972. /***/ }),
  14973. /* 112 */
  14974. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14975. "use strict";
  14976. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  14977. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSlider", function() { return MDCSlider; });
  14978. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  14979. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(45);
  14980. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__adapter__ = __webpack_require__(46);
  14981. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation__ = __webpack_require__(113);
  14982. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSliderFoundation", function() { return __WEBPACK_IMPORTED_MODULE_3__foundation__["a"]; });
  14983. 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; }; }();
  14984. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  14985. 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; }
  14986. 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; }
  14987. /**
  14988. * @license
  14989. * Copyright 2017 Google Inc.
  14990. *
  14991. * Permission is hereby granted, free of charge, to any person obtaining a copy
  14992. * of this software and associated documentation files (the "Software"), to deal
  14993. * in the Software without restriction, including without limitation the rights
  14994. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  14995. * copies of the Software, and to permit persons to whom the Software is
  14996. * furnished to do so, subject to the following conditions:
  14997. *
  14998. * The above copyright notice and this permission notice shall be included in
  14999. * all copies or substantial portions of the Software.
  15000. *
  15001. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15002. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15003. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  15004. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  15005. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  15006. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  15007. * THE SOFTWARE.
  15008. */
  15009. /**
  15010. * @extends MDCComponent<!MDCSliderFoundation>
  15011. */
  15012. var MDCSlider = function (_MDCComponent) {
  15013. _inherits(MDCSlider, _MDCComponent);
  15014. _createClass(MDCSlider, null, [{
  15015. key: 'attachTo',
  15016. value: function attachTo(root) {
  15017. return new MDCSlider(root);
  15018. }
  15019. }]);
  15020. function MDCSlider() {
  15021. var _ref;
  15022. _classCallCheck(this, MDCSlider);
  15023. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  15024. args[_key] = arguments[_key];
  15025. }
  15026. /** @type {?Element} */
  15027. var _this = _possibleConstructorReturn(this, (_ref = MDCSlider.__proto__ || Object.getPrototypeOf(MDCSlider)).call.apply(_ref, [this].concat(args)));
  15028. _this.thumbContainer_;
  15029. /** @type {?Element} */
  15030. _this.track_;
  15031. /** @type {?Element} */
  15032. _this.pinValueMarker_;
  15033. /** @type {?Element} */
  15034. _this.trackMarkerContainer_;
  15035. return _this;
  15036. }
  15037. /** @return {number} */
  15038. _createClass(MDCSlider, [{
  15039. key: 'initialize',
  15040. value: function initialize() {
  15041. this.thumbContainer_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].THUMB_CONTAINER_SELECTOR);
  15042. this.track_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].TRACK_SELECTOR);
  15043. this.pinValueMarker_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].PIN_VALUE_MARKER_SELECTOR);
  15044. this.trackMarkerContainer_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].TRACK_MARKER_CONTAINER_SELECTOR);
  15045. }
  15046. /**
  15047. * @return {!MDCSliderFoundation}
  15048. */
  15049. }, {
  15050. key: 'getDefaultFoundation',
  15051. value: function getDefaultFoundation() {
  15052. var _this2 = this;
  15053. return new __WEBPACK_IMPORTED_MODULE_3__foundation__["a" /* default */](
  15054. /** @type {!MDCSliderAdapter} */{
  15055. hasClass: function hasClass(className) {
  15056. return _this2.root_.classList.contains(className);
  15057. },
  15058. addClass: function addClass(className) {
  15059. return _this2.root_.classList.add(className);
  15060. },
  15061. removeClass: function removeClass(className) {
  15062. return _this2.root_.classList.remove(className);
  15063. },
  15064. getAttribute: function getAttribute(name) {
  15065. return _this2.root_.getAttribute(name);
  15066. },
  15067. setAttribute: function setAttribute(name, value) {
  15068. return _this2.root_.setAttribute(name, value);
  15069. },
  15070. removeAttribute: function removeAttribute(name) {
  15071. return _this2.root_.removeAttribute(name);
  15072. },
  15073. computeBoundingRect: function computeBoundingRect() {
  15074. return _this2.root_.getBoundingClientRect();
  15075. },
  15076. getTabIndex: function getTabIndex() {
  15077. return _this2.root_.tabIndex;
  15078. },
  15079. registerInteractionHandler: function registerInteractionHandler(type, handler) {
  15080. _this2.root_.addEventListener(type, handler);
  15081. },
  15082. deregisterInteractionHandler: function deregisterInteractionHandler(type, handler) {
  15083. _this2.root_.removeEventListener(type, handler);
  15084. },
  15085. registerThumbContainerInteractionHandler: function registerThumbContainerInteractionHandler(type, handler) {
  15086. _this2.thumbContainer_.addEventListener(type, handler);
  15087. },
  15088. deregisterThumbContainerInteractionHandler: function deregisterThumbContainerInteractionHandler(type, handler) {
  15089. _this2.thumbContainer_.removeEventListener(type, handler);
  15090. },
  15091. registerBodyInteractionHandler: function registerBodyInteractionHandler(type, handler) {
  15092. document.body.addEventListener(type, handler);
  15093. },
  15094. deregisterBodyInteractionHandler: function deregisterBodyInteractionHandler(type, handler) {
  15095. document.body.removeEventListener(type, handler);
  15096. },
  15097. registerResizeHandler: function registerResizeHandler(handler) {
  15098. window.addEventListener('resize', handler);
  15099. },
  15100. deregisterResizeHandler: function deregisterResizeHandler(handler) {
  15101. window.removeEventListener('resize', handler);
  15102. },
  15103. notifyInput: function notifyInput() {
  15104. _this2.emit(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].INPUT_EVENT, _this2);
  15105. },
  15106. notifyChange: function notifyChange() {
  15107. _this2.emit(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].CHANGE_EVENT, _this2);
  15108. },
  15109. setThumbContainerStyleProperty: function setThumbContainerStyleProperty(propertyName, value) {
  15110. _this2.thumbContainer_.style.setProperty(propertyName, value);
  15111. },
  15112. setTrackStyleProperty: function setTrackStyleProperty(propertyName, value) {
  15113. _this2.track_.style.setProperty(propertyName, value);
  15114. },
  15115. setMarkerValue: function setMarkerValue(value) {
  15116. _this2.pinValueMarker_.innerText = value;
  15117. },
  15118. appendTrackMarkers: function appendTrackMarkers(numMarkers) {
  15119. var frag = document.createDocumentFragment();
  15120. for (var i = 0; i < numMarkers; i++) {
  15121. var marker = document.createElement('div');
  15122. marker.classList.add('mdc-slider__track-marker');
  15123. frag.appendChild(marker);
  15124. }
  15125. _this2.trackMarkerContainer_.appendChild(frag);
  15126. },
  15127. removeTrackMarkers: function removeTrackMarkers() {
  15128. while (_this2.trackMarkerContainer_.firstChild) {
  15129. _this2.trackMarkerContainer_.removeChild(_this2.trackMarkerContainer_.firstChild);
  15130. }
  15131. },
  15132. setLastTrackMarkersStyleProperty: function setLastTrackMarkersStyleProperty(propertyName, value) {
  15133. // We remove and append new nodes, thus, the last track marker must be dynamically found.
  15134. var lastTrackMarker = _this2.root_.querySelector(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].LAST_TRACK_MARKER_SELECTOR);
  15135. lastTrackMarker.style.setProperty(propertyName, value);
  15136. },
  15137. isRTL: function isRTL() {
  15138. return getComputedStyle(_this2.root_).direction === 'rtl';
  15139. }
  15140. });
  15141. }
  15142. }, {
  15143. key: 'initialSyncWithDOM',
  15144. value: function initialSyncWithDOM() {
  15145. var origValueNow = parseFloat(this.root_.getAttribute(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].ARIA_VALUENOW));
  15146. this.min = parseFloat(this.root_.getAttribute(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].ARIA_VALUEMIN)) || this.min;
  15147. this.max = parseFloat(this.root_.getAttribute(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].ARIA_VALUEMAX)) || this.max;
  15148. this.step = parseFloat(this.root_.getAttribute(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].STEP_DATA_ATTR)) || this.step;
  15149. this.value = origValueNow || this.value;
  15150. 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';
  15151. this.foundation_.setupTrackMarker();
  15152. }
  15153. }, {
  15154. key: 'layout',
  15155. value: function layout() {
  15156. this.foundation_.layout();
  15157. }
  15158. /** @param {number=} amount */
  15159. }, {
  15160. key: 'stepUp',
  15161. value: function stepUp() {
  15162. var amount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.step || 1;
  15163. this.value += amount;
  15164. }
  15165. /** @param {number=} amount */
  15166. }, {
  15167. key: 'stepDown',
  15168. value: function stepDown() {
  15169. var amount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.step || 1;
  15170. this.value -= amount;
  15171. }
  15172. }, {
  15173. key: 'value',
  15174. get: function get() {
  15175. return this.foundation_.getValue();
  15176. }
  15177. /** @param {number} value */
  15178. ,
  15179. set: function set(value) {
  15180. this.foundation_.setValue(value);
  15181. }
  15182. /** @return {number} */
  15183. }, {
  15184. key: 'min',
  15185. get: function get() {
  15186. return this.foundation_.getMin();
  15187. }
  15188. /** @param {number} min */
  15189. ,
  15190. set: function set(min) {
  15191. this.foundation_.setMin(min);
  15192. }
  15193. /** @return {number} */
  15194. }, {
  15195. key: 'max',
  15196. get: function get() {
  15197. return this.foundation_.getMax();
  15198. }
  15199. /** @param {number} max */
  15200. ,
  15201. set: function set(max) {
  15202. this.foundation_.setMax(max);
  15203. }
  15204. /** @return {number} */
  15205. }, {
  15206. key: 'step',
  15207. get: function get() {
  15208. return this.foundation_.getStep();
  15209. }
  15210. /** @param {number} step */
  15211. ,
  15212. set: function set(step) {
  15213. this.foundation_.setStep(step);
  15214. }
  15215. /** @return {boolean} */
  15216. }, {
  15217. key: 'disabled',
  15218. get: function get() {
  15219. return this.foundation_.isDisabled();
  15220. }
  15221. /** @param {boolean} disabled */
  15222. ,
  15223. set: function set(disabled) {
  15224. this.foundation_.setDisabled(disabled);
  15225. }
  15226. }]);
  15227. return MDCSlider;
  15228. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  15229. /***/ }),
  15230. /* 113 */
  15231. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15232. "use strict";
  15233. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__constants__ = __webpack_require__(45);
  15234. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(46);
  15235. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_animation_index__ = __webpack_require__(9);
  15236. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_base_foundation__ = __webpack_require__(0);
  15237. 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; };
  15238. 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; }; }();
  15239. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15240. 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; }
  15241. 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; }
  15242. /**
  15243. * @license
  15244. * Copyright 2017 Google Inc.
  15245. *
  15246. * Permission is hereby granted, free of charge, to any person obtaining a copy
  15247. * of this software and associated documentation files (the "Software"), to deal
  15248. * in the Software without restriction, including without limitation the rights
  15249. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  15250. * copies of the Software, and to permit persons to whom the Software is
  15251. * furnished to do so, subject to the following conditions:
  15252. *
  15253. * The above copyright notice and this permission notice shall be included in
  15254. * all copies or substantial portions of the Software.
  15255. *
  15256. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15257. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15258. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  15259. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  15260. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  15261. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  15262. * THE SOFTWARE.
  15263. */
  15264. /** @enum {string} */
  15265. var KEY_IDS = {
  15266. ARROW_LEFT: 'ArrowLeft',
  15267. ARROW_RIGHT: 'ArrowRight',
  15268. ARROW_UP: 'ArrowUp',
  15269. ARROW_DOWN: 'ArrowDown',
  15270. HOME: 'Home',
  15271. END: 'End',
  15272. PAGE_UP: 'PageUp',
  15273. PAGE_DOWN: 'PageDown'
  15274. };
  15275. /** @enum {string} */
  15276. var MOVE_EVENT_MAP = {
  15277. 'mousedown': 'mousemove',
  15278. 'touchstart': 'touchmove',
  15279. 'pointerdown': 'pointermove'
  15280. };
  15281. var DOWN_EVENTS = ['mousedown', 'pointerdown', 'touchstart'];
  15282. var UP_EVENTS = ['mouseup', 'pointerup', 'touchend'];
  15283. /**
  15284. * @extends {MDCFoundation<!MDCSliderAdapter>}
  15285. */
  15286. var MDCSliderFoundation = function (_MDCFoundation) {
  15287. _inherits(MDCSliderFoundation, _MDCFoundation);
  15288. _createClass(MDCSliderFoundation, null, [{
  15289. key: 'cssClasses',
  15290. /** @return enum {cssClasses} */
  15291. get: function get() {
  15292. return __WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */];
  15293. }
  15294. /** @return enum {strings} */
  15295. }, {
  15296. key: 'strings',
  15297. get: function get() {
  15298. return __WEBPACK_IMPORTED_MODULE_0__constants__["c" /* strings */];
  15299. }
  15300. /** @return enum {numbers} */
  15301. }, {
  15302. key: 'numbers',
  15303. get: function get() {
  15304. return __WEBPACK_IMPORTED_MODULE_0__constants__["b" /* numbers */];
  15305. }
  15306. /** @return {!MDCSliderAdapter} */
  15307. }, {
  15308. key: 'defaultAdapter',
  15309. get: function get() {
  15310. return (/** @type {!MDCSliderAdapter} */{
  15311. hasClass: function hasClass() {
  15312. return (/* className: string */ /* boolean */false
  15313. );
  15314. },
  15315. addClass: function addClass() /* className: string */{},
  15316. removeClass: function removeClass() /* className: string */{},
  15317. getAttribute: function getAttribute() {
  15318. return (/* name: string */ /* string|null */null
  15319. );
  15320. },
  15321. setAttribute: function setAttribute() /* name: string, value: string */{},
  15322. removeAttribute: function removeAttribute() /* name: string */{},
  15323. computeBoundingRect: function computeBoundingRect() {
  15324. return (/* ClientRect */{
  15325. top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0
  15326. }
  15327. );
  15328. },
  15329. getTabIndex: function getTabIndex() {
  15330. return (/* number */0
  15331. );
  15332. },
  15333. registerInteractionHandler: function registerInteractionHandler() /* type: string, handler: EventListener */{},
  15334. deregisterInteractionHandler: function deregisterInteractionHandler() /* type: string, handler: EventListener */{},
  15335. registerThumbContainerInteractionHandler: function registerThumbContainerInteractionHandler() /* type: string, handler: EventListener */{},
  15336. deregisterThumbContainerInteractionHandler: function deregisterThumbContainerInteractionHandler() /* type: string, handler: EventListener */{},
  15337. registerBodyInteractionHandler: function registerBodyInteractionHandler() /* type: string, handler: EventListener */{},
  15338. deregisterBodyInteractionHandler: function deregisterBodyInteractionHandler() /* type: string, handler: EventListener */{},
  15339. registerResizeHandler: function registerResizeHandler() /* handler: EventListener */{},
  15340. deregisterResizeHandler: function deregisterResizeHandler() /* handler: EventListener */{},
  15341. notifyInput: function notifyInput() {},
  15342. notifyChange: function notifyChange() {},
  15343. setThumbContainerStyleProperty: function setThumbContainerStyleProperty() /* propertyName: string, value: string */{},
  15344. setTrackStyleProperty: function setTrackStyleProperty() /* propertyName: string, value: string */{},
  15345. setMarkerValue: function setMarkerValue() /* value: number */{},
  15346. appendTrackMarkers: function appendTrackMarkers() /* numMarkers: number */{},
  15347. removeTrackMarkers: function removeTrackMarkers() {},
  15348. setLastTrackMarkersStyleProperty: function setLastTrackMarkersStyleProperty() /* propertyName: string, value: string */{},
  15349. isRTL: function isRTL() {
  15350. return (/* boolean */false
  15351. );
  15352. }
  15353. }
  15354. );
  15355. }
  15356. /**
  15357. * Creates a new instance of MDCSliderFoundation
  15358. * @param {?MDCSliderAdapter} adapter
  15359. */
  15360. }]);
  15361. function MDCSliderFoundation(adapter) {
  15362. _classCallCheck(this, MDCSliderFoundation);
  15363. /** @private {?ClientRect} */
  15364. var _this = _possibleConstructorReturn(this, (MDCSliderFoundation.__proto__ || Object.getPrototypeOf(MDCSliderFoundation)).call(this, _extends(MDCSliderFoundation.defaultAdapter, adapter)));
  15365. _this.rect_ = null;
  15366. // We set this to NaN since we want it to be a number, but we can't use '0' or '-1'
  15367. // because those could be valid tabindices set by the client code.
  15368. _this.savedTabIndex_ = NaN;
  15369. _this.active_ = false;
  15370. _this.inTransit_ = false;
  15371. _this.isDiscrete_ = false;
  15372. _this.hasTrackMarker_ = false;
  15373. _this.handlingThumbTargetEvt_ = false;
  15374. _this.min_ = 0;
  15375. _this.max_ = 100;
  15376. _this.step_ = 0;
  15377. _this.value_ = 0;
  15378. _this.disabled_ = false;
  15379. _this.preventFocusState_ = false;
  15380. _this.updateUIFrame_ = 0;
  15381. _this.thumbContainerPointerHandler_ = function () {
  15382. _this.handlingThumbTargetEvt_ = true;
  15383. };
  15384. _this.interactionStartHandler_ = function (evt) {
  15385. return _this.handleDown_(evt);
  15386. };
  15387. _this.keydownHandler_ = function (evt) {
  15388. return _this.handleKeydown_(evt);
  15389. };
  15390. _this.focusHandler_ = function () {
  15391. return _this.handleFocus_();
  15392. };
  15393. _this.blurHandler_ = function () {
  15394. return _this.handleBlur_();
  15395. };
  15396. _this.resizeHandler_ = function () {
  15397. return _this.layout();
  15398. };
  15399. return _this;
  15400. }
  15401. _createClass(MDCSliderFoundation, [{
  15402. key: 'init',
  15403. value: function init() {
  15404. var _this2 = this;
  15405. this.isDiscrete_ = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].IS_DISCRETE);
  15406. this.hasTrackMarker_ = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].HAS_TRACK_MARKER);
  15407. DOWN_EVENTS.forEach(function (evtName) {
  15408. return _this2.adapter_.registerInteractionHandler(evtName, _this2.interactionStartHandler_);
  15409. });
  15410. this.adapter_.registerInteractionHandler('keydown', this.keydownHandler_);
  15411. this.adapter_.registerInteractionHandler('focus', this.focusHandler_);
  15412. this.adapter_.registerInteractionHandler('blur', this.blurHandler_);
  15413. DOWN_EVENTS.forEach(function (evtName) {
  15414. _this2.adapter_.registerThumbContainerInteractionHandler(evtName, _this2.thumbContainerPointerHandler_);
  15415. });
  15416. this.adapter_.registerResizeHandler(this.resizeHandler_);
  15417. this.layout();
  15418. // At last step, provide a reasonable default value to discrete slider
  15419. if (this.isDiscrete_ && this.getStep() == 0) {
  15420. this.step_ = 1;
  15421. }
  15422. }
  15423. }, {
  15424. key: 'destroy',
  15425. value: function destroy() {
  15426. var _this3 = this;
  15427. DOWN_EVENTS.forEach(function (evtName) {
  15428. _this3.adapter_.deregisterInteractionHandler(evtName, _this3.interactionStartHandler_);
  15429. });
  15430. this.adapter_.deregisterInteractionHandler('keydown', this.keydownHandler_);
  15431. this.adapter_.deregisterInteractionHandler('focus', this.focusHandler_);
  15432. this.adapter_.deregisterInteractionHandler('blur', this.blurHandler_);
  15433. DOWN_EVENTS.forEach(function (evtName) {
  15434. _this3.adapter_.deregisterThumbContainerInteractionHandler(evtName, _this3.thumbContainerPointerHandler_);
  15435. });
  15436. this.adapter_.deregisterResizeHandler(this.resizeHandler_);
  15437. }
  15438. }, {
  15439. key: 'setupTrackMarker',
  15440. value: function setupTrackMarker() {
  15441. if (this.isDiscrete_ && this.hasTrackMarker_ && this.getStep() != 0) {
  15442. var min = this.getMin();
  15443. var max = this.getMax();
  15444. var step = this.getStep();
  15445. var numMarkers = (max - min) / step;
  15446. // In case distance between max & min is indivisible to step,
  15447. // we place the secondary to last marker proportionally at where thumb
  15448. // could reach and place the last marker at max value
  15449. var indivisible = Math.ceil(numMarkers) !== numMarkers;
  15450. if (indivisible) {
  15451. numMarkers = Math.ceil(numMarkers);
  15452. }
  15453. this.adapter_.removeTrackMarkers();
  15454. this.adapter_.appendTrackMarkers(numMarkers);
  15455. if (indivisible) {
  15456. var lastStepRatio = (max - numMarkers * step) / step + 1;
  15457. var flex = Object(__WEBPACK_IMPORTED_MODULE_2__material_animation_index__["b" /* getCorrectPropertyName */])(window, 'flex');
  15458. this.adapter_.setLastTrackMarkersStyleProperty(flex, String(lastStepRatio));
  15459. }
  15460. }
  15461. }
  15462. }, {
  15463. key: 'layout',
  15464. value: function layout() {
  15465. this.rect_ = this.adapter_.computeBoundingRect();
  15466. this.updateUIForCurrentValue_();
  15467. }
  15468. /** @return {number} */
  15469. }, {
  15470. key: 'getValue',
  15471. value: function getValue() {
  15472. return this.value_;
  15473. }
  15474. /** @param {number} value */
  15475. }, {
  15476. key: 'setValue',
  15477. value: function setValue(value) {
  15478. this.setValue_(value, false);
  15479. }
  15480. /** @return {number} */
  15481. }, {
  15482. key: 'getMax',
  15483. value: function getMax() {
  15484. return this.max_;
  15485. }
  15486. /** @param {number} max */
  15487. }, {
  15488. key: 'setMax',
  15489. value: function setMax(max) {
  15490. if (max < this.min_) {
  15491. throw new Error('Cannot set max to be less than the slider\'s minimum value');
  15492. }
  15493. this.max_ = max;
  15494. this.setValue_(this.value_, false, true);
  15495. this.adapter_.setAttribute(__WEBPACK_IMPORTED_MODULE_0__constants__["c" /* strings */].ARIA_VALUEMAX, String(this.max_));
  15496. this.setupTrackMarker();
  15497. }
  15498. /** @return {number} */
  15499. }, {
  15500. key: 'getMin',
  15501. value: function getMin() {
  15502. return this.min_;
  15503. }
  15504. /** @param {number} min */
  15505. }, {
  15506. key: 'setMin',
  15507. value: function setMin(min) {
  15508. if (min > this.max_) {
  15509. throw new Error('Cannot set min to be greater than the slider\'s maximum value');
  15510. }
  15511. this.min_ = min;
  15512. this.setValue_(this.value_, false, true);
  15513. this.adapter_.setAttribute(__WEBPACK_IMPORTED_MODULE_0__constants__["c" /* strings */].ARIA_VALUEMIN, String(this.min_));
  15514. this.setupTrackMarker();
  15515. }
  15516. /** @return {number} */
  15517. }, {
  15518. key: 'getStep',
  15519. value: function getStep() {
  15520. return this.step_;
  15521. }
  15522. /** @param {number} step */
  15523. }, {
  15524. key: 'setStep',
  15525. value: function setStep(step) {
  15526. if (step < 0) {
  15527. throw new Error('Step cannot be set to a negative number');
  15528. }
  15529. if (this.isDiscrete_ && (typeof step !== 'number' || step < 1)) {
  15530. step = 1;
  15531. }
  15532. this.step_ = step;
  15533. this.setValue_(this.value_, false, true);
  15534. this.setupTrackMarker();
  15535. }
  15536. /** @return {boolean} */
  15537. }, {
  15538. key: 'isDisabled',
  15539. value: function isDisabled() {
  15540. return this.disabled_;
  15541. }
  15542. /** @param {boolean} disabled */
  15543. }, {
  15544. key: 'setDisabled',
  15545. value: function setDisabled(disabled) {
  15546. this.disabled_ = disabled;
  15547. this.toggleClass_(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].DISABLED, this.disabled_);
  15548. if (this.disabled_) {
  15549. this.savedTabIndex_ = this.adapter_.getTabIndex();
  15550. this.adapter_.setAttribute(__WEBPACK_IMPORTED_MODULE_0__constants__["c" /* strings */].ARIA_DISABLED, 'true');
  15551. this.adapter_.removeAttribute('tabindex');
  15552. } else {
  15553. this.adapter_.removeAttribute(__WEBPACK_IMPORTED_MODULE_0__constants__["c" /* strings */].ARIA_DISABLED);
  15554. if (!isNaN(this.savedTabIndex_)) {
  15555. this.adapter_.setAttribute('tabindex', String(this.savedTabIndex_));
  15556. }
  15557. }
  15558. }
  15559. /**
  15560. * Called when the user starts interacting with the slider
  15561. * @param {!Event} evt
  15562. * @private
  15563. */
  15564. }, {
  15565. key: 'handleDown_',
  15566. value: function handleDown_(evt) {
  15567. var _this4 = this;
  15568. if (this.disabled_) {
  15569. return;
  15570. }
  15571. this.preventFocusState_ = true;
  15572. this.setInTransit_(!this.handlingThumbTargetEvt_);
  15573. this.handlingThumbTargetEvt_ = false;
  15574. this.setActive_(true);
  15575. var moveHandler = function moveHandler(evt) {
  15576. _this4.handleMove_(evt);
  15577. };
  15578. // Note: upHandler is [de]registered on ALL potential pointer-related release event types, since some browsers
  15579. // do not always fire these consistently in pairs.
  15580. // (See https://github.com/material-components/material-components-web/issues/1192)
  15581. var upHandler = function upHandler() {
  15582. _this4.handleUp_();
  15583. _this4.adapter_.deregisterBodyInteractionHandler(MOVE_EVENT_MAP[evt.type], moveHandler);
  15584. UP_EVENTS.forEach(function (evtName) {
  15585. return _this4.adapter_.deregisterBodyInteractionHandler(evtName, upHandler);
  15586. });
  15587. };
  15588. this.adapter_.registerBodyInteractionHandler(MOVE_EVENT_MAP[evt.type], moveHandler);
  15589. UP_EVENTS.forEach(function (evtName) {
  15590. return _this4.adapter_.registerBodyInteractionHandler(evtName, upHandler);
  15591. });
  15592. this.setValueFromEvt_(evt);
  15593. }
  15594. /**
  15595. * Called when the user moves the slider
  15596. * @param {!Event} evt
  15597. * @private
  15598. */
  15599. }, {
  15600. key: 'handleMove_',
  15601. value: function handleMove_(evt) {
  15602. evt.preventDefault();
  15603. this.setValueFromEvt_(evt);
  15604. }
  15605. /**
  15606. * Called when the user's interaction with the slider ends
  15607. * @private
  15608. */
  15609. }, {
  15610. key: 'handleUp_',
  15611. value: function handleUp_() {
  15612. this.setActive_(false);
  15613. this.adapter_.notifyChange();
  15614. }
  15615. /**
  15616. * Returns the pageX of the event
  15617. * @param {!Event} evt
  15618. * @return {number}
  15619. * @private
  15620. */
  15621. }, {
  15622. key: 'getPageX_',
  15623. value: function getPageX_(evt) {
  15624. if (evt.targetTouches && evt.targetTouches.length > 0) {
  15625. return evt.targetTouches[0].pageX;
  15626. }
  15627. return evt.pageX;
  15628. }
  15629. /**
  15630. * Sets the slider value from an event
  15631. * @param {!Event} evt
  15632. * @private
  15633. */
  15634. }, {
  15635. key: 'setValueFromEvt_',
  15636. value: function setValueFromEvt_(evt) {
  15637. var pageX = this.getPageX_(evt);
  15638. var value = this.computeValueFromPageX_(pageX);
  15639. this.setValue_(value, true);
  15640. }
  15641. /**
  15642. * Computes the new value from the pageX position
  15643. * @param {number} pageX
  15644. * @return {number}
  15645. */
  15646. }, {
  15647. key: 'computeValueFromPageX_',
  15648. value: function computeValueFromPageX_(pageX) {
  15649. var max = this.max_,
  15650. min = this.min_;
  15651. var xPos = pageX - this.rect_.left;
  15652. var pctComplete = xPos / this.rect_.width;
  15653. if (this.adapter_.isRTL()) {
  15654. pctComplete = 1 - pctComplete;
  15655. }
  15656. // Fit the percentage complete between the range [min,max]
  15657. // by remapping from [0, 1] to [min, min+(max-min)].
  15658. return min + pctComplete * (max - min);
  15659. }
  15660. /**
  15661. * Handles keydown events
  15662. * @param {!Event} evt
  15663. */
  15664. }, {
  15665. key: 'handleKeydown_',
  15666. value: function handleKeydown_(evt) {
  15667. var keyId = this.getKeyId_(evt);
  15668. var value = this.getValueForKeyId_(keyId);
  15669. if (isNaN(value)) {
  15670. return;
  15671. }
  15672. // Prevent page from scrolling due to key presses that would normally scroll the page
  15673. evt.preventDefault();
  15674. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].FOCUS);
  15675. this.setValue_(value, true);
  15676. this.adapter_.notifyChange();
  15677. }
  15678. /**
  15679. * Returns the computed name of the event
  15680. * @param {!Event} kbdEvt
  15681. * @return {string}
  15682. */
  15683. }, {
  15684. key: 'getKeyId_',
  15685. value: function getKeyId_(kbdEvt) {
  15686. if (kbdEvt.key === KEY_IDS.ARROW_LEFT || kbdEvt.keyCode === 37) {
  15687. return KEY_IDS.ARROW_LEFT;
  15688. }
  15689. if (kbdEvt.key === KEY_IDS.ARROW_RIGHT || kbdEvt.keyCode === 39) {
  15690. return KEY_IDS.ARROW_RIGHT;
  15691. }
  15692. if (kbdEvt.key === KEY_IDS.ARROW_UP || kbdEvt.keyCode === 38) {
  15693. return KEY_IDS.ARROW_UP;
  15694. }
  15695. if (kbdEvt.key === KEY_IDS.ARROW_DOWN || kbdEvt.keyCode === 40) {
  15696. return KEY_IDS.ARROW_DOWN;
  15697. }
  15698. if (kbdEvt.key === KEY_IDS.HOME || kbdEvt.keyCode === 36) {
  15699. return KEY_IDS.HOME;
  15700. }
  15701. if (kbdEvt.key === KEY_IDS.END || kbdEvt.keyCode === 35) {
  15702. return KEY_IDS.END;
  15703. }
  15704. if (kbdEvt.key === KEY_IDS.PAGE_UP || kbdEvt.keyCode === 33) {
  15705. return KEY_IDS.PAGE_UP;
  15706. }
  15707. if (kbdEvt.key === KEY_IDS.PAGE_DOWN || kbdEvt.keyCode === 34) {
  15708. return KEY_IDS.PAGE_DOWN;
  15709. }
  15710. return '';
  15711. }
  15712. /**
  15713. * Computes the value given a keyboard key ID
  15714. * @param {string} keyId
  15715. * @return {number}
  15716. */
  15717. }, {
  15718. key: 'getValueForKeyId_',
  15719. value: function getValueForKeyId_(keyId) {
  15720. var max = this.max_,
  15721. min = this.min_,
  15722. step = this.step_;
  15723. var delta = step || (max - min) / 100;
  15724. var valueNeedsToBeFlipped = this.adapter_.isRTL() && (keyId === KEY_IDS.ARROW_LEFT || keyId === KEY_IDS.ARROW_RIGHT);
  15725. if (valueNeedsToBeFlipped) {
  15726. delta = -delta;
  15727. }
  15728. switch (keyId) {
  15729. case KEY_IDS.ARROW_LEFT:
  15730. case KEY_IDS.ARROW_DOWN:
  15731. return this.value_ - delta;
  15732. case KEY_IDS.ARROW_RIGHT:
  15733. case KEY_IDS.ARROW_UP:
  15734. return this.value_ + delta;
  15735. case KEY_IDS.HOME:
  15736. return this.min_;
  15737. case KEY_IDS.END:
  15738. return this.max_;
  15739. case KEY_IDS.PAGE_UP:
  15740. return this.value_ + delta * __WEBPACK_IMPORTED_MODULE_0__constants__["b" /* numbers */].PAGE_FACTOR;
  15741. case KEY_IDS.PAGE_DOWN:
  15742. return this.value_ - delta * __WEBPACK_IMPORTED_MODULE_0__constants__["b" /* numbers */].PAGE_FACTOR;
  15743. default:
  15744. return NaN;
  15745. }
  15746. }
  15747. }, {
  15748. key: 'handleFocus_',
  15749. value: function handleFocus_() {
  15750. if (this.preventFocusState_) {
  15751. return;
  15752. }
  15753. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].FOCUS);
  15754. }
  15755. }, {
  15756. key: 'handleBlur_',
  15757. value: function handleBlur_() {
  15758. this.preventFocusState_ = false;
  15759. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].FOCUS);
  15760. }
  15761. /**
  15762. * Sets the value of the slider
  15763. * @param {number} value
  15764. * @param {boolean} shouldFireInput
  15765. * @param {boolean=} force
  15766. */
  15767. }, {
  15768. key: 'setValue_',
  15769. value: function setValue_(value, shouldFireInput) {
  15770. var force = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  15771. if (value === this.value_ && !force) {
  15772. return;
  15773. }
  15774. var min = this.min_,
  15775. max = this.max_;
  15776. var valueSetToBoundary = value === min || value === max;
  15777. if (this.step_ && !valueSetToBoundary) {
  15778. value = this.quantize_(value);
  15779. }
  15780. if (value < min) {
  15781. value = min;
  15782. } else if (value > max) {
  15783. value = max;
  15784. }
  15785. this.value_ = value;
  15786. this.adapter_.setAttribute(__WEBPACK_IMPORTED_MODULE_0__constants__["c" /* strings */].ARIA_VALUENOW, String(this.value_));
  15787. this.updateUIForCurrentValue_();
  15788. if (shouldFireInput) {
  15789. this.adapter_.notifyInput();
  15790. if (this.isDiscrete_) {
  15791. this.adapter_.setMarkerValue(value);
  15792. }
  15793. }
  15794. }
  15795. /**
  15796. * Calculates the quantized value
  15797. * @param {number} value
  15798. * @return {number}
  15799. */
  15800. }, {
  15801. key: 'quantize_',
  15802. value: function quantize_(value) {
  15803. var numSteps = Math.round(value / this.step_);
  15804. var quantizedVal = numSteps * this.step_;
  15805. return quantizedVal;
  15806. }
  15807. }, {
  15808. key: 'updateUIForCurrentValue_',
  15809. value: function updateUIForCurrentValue_() {
  15810. var _this5 = this;
  15811. var max = this.max_,
  15812. min = this.min_,
  15813. value = this.value_;
  15814. var pctComplete = (value - min) / (max - min);
  15815. var translatePx = pctComplete * this.rect_.width;
  15816. if (this.adapter_.isRTL()) {
  15817. translatePx = this.rect_.width - translatePx;
  15818. }
  15819. var transformProp = Object(__WEBPACK_IMPORTED_MODULE_2__material_animation_index__["b" /* getCorrectPropertyName */])(window, 'transform');
  15820. var transitionendEvtName = Object(__WEBPACK_IMPORTED_MODULE_2__material_animation_index__["a" /* getCorrectEventName */])(window, 'transitionend');
  15821. if (this.inTransit_) {
  15822. var onTransitionEnd = function onTransitionEnd() {
  15823. _this5.setInTransit_(false);
  15824. _this5.adapter_.deregisterThumbContainerInteractionHandler(transitionendEvtName, onTransitionEnd);
  15825. };
  15826. this.adapter_.registerThumbContainerInteractionHandler(transitionendEvtName, onTransitionEnd);
  15827. }
  15828. this.updateUIFrame_ = requestAnimationFrame(function () {
  15829. // NOTE(traviskaufman): It would be nice to use calc() here,
  15830. // but IE cannot handle calcs in transforms correctly.
  15831. // See: https://goo.gl/NC2itk
  15832. // Also note that the -50% offset is used to center the slider thumb.
  15833. _this5.adapter_.setThumbContainerStyleProperty(transformProp, 'translateX(' + translatePx + 'px) translateX(-50%)');
  15834. _this5.adapter_.setTrackStyleProperty(transformProp, 'scaleX(' + pctComplete + ')');
  15835. });
  15836. }
  15837. /**
  15838. * Toggles the active state of the slider
  15839. * @param {boolean} active
  15840. */
  15841. }, {
  15842. key: 'setActive_',
  15843. value: function setActive_(active) {
  15844. this.active_ = active;
  15845. this.toggleClass_(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].ACTIVE, this.active_);
  15846. }
  15847. /**
  15848. * Toggles the inTransit state of the slider
  15849. * @param {boolean} inTransit
  15850. */
  15851. }, {
  15852. key: 'setInTransit_',
  15853. value: function setInTransit_(inTransit) {
  15854. this.inTransit_ = inTransit;
  15855. this.toggleClass_(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].IN_TRANSIT, this.inTransit_);
  15856. }
  15857. /**
  15858. * Conditionally adds or removes a class based on shouldBePresent
  15859. * @param {string} className
  15860. * @param {boolean} shouldBePresent
  15861. */
  15862. }, {
  15863. key: 'toggleClass_',
  15864. value: function toggleClass_(className, shouldBePresent) {
  15865. if (shouldBePresent) {
  15866. this.adapter_.addClass(className);
  15867. } else {
  15868. this.adapter_.removeClass(className);
  15869. }
  15870. }
  15871. }]);
  15872. return MDCSliderFoundation;
  15873. }(__WEBPACK_IMPORTED_MODULE_3__material_base_foundation__["a" /* default */]);
  15874. /* harmony default export */ __webpack_exports__["a"] = (MDCSliderFoundation);
  15875. /***/ }),
  15876. /* 114 */
  15877. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15878. "use strict";
  15879. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  15880. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSnackbar", function() { return MDCSnackbar; });
  15881. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_index__ = __webpack_require__(3);
  15882. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(115);
  15883. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_animation_index__ = __webpack_require__(9);
  15884. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSnackbarFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__foundation__["a"]; });
  15885. 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; }; }();
  15886. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15887. 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; }
  15888. 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; }
  15889. /**
  15890. * @license
  15891. * Copyright 2016 Google Inc.
  15892. *
  15893. * Permission is hereby granted, free of charge, to any person obtaining a copy
  15894. * of this software and associated documentation files (the "Software"), to deal
  15895. * in the Software without restriction, including without limitation the rights
  15896. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  15897. * copies of the Software, and to permit persons to whom the Software is
  15898. * furnished to do so, subject to the following conditions:
  15899. *
  15900. * The above copyright notice and this permission notice shall be included in
  15901. * all copies or substantial portions of the Software.
  15902. *
  15903. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15904. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15905. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  15906. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  15907. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  15908. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  15909. * THE SOFTWARE.
  15910. */
  15911. var MDCSnackbar = function (_MDCComponent) {
  15912. _inherits(MDCSnackbar, _MDCComponent);
  15913. function MDCSnackbar() {
  15914. _classCallCheck(this, MDCSnackbar);
  15915. return _possibleConstructorReturn(this, (MDCSnackbar.__proto__ || Object.getPrototypeOf(MDCSnackbar)).apply(this, arguments));
  15916. }
  15917. _createClass(MDCSnackbar, [{
  15918. key: 'show',
  15919. value: function show(data) {
  15920. this.foundation_.show(data);
  15921. }
  15922. }, {
  15923. key: 'getDefaultFoundation',
  15924. value: function getDefaultFoundation() {
  15925. var _this2 = this;
  15926. var _MDCSnackbarFoundatio = __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings,
  15927. TEXT_SELECTOR = _MDCSnackbarFoundatio.TEXT_SELECTOR,
  15928. ACTION_BUTTON_SELECTOR = _MDCSnackbarFoundatio.ACTION_BUTTON_SELECTOR;
  15929. var getText = function getText() {
  15930. return _this2.root_.querySelector(TEXT_SELECTOR);
  15931. };
  15932. var getActionButton = function getActionButton() {
  15933. return _this2.root_.querySelector(ACTION_BUTTON_SELECTOR);
  15934. };
  15935. /* eslint brace-style: "off" */
  15936. return new __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]({
  15937. addClass: function addClass(className) {
  15938. return _this2.root_.classList.add(className);
  15939. },
  15940. removeClass: function removeClass(className) {
  15941. return _this2.root_.classList.remove(className);
  15942. },
  15943. setAriaHidden: function setAriaHidden() {
  15944. return _this2.root_.setAttribute('aria-hidden', 'true');
  15945. },
  15946. unsetAriaHidden: function unsetAriaHidden() {
  15947. return _this2.root_.removeAttribute('aria-hidden');
  15948. },
  15949. setActionAriaHidden: function setActionAriaHidden() {
  15950. return getActionButton().setAttribute('aria-hidden', 'true');
  15951. },
  15952. unsetActionAriaHidden: function unsetActionAriaHidden() {
  15953. return getActionButton().removeAttribute('aria-hidden');
  15954. },
  15955. setActionText: function setActionText(text) {
  15956. getActionButton().textContent = text;
  15957. },
  15958. setMessageText: function setMessageText(text) {
  15959. getText().textContent = text;
  15960. },
  15961. setFocus: function setFocus() {
  15962. return getActionButton().focus();
  15963. },
  15964. isFocused: function isFocused() {
  15965. return document.activeElement === getActionButton();
  15966. },
  15967. visibilityIsHidden: function visibilityIsHidden() {
  15968. return document.hidden;
  15969. },
  15970. registerCapturedBlurHandler: function registerCapturedBlurHandler(handler) {
  15971. return getActionButton().addEventListener('blur', handler, true);
  15972. },
  15973. deregisterCapturedBlurHandler: function deregisterCapturedBlurHandler(handler) {
  15974. return getActionButton().removeEventListener('blur', handler, true);
  15975. },
  15976. registerVisibilityChangeHandler: function registerVisibilityChangeHandler(handler) {
  15977. return document.addEventListener('visibilitychange', handler);
  15978. },
  15979. deregisterVisibilityChangeHandler: function deregisterVisibilityChangeHandler(handler) {
  15980. return document.removeEventListener('visibilitychange', handler);
  15981. },
  15982. registerCapturedInteractionHandler: function registerCapturedInteractionHandler(evt, handler) {
  15983. return document.body.addEventListener(evt, handler, true);
  15984. },
  15985. deregisterCapturedInteractionHandler: function deregisterCapturedInteractionHandler(evt, handler) {
  15986. return document.body.removeEventListener(evt, handler, true);
  15987. },
  15988. registerActionClickHandler: function registerActionClickHandler(handler) {
  15989. return getActionButton().addEventListener('click', handler);
  15990. },
  15991. deregisterActionClickHandler: function deregisterActionClickHandler(handler) {
  15992. return getActionButton().removeEventListener('click', handler);
  15993. },
  15994. registerTransitionEndHandler: function registerTransitionEndHandler(handler) {
  15995. return _this2.root_.addEventListener(Object(__WEBPACK_IMPORTED_MODULE_2__material_animation_index__["a" /* getCorrectEventName */])(window, 'transitionend'), handler);
  15996. },
  15997. deregisterTransitionEndHandler: function deregisterTransitionEndHandler(handler) {
  15998. return _this2.root_.removeEventListener(Object(__WEBPACK_IMPORTED_MODULE_2__material_animation_index__["a" /* getCorrectEventName */])(window, 'transitionend'), handler);
  15999. },
  16000. notifyShow: function notifyShow() {
  16001. return _this2.emit(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.SHOW_EVENT);
  16002. },
  16003. notifyHide: function notifyHide() {
  16004. return _this2.emit(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.HIDE_EVENT);
  16005. }
  16006. });
  16007. }
  16008. }, {
  16009. key: 'dismissesOnAction',
  16010. get: function get() {
  16011. return this.foundation_.dismissesOnAction();
  16012. },
  16013. set: function set(dismissesOnAction) {
  16014. this.foundation_.setDismissOnAction(dismissesOnAction);
  16015. }
  16016. }], [{
  16017. key: 'attachTo',
  16018. value: function attachTo(root) {
  16019. return new MDCSnackbar(root);
  16020. }
  16021. }]);
  16022. return MDCSnackbar;
  16023. }(__WEBPACK_IMPORTED_MODULE_0__material_base_index__["MDCComponent"]);
  16024. /***/ }),
  16025. /* 115 */
  16026. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16027. "use strict";
  16028. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_index__ = __webpack_require__(3);
  16029. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(116);
  16030. 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; };
  16031. 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; }; }();
  16032. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  16033. 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; }
  16034. 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; }
  16035. /**
  16036. * @license
  16037. * Copyright 2016 Google Inc.
  16038. *
  16039. * Permission is hereby granted, free of charge, to any person obtaining a copy
  16040. * of this software and associated documentation files (the "Software"), to deal
  16041. * in the Software without restriction, including without limitation the rights
  16042. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  16043. * copies of the Software, and to permit persons to whom the Software is
  16044. * furnished to do so, subject to the following conditions:
  16045. *
  16046. * The above copyright notice and this permission notice shall be included in
  16047. * all copies or substantial portions of the Software.
  16048. *
  16049. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16050. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16051. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  16052. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  16053. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  16054. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  16055. * THE SOFTWARE.
  16056. */
  16057. var MDCSnackbarFoundation = function (_MDCFoundation) {
  16058. _inherits(MDCSnackbarFoundation, _MDCFoundation);
  16059. _createClass(MDCSnackbarFoundation, [{
  16060. key: 'active',
  16061. get: function get() {
  16062. return this.active_;
  16063. }
  16064. }], [{
  16065. key: 'cssClasses',
  16066. get: function get() {
  16067. return __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */];
  16068. }
  16069. }, {
  16070. key: 'strings',
  16071. get: function get() {
  16072. return __WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */];
  16073. }
  16074. }, {
  16075. key: 'defaultAdapter',
  16076. get: function get() {
  16077. return {
  16078. addClass: function addClass() /* className: string */{},
  16079. removeClass: function removeClass() /* className: string */{},
  16080. setAriaHidden: function setAriaHidden() {},
  16081. unsetAriaHidden: function unsetAriaHidden() {},
  16082. setActionAriaHidden: function setActionAriaHidden() {},
  16083. unsetActionAriaHidden: function unsetActionAriaHidden() {},
  16084. setActionText: function setActionText() /* actionText: string */{},
  16085. setMessageText: function setMessageText() /* message: string */{},
  16086. setFocus: function setFocus() {},
  16087. isFocused: function isFocused() {
  16088. return (/* boolean */false
  16089. );
  16090. },
  16091. visibilityIsHidden: function visibilityIsHidden() {
  16092. return (/* boolean */false
  16093. );
  16094. },
  16095. registerCapturedBlurHandler: function registerCapturedBlurHandler() /* handler: EventListener */{},
  16096. deregisterCapturedBlurHandler: function deregisterCapturedBlurHandler() /* handler: EventListener */{},
  16097. registerVisibilityChangeHandler: function registerVisibilityChangeHandler() /* handler: EventListener */{},
  16098. deregisterVisibilityChangeHandler: function deregisterVisibilityChangeHandler() /* handler: EventListener */{},
  16099. registerCapturedInteractionHandler: function registerCapturedInteractionHandler() /* evtType: string, handler: EventListener */{},
  16100. deregisterCapturedInteractionHandler: function deregisterCapturedInteractionHandler() /* evtType: string, handler: EventListener */{},
  16101. registerActionClickHandler: function registerActionClickHandler() /* handler: EventListener */{},
  16102. deregisterActionClickHandler: function deregisterActionClickHandler() /* handler: EventListener */{},
  16103. registerTransitionEndHandler: function registerTransitionEndHandler() /* handler: EventListener */{},
  16104. deregisterTransitionEndHandler: function deregisterTransitionEndHandler() /* handler: EventListener */{},
  16105. notifyShow: function notifyShow() {},
  16106. notifyHide: function notifyHide() {}
  16107. };
  16108. }
  16109. }]);
  16110. function MDCSnackbarFoundation(adapter) {
  16111. _classCallCheck(this, MDCSnackbarFoundation);
  16112. var _this = _possibleConstructorReturn(this, (MDCSnackbarFoundation.__proto__ || Object.getPrototypeOf(MDCSnackbarFoundation)).call(this, _extends(MDCSnackbarFoundation.defaultAdapter, adapter)));
  16113. _this.active_ = false;
  16114. _this.actionWasClicked_ = false;
  16115. _this.dismissOnAction_ = true;
  16116. _this.firstFocus_ = true;
  16117. _this.pointerDownRecognized_ = false;
  16118. _this.snackbarHasFocus_ = false;
  16119. _this.snackbarData_ = null;
  16120. _this.queue_ = [];
  16121. _this.actionClickHandler_ = function () {
  16122. _this.actionWasClicked_ = true;
  16123. _this.invokeAction_();
  16124. };
  16125. _this.visibilitychangeHandler_ = function () {
  16126. clearTimeout(_this.timeoutId_);
  16127. _this.snackbarHasFocus_ = true;
  16128. if (!_this.adapter_.visibilityIsHidden()) {
  16129. setTimeout(_this.cleanup_.bind(_this), _this.snackbarData_.timeout || __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* numbers */].MESSAGE_TIMEOUT);
  16130. }
  16131. };
  16132. _this.interactionHandler_ = function (evt) {
  16133. if (evt.type === 'focus' && !_this.adapter_.isFocused()) {
  16134. return;
  16135. }
  16136. if (evt.type === 'touchstart' || evt.type === 'mousedown') {
  16137. _this.pointerDownRecognized_ = true;
  16138. }
  16139. _this.handlePossibleTabKeyboardFocus_(evt);
  16140. if (evt.type === 'focus') {
  16141. _this.pointerDownRecognized_ = false;
  16142. }
  16143. };
  16144. _this.blurHandler_ = function () {
  16145. clearTimeout(_this.timeoutId_);
  16146. _this.snackbarHasFocus_ = false;
  16147. _this.timeoutId_ = setTimeout(_this.cleanup_.bind(_this), _this.snackbarData_.timeout || __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* numbers */].MESSAGE_TIMEOUT);
  16148. };
  16149. return _this;
  16150. }
  16151. _createClass(MDCSnackbarFoundation, [{
  16152. key: 'init',
  16153. value: function init() {
  16154. this.adapter_.registerActionClickHandler(this.actionClickHandler_);
  16155. this.adapter_.setAriaHidden();
  16156. this.adapter_.setActionAriaHidden();
  16157. }
  16158. }, {
  16159. key: 'destroy',
  16160. value: function destroy() {
  16161. var _this2 = this;
  16162. this.adapter_.deregisterActionClickHandler(this.actionClickHandler_);
  16163. this.adapter_.deregisterCapturedBlurHandler(this.blurHandler_);
  16164. this.adapter_.deregisterVisibilityChangeHandler(this.visibilitychangeHandler_);
  16165. ['touchstart', 'mousedown', 'focus'].forEach(function (evtType) {
  16166. _this2.adapter_.deregisterCapturedInteractionHandler(evtType, _this2.interactionHandler_);
  16167. });
  16168. }
  16169. }, {
  16170. key: 'dismissesOnAction',
  16171. value: function dismissesOnAction() {
  16172. return this.dismissOnAction_;
  16173. }
  16174. }, {
  16175. key: 'setDismissOnAction',
  16176. value: function setDismissOnAction(dismissOnAction) {
  16177. this.dismissOnAction_ = !!dismissOnAction;
  16178. }
  16179. }, {
  16180. key: 'show',
  16181. value: function show(data) {
  16182. var _this3 = this;
  16183. if (!data) {
  16184. throw new Error('Please provide a data object with at least a message to display.');
  16185. }
  16186. if (!data.message) {
  16187. throw new Error('Please provide a message to be displayed.');
  16188. }
  16189. if (data.actionHandler && !data.actionText) {
  16190. throw new Error('Please provide action text with the handler.');
  16191. }
  16192. if (this.active) {
  16193. this.queue_.push(data);
  16194. return;
  16195. }
  16196. clearTimeout(this.timeoutId_);
  16197. this.snackbarData_ = data;
  16198. this.firstFocus_ = true;
  16199. this.adapter_.registerVisibilityChangeHandler(this.visibilitychangeHandler_);
  16200. this.adapter_.registerCapturedBlurHandler(this.blurHandler_);
  16201. ['touchstart', 'mousedown', 'focus'].forEach(function (evtType) {
  16202. _this3.adapter_.registerCapturedInteractionHandler(evtType, _this3.interactionHandler_);
  16203. });
  16204. var ACTIVE = __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].ACTIVE,
  16205. MULTILINE = __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].MULTILINE,
  16206. ACTION_ON_BOTTOM = __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].ACTION_ON_BOTTOM;
  16207. this.adapter_.setMessageText(this.snackbarData_.message);
  16208. if (this.snackbarData_.multiline) {
  16209. this.adapter_.addClass(MULTILINE);
  16210. if (this.snackbarData_.actionOnBottom) {
  16211. this.adapter_.addClass(ACTION_ON_BOTTOM);
  16212. }
  16213. }
  16214. if (this.snackbarData_.actionHandler) {
  16215. this.adapter_.setActionText(this.snackbarData_.actionText);
  16216. this.actionHandler_ = this.snackbarData_.actionHandler;
  16217. this.setActionHidden_(false);
  16218. } else {
  16219. this.setActionHidden_(true);
  16220. this.actionHandler_ = null;
  16221. this.adapter_.setActionText(null);
  16222. }
  16223. this.active_ = true;
  16224. this.adapter_.addClass(ACTIVE);
  16225. this.adapter_.unsetAriaHidden();
  16226. this.adapter_.notifyShow();
  16227. this.timeoutId_ = setTimeout(this.cleanup_.bind(this), this.snackbarData_.timeout || __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* numbers */].MESSAGE_TIMEOUT);
  16228. }
  16229. }, {
  16230. key: 'handlePossibleTabKeyboardFocus_',
  16231. value: function handlePossibleTabKeyboardFocus_() {
  16232. var hijackFocus = this.firstFocus_ && !this.pointerDownRecognized_;
  16233. if (hijackFocus) {
  16234. this.setFocusOnAction_();
  16235. }
  16236. this.firstFocus_ = false;
  16237. }
  16238. }, {
  16239. key: 'setFocusOnAction_',
  16240. value: function setFocusOnAction_() {
  16241. this.adapter_.setFocus();
  16242. this.snackbarHasFocus_ = true;
  16243. this.firstFocus_ = false;
  16244. }
  16245. }, {
  16246. key: 'invokeAction_',
  16247. value: function invokeAction_() {
  16248. try {
  16249. if (!this.actionHandler_) {
  16250. return;
  16251. }
  16252. this.actionHandler_();
  16253. } finally {
  16254. if (this.dismissOnAction_) {
  16255. this.cleanup_();
  16256. }
  16257. }
  16258. }
  16259. }, {
  16260. key: 'cleanup_',
  16261. value: function cleanup_() {
  16262. var _this4 = this;
  16263. var allowDismissal = !this.snackbarHasFocus_ || this.actionWasClicked_;
  16264. if (allowDismissal) {
  16265. var ACTIVE = __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].ACTIVE,
  16266. MULTILINE = __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].MULTILINE,
  16267. ACTION_ON_BOTTOM = __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].ACTION_ON_BOTTOM;
  16268. this.adapter_.removeClass(ACTIVE);
  16269. var handler = function handler() {
  16270. clearTimeout(_this4.timeoutId_);
  16271. _this4.adapter_.deregisterTransitionEndHandler(handler);
  16272. _this4.adapter_.removeClass(MULTILINE);
  16273. _this4.adapter_.removeClass(ACTION_ON_BOTTOM);
  16274. _this4.setActionHidden_(true);
  16275. _this4.adapter_.setAriaHidden();
  16276. _this4.active_ = false;
  16277. _this4.snackbarHasFocus_ = false;
  16278. _this4.adapter_.notifyHide();
  16279. _this4.showNext_();
  16280. };
  16281. this.adapter_.registerTransitionEndHandler(handler);
  16282. }
  16283. }
  16284. }, {
  16285. key: 'showNext_',
  16286. value: function showNext_() {
  16287. if (!this.queue_.length) {
  16288. return;
  16289. }
  16290. this.show(this.queue_.shift());
  16291. }
  16292. }, {
  16293. key: 'setActionHidden_',
  16294. value: function setActionHidden_(isHidden) {
  16295. if (isHidden) {
  16296. this.adapter_.setActionAriaHidden();
  16297. } else {
  16298. this.adapter_.unsetActionAriaHidden();
  16299. }
  16300. }
  16301. }]);
  16302. return MDCSnackbarFoundation;
  16303. }(__WEBPACK_IMPORTED_MODULE_0__material_base_index__["MDCFoundation"]);
  16304. /* harmony default export */ __webpack_exports__["a"] = (MDCSnackbarFoundation);
  16305. /***/ }),
  16306. /* 116 */
  16307. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16308. "use strict";
  16309. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  16310. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; });
  16311. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; });
  16312. /**
  16313. * @license
  16314. * Copyright 2016 Google Inc.
  16315. *
  16316. * Permission is hereby granted, free of charge, to any person obtaining a copy
  16317. * of this software and associated documentation files (the "Software"), to deal
  16318. * in the Software without restriction, including without limitation the rights
  16319. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  16320. * copies of the Software, and to permit persons to whom the Software is
  16321. * furnished to do so, subject to the following conditions:
  16322. *
  16323. * The above copyright notice and this permission notice shall be included in
  16324. * all copies or substantial portions of the Software.
  16325. *
  16326. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16327. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16328. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  16329. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  16330. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  16331. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  16332. * THE SOFTWARE.
  16333. */
  16334. var cssClasses = {
  16335. ROOT: 'mdc-snackbar',
  16336. TEXT: 'mdc-snackbar__text',
  16337. ACTION_WRAPPER: 'mdc-snackbar__action-wrapper',
  16338. ACTION_BUTTON: 'mdc-snackbar__action-button',
  16339. ACTIVE: 'mdc-snackbar--active',
  16340. MULTILINE: 'mdc-snackbar--multiline',
  16341. ACTION_ON_BOTTOM: 'mdc-snackbar--action-on-bottom'
  16342. };
  16343. var strings = {
  16344. TEXT_SELECTOR: '.mdc-snackbar__text',
  16345. ACTION_WRAPPER_SELECTOR: '.mdc-snackbar__action-wrapper',
  16346. ACTION_BUTTON_SELECTOR: '.mdc-snackbar__action-button',
  16347. SHOW_EVENT: 'MDCSnackbar:show',
  16348. HIDE_EVENT: 'MDCSnackbar:hide'
  16349. };
  16350. var numbers = {
  16351. MESSAGE_TIMEOUT: 2750
  16352. };
  16353. /***/ }),
  16354. /* 117 */
  16355. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16356. "use strict";
  16357. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  16358. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSwitch", function() { return MDCSwitch; });
  16359. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  16360. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_selection_control_index__ = __webpack_require__(4);
  16361. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(118);
  16362. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_ripple_index__ = __webpack_require__(2);
  16363. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__material_ripple_util__ = __webpack_require__(6);
  16364. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSwitchFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  16365. 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; };
  16366. 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); } };
  16367. 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; }; }();
  16368. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  16369. 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; }
  16370. 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; }
  16371. /**
  16372. * @license
  16373. * Copyright 2018 Google Inc.
  16374. *
  16375. * Permission is hereby granted, free of charge, to any person obtaining a copy
  16376. * of this software and associated documentation files (the "Software"), to deal
  16377. * in the Software without restriction, including without limitation the rights
  16378. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  16379. * copies of the Software, and to permit persons to whom the Software is
  16380. * furnished to do so, subject to the following conditions:
  16381. *
  16382. * The above copyright notice and this permission notice shall be included in
  16383. * all copies or substantial portions of the Software.
  16384. *
  16385. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16386. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16387. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  16388. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  16389. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  16390. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  16391. * THE SOFTWARE.
  16392. */
  16393. /* eslint-disable no-unused-vars */
  16394. /* eslint-enable no-unused-vars */
  16395. /**
  16396. * @extends MDCComponent<!MDCSwitchFoundation>
  16397. * @implements {MDCSelectionControl}
  16398. */
  16399. var MDCSwitch = function (_MDCComponent) {
  16400. _inherits(MDCSwitch, _MDCComponent);
  16401. _createClass(MDCSwitch, null, [{
  16402. key: 'attachTo',
  16403. value: function attachTo(root) {
  16404. return new MDCSwitch(root);
  16405. }
  16406. }]);
  16407. function MDCSwitch() {
  16408. var _ref;
  16409. _classCallCheck(this, MDCSwitch);
  16410. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  16411. args[_key] = arguments[_key];
  16412. }
  16413. /** @private {!MDCRipple} */
  16414. var _this = _possibleConstructorReturn(this, (_ref = MDCSwitch.__proto__ || Object.getPrototypeOf(MDCSwitch)).call.apply(_ref, [this].concat(args)));
  16415. _this.ripple_ = _this.initRipple_();
  16416. /** @private {!Function} */
  16417. _this.changeHandler_;
  16418. return _this;
  16419. }
  16420. _createClass(MDCSwitch, [{
  16421. key: 'destroy',
  16422. value: function destroy() {
  16423. _get(MDCSwitch.prototype.__proto__ || Object.getPrototypeOf(MDCSwitch.prototype), 'destroy', this).call(this);
  16424. this.ripple_.destroy();
  16425. this.nativeControl_.removeEventListener('change', this.changeHandler_);
  16426. }
  16427. }, {
  16428. key: 'initialSyncWithDOM',
  16429. value: function initialSyncWithDOM() {
  16430. this.changeHandler_ = this.foundation_.handleChange.bind(this.foundation_);
  16431. this.nativeControl_.addEventListener('change', this.changeHandler_);
  16432. // Sometimes the checked state of the input element is saved in the history.
  16433. // The switch styling should match the checked state of the input element.
  16434. // Do an initial sync between the native control and the foundation.
  16435. this.checked = this.checked;
  16436. }
  16437. /**
  16438. * Returns the state of the native control element, or null if the native control element is not present.
  16439. * @return {?MDCSelectionControlState}
  16440. * @private
  16441. */
  16442. }, {
  16443. key: 'initRipple_',
  16444. /**
  16445. * @return {!MDCRipple}
  16446. * @private
  16447. */
  16448. value: function initRipple_() {
  16449. var _this2 = this;
  16450. var RIPPLE_SURFACE_SELECTOR = __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.RIPPLE_SURFACE_SELECTOR;
  16451. var rippleSurface = /** @type {!Element} */this.root_.querySelector(RIPPLE_SURFACE_SELECTOR);
  16452. var MATCHES = Object(__WEBPACK_IMPORTED_MODULE_4__material_ripple_util__["getMatchesProperty"])(HTMLElement.prototype);
  16453. var adapter = _extends(__WEBPACK_IMPORTED_MODULE_3__material_ripple_index__["MDCRipple"].createAdapter(this), {
  16454. isUnbounded: function isUnbounded() {
  16455. return true;
  16456. },
  16457. isSurfaceActive: function isSurfaceActive() {
  16458. return _this2.nativeControl_[MATCHES](':active');
  16459. },
  16460. addClass: function addClass(className) {
  16461. return rippleSurface.classList.add(className);
  16462. },
  16463. removeClass: function removeClass(className) {
  16464. return rippleSurface.classList.remove(className);
  16465. },
  16466. registerInteractionHandler: function registerInteractionHandler(type, handler) {
  16467. return _this2.nativeControl_.addEventListener(type, handler);
  16468. },
  16469. deregisterInteractionHandler: function deregisterInteractionHandler(type, handler) {
  16470. return _this2.nativeControl_.removeEventListener(type, handler);
  16471. },
  16472. updateCssVariable: function updateCssVariable(varName, value) {
  16473. return rippleSurface.style.setProperty(varName, value);
  16474. },
  16475. computeBoundingRect: function computeBoundingRect() {
  16476. return rippleSurface.getBoundingClientRect();
  16477. }
  16478. });
  16479. var foundation = new __WEBPACK_IMPORTED_MODULE_3__material_ripple_index__["MDCRippleFoundation"](adapter);
  16480. return new __WEBPACK_IMPORTED_MODULE_3__material_ripple_index__["MDCRipple"](this.root_, foundation);
  16481. }
  16482. /** @return {!MDCSwitchFoundation} */
  16483. }, {
  16484. key: 'getDefaultFoundation',
  16485. value: function getDefaultFoundation() {
  16486. var _this3 = this;
  16487. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]({
  16488. addClass: function addClass(className) {
  16489. return _this3.root_.classList.add(className);
  16490. },
  16491. removeClass: function removeClass(className) {
  16492. return _this3.root_.classList.remove(className);
  16493. },
  16494. setNativeControlChecked: function setNativeControlChecked(checked) {
  16495. return _this3.nativeControl_.checked = checked;
  16496. },
  16497. setNativeControlDisabled: function setNativeControlDisabled(disabled) {
  16498. return _this3.nativeControl_.disabled = disabled;
  16499. }
  16500. });
  16501. }
  16502. /** @return {!MDCRipple} */
  16503. }, {
  16504. key: 'nativeControl_',
  16505. get: function get() {
  16506. var NATIVE_CONTROL_SELECTOR = __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.NATIVE_CONTROL_SELECTOR;
  16507. var el = /** @type {?MDCSelectionControlState} */this.root_.querySelector(NATIVE_CONTROL_SELECTOR);
  16508. return el;
  16509. }
  16510. }, {
  16511. key: 'ripple',
  16512. get: function get() {
  16513. return this.ripple_;
  16514. }
  16515. /** @return {boolean} */
  16516. }, {
  16517. key: 'checked',
  16518. get: function get() {
  16519. return this.nativeControl_.checked;
  16520. }
  16521. /** @param {boolean} checked */
  16522. ,
  16523. set: function set(checked) {
  16524. this.foundation_.setChecked(checked);
  16525. }
  16526. /** @return {boolean} */
  16527. }, {
  16528. key: 'disabled',
  16529. get: function get() {
  16530. return this.nativeControl_.disabled;
  16531. }
  16532. /** @param {boolean} disabled */
  16533. ,
  16534. set: function set(disabled) {
  16535. this.foundation_.setDisabled(disabled);
  16536. }
  16537. }]);
  16538. return MDCSwitch;
  16539. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  16540. /***/ }),
  16541. /* 118 */
  16542. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16543. "use strict";
  16544. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  16545. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(119);
  16546. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(120);
  16547. 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; };
  16548. 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; }; }();
  16549. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  16550. 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; }
  16551. 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; }
  16552. /**
  16553. * @license
  16554. * Copyright 2018 Google Inc.
  16555. *
  16556. * Permission is hereby granted, free of charge, to any person obtaining a copy
  16557. * of this software and associated documentation files (the "Software"), to deal
  16558. * in the Software without restriction, including without limitation the rights
  16559. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  16560. * copies of the Software, and to permit persons to whom the Software is
  16561. * furnished to do so, subject to the following conditions:
  16562. *
  16563. * The above copyright notice and this permission notice shall be included in
  16564. * all copies or substantial portions of the Software.
  16565. *
  16566. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16567. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16568. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  16569. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  16570. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  16571. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  16572. * THE SOFTWARE.
  16573. */
  16574. /* eslint-enable no-unused-vars */
  16575. /**
  16576. * @extends {MDCFoundation<!MDCSwitchAdapter>}
  16577. */
  16578. var MDCSwitchFoundation = function (_MDCFoundation) {
  16579. _inherits(MDCSwitchFoundation, _MDCFoundation);
  16580. _createClass(MDCSwitchFoundation, null, [{
  16581. key: 'strings',
  16582. /** @return enum {string} */
  16583. get: function get() {
  16584. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  16585. }
  16586. /** @return enum {string} */
  16587. }, {
  16588. key: 'cssClasses',
  16589. get: function get() {
  16590. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  16591. }
  16592. /** @return {!MDCSwitchAdapter} */
  16593. }, {
  16594. key: 'defaultAdapter',
  16595. get: function get() {
  16596. return (/** @type {!MDCSwitchAdapter} */{
  16597. addClass: function addClass() /* className: string */{},
  16598. removeClass: function removeClass() /* className: string */{},
  16599. setNativeControlChecked: function setNativeControlChecked() /* checked: boolean */{},
  16600. setNativeControlDisabled: function setNativeControlDisabled() /* disabled: boolean */{}
  16601. }
  16602. );
  16603. }
  16604. }]);
  16605. function MDCSwitchFoundation(adapter) {
  16606. _classCallCheck(this, MDCSwitchFoundation);
  16607. return _possibleConstructorReturn(this, (MDCSwitchFoundation.__proto__ || Object.getPrototypeOf(MDCSwitchFoundation)).call(this, _extends(MDCSwitchFoundation.defaultAdapter, adapter)));
  16608. }
  16609. /** @param {boolean} checked */
  16610. _createClass(MDCSwitchFoundation, [{
  16611. key: 'setChecked',
  16612. value: function setChecked(checked) {
  16613. this.adapter_.setNativeControlChecked(checked);
  16614. this.updateCheckedStyling_(checked);
  16615. }
  16616. /** @param {boolean} disabled */
  16617. }, {
  16618. key: 'setDisabled',
  16619. value: function setDisabled(disabled) {
  16620. this.adapter_.setNativeControlDisabled(disabled);
  16621. if (disabled) {
  16622. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].DISABLED);
  16623. } else {
  16624. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].DISABLED);
  16625. }
  16626. }
  16627. /**
  16628. * Handles the change event for the switch native control.
  16629. * @param {!Event} evt
  16630. */
  16631. }, {
  16632. key: 'handleChange',
  16633. value: function handleChange(evt) {
  16634. this.updateCheckedStyling_(evt.target.checked);
  16635. }
  16636. /**
  16637. * Updates the styling of the switch based on its checked state.
  16638. * @param {boolean} checked
  16639. * @private
  16640. */
  16641. }, {
  16642. key: 'updateCheckedStyling_',
  16643. value: function updateCheckedStyling_(checked) {
  16644. if (checked) {
  16645. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CHECKED);
  16646. } else {
  16647. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CHECKED);
  16648. }
  16649. }
  16650. }]);
  16651. return MDCSwitchFoundation;
  16652. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  16653. /* harmony default export */ __webpack_exports__["a"] = (MDCSwitchFoundation);
  16654. /***/ }),
  16655. /* 119 */
  16656. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16657. "use strict";
  16658. 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; }; }();
  16659. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  16660. /**
  16661. * @license
  16662. * Copyright 2018 Google Inc.
  16663. *
  16664. * Permission is hereby granted, free of charge, to any person obtaining a copy
  16665. * of this software and associated documentation files (the "Software"), to deal
  16666. * in the Software without restriction, including without limitation the rights
  16667. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  16668. * copies of the Software, and to permit persons to whom the Software is
  16669. * furnished to do so, subject to the following conditions:
  16670. *
  16671. * The above copyright notice and this permission notice shall be included in
  16672. * all copies or substantial portions of the Software.
  16673. *
  16674. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16675. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16676. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  16677. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  16678. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  16679. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  16680. * THE SOFTWARE.
  16681. */
  16682. /* eslint no-unused-vars: [2, {"args": "none"}] */
  16683. /**
  16684. * Adapter for MDC Switch. Provides an interface for managing
  16685. * - classes
  16686. * - dom
  16687. *
  16688. * Additionally, provides type information for the adapter to the Closure
  16689. * compiler.
  16690. *
  16691. * Implement this adapter for your framework of choice to delegate updates to
  16692. * the component in your framework of choice. See architecture documentation
  16693. * for more details.
  16694. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  16695. *
  16696. * @record
  16697. */
  16698. var MDCSwitchAdapter = function () {
  16699. function MDCSwitchAdapter() {
  16700. _classCallCheck(this, MDCSwitchAdapter);
  16701. }
  16702. _createClass(MDCSwitchAdapter, [{
  16703. key: "addClass",
  16704. /** @param {string} className */
  16705. value: function addClass(className) {}
  16706. /** @param {string} className */
  16707. }, {
  16708. key: "removeClass",
  16709. value: function removeClass(className) {}
  16710. /** @param {boolean} checked */
  16711. }, {
  16712. key: "setNativeControlChecked",
  16713. value: function setNativeControlChecked(checked) {}
  16714. /** @param {boolean} disabled */
  16715. }, {
  16716. key: "setNativeControlDisabled",
  16717. value: function setNativeControlDisabled(disabled) {}
  16718. }]);
  16719. return MDCSwitchAdapter;
  16720. }();
  16721. /* unused harmony default export */ var _unused_webpack_default_export = (MDCSwitchAdapter);
  16722. /***/ }),
  16723. /* 120 */
  16724. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16725. "use strict";
  16726. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  16727. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  16728. /**
  16729. * @license
  16730. * Copyright 2018 Google Inc.
  16731. *
  16732. * Permission is hereby granted, free of charge, to any person obtaining a copy
  16733. * of this software and associated documentation files (the "Software"), to deal
  16734. * in the Software without restriction, including without limitation the rights
  16735. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  16736. * copies of the Software, and to permit persons to whom the Software is
  16737. * furnished to do so, subject to the following conditions:
  16738. *
  16739. * The above copyright notice and this permission notice shall be included in
  16740. * all copies or substantial portions of the Software.
  16741. *
  16742. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16743. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16744. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  16745. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  16746. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  16747. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  16748. * THE SOFTWARE.
  16749. */
  16750. /** @enum {string} */
  16751. var cssClasses = {
  16752. CHECKED: 'mdc-switch--checked',
  16753. DISABLED: 'mdc-switch--disabled'
  16754. };
  16755. /** @enum {string} */
  16756. var strings = {
  16757. NATIVE_CONTROL_SELECTOR: '.mdc-switch__native-control',
  16758. RIPPLE_SURFACE_SELECTOR: '.mdc-switch__thumb-underlay'
  16759. };
  16760. /***/ }),
  16761. /* 121 */
  16762. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16763. "use strict";
  16764. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  16765. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  16766. /**
  16767. * @license
  16768. * Copyright 2018 Google Inc.
  16769. *
  16770. * Permission is hereby granted, free of charge, to any person obtaining a copy
  16771. * of this software and associated documentation files (the "Software"), to deal
  16772. * in the Software without restriction, including without limitation the rights
  16773. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  16774. * copies of the Software, and to permit persons to whom the Software is
  16775. * furnished to do so, subject to the following conditions:
  16776. *
  16777. * The above copyright notice and this permission notice shall be included in
  16778. * all copies or substantial portions of the Software.
  16779. *
  16780. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16781. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16782. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  16783. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  16784. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  16785. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  16786. * THE SOFTWARE.
  16787. */
  16788. /** @enum {string} */
  16789. var cssClasses = {
  16790. ACTIVE: 'mdc-tab-indicator--active',
  16791. FADE: 'mdc-tab-indicator--fade',
  16792. NO_TRANSITION: 'mdc-tab-indicator--no-transition'
  16793. };
  16794. /** @enum {string} */
  16795. var strings = {
  16796. CONTENT_SELECTOR: '.mdc-tab-indicator__content'
  16797. };
  16798. /***/ }),
  16799. /* 122 */
  16800. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16801. "use strict";
  16802. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation__ = __webpack_require__(21);
  16803. 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; }; }();
  16804. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  16805. 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; }
  16806. 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; }
  16807. /**
  16808. * @license
  16809. * Copyright 2018 Google Inc.
  16810. *
  16811. * Permission is hereby granted, free of charge, to any person obtaining a copy
  16812. * of this software and associated documentation files (the "Software"), to deal
  16813. * in the Software without restriction, including without limitation the rights
  16814. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  16815. * copies of the Software, and to permit persons to whom the Software is
  16816. * furnished to do so, subject to the following conditions:
  16817. *
  16818. * The above copyright notice and this permission notice shall be included in
  16819. * all copies or substantial portions of the Software.
  16820. *
  16821. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16822. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16823. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  16824. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  16825. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  16826. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  16827. * THE SOFTWARE.
  16828. */
  16829. /**
  16830. * @extends {MDCTabIndicatorFoundation}
  16831. * @final
  16832. */
  16833. var MDCSlidingTabIndicatorFoundation = function (_MDCTabIndicatorFound) {
  16834. _inherits(MDCSlidingTabIndicatorFoundation, _MDCTabIndicatorFound);
  16835. function MDCSlidingTabIndicatorFoundation() {
  16836. _classCallCheck(this, MDCSlidingTabIndicatorFoundation);
  16837. return _possibleConstructorReturn(this, (MDCSlidingTabIndicatorFoundation.__proto__ || Object.getPrototypeOf(MDCSlidingTabIndicatorFoundation)).apply(this, arguments));
  16838. }
  16839. _createClass(MDCSlidingTabIndicatorFoundation, [{
  16840. key: 'activate',
  16841. /** @param {!ClientRect=} previousIndicatorClientRect */
  16842. value: function activate(previousIndicatorClientRect) {
  16843. // Early exit if no indicator is present to handle cases where an indicator
  16844. // may be activated without a prior indicator state
  16845. if (!previousIndicatorClientRect) {
  16846. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */].cssClasses.ACTIVE);
  16847. return;
  16848. }
  16849. // This animation uses the FLIP approach. You can read more about it at the link below:
  16850. // https://aerotwist.com/blog/flip-your-animations/
  16851. // Calculate the dimensions based on the dimensions of the previous indicator
  16852. var currentClientRect = this.computeContentClientRect();
  16853. var widthDelta = previousIndicatorClientRect.width / currentClientRect.width;
  16854. var xPosition = previousIndicatorClientRect.left - currentClientRect.left;
  16855. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */].cssClasses.NO_TRANSITION);
  16856. this.adapter_.setContentStyleProperty('transform', 'translateX(' + xPosition + 'px) scaleX(' + widthDelta + ')');
  16857. // Force repaint before updating classes and transform to ensure the transform properly takes effect
  16858. this.computeContentClientRect();
  16859. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */].cssClasses.NO_TRANSITION);
  16860. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */].cssClasses.ACTIVE);
  16861. this.adapter_.setContentStyleProperty('transform', '');
  16862. }
  16863. }, {
  16864. key: 'deactivate',
  16865. value: function deactivate() {
  16866. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */].cssClasses.ACTIVE);
  16867. }
  16868. }]);
  16869. return MDCSlidingTabIndicatorFoundation;
  16870. }(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */]);
  16871. /* harmony default export */ __webpack_exports__["a"] = (MDCSlidingTabIndicatorFoundation);
  16872. /***/ }),
  16873. /* 123 */
  16874. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16875. "use strict";
  16876. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation__ = __webpack_require__(21);
  16877. 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; }; }();
  16878. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  16879. 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; }
  16880. 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; }
  16881. /**
  16882. * @license
  16883. * Copyright 2018 Google Inc.
  16884. *
  16885. * Permission is hereby granted, free of charge, to any person obtaining a copy
  16886. * of this software and associated documentation files (the "Software"), to deal
  16887. * in the Software without restriction, including without limitation the rights
  16888. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  16889. * copies of the Software, and to permit persons to whom the Software is
  16890. * furnished to do so, subject to the following conditions:
  16891. *
  16892. * The above copyright notice and this permission notice shall be included in
  16893. * all copies or substantial portions of the Software.
  16894. *
  16895. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16896. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16897. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  16898. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  16899. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  16900. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  16901. * THE SOFTWARE.
  16902. */
  16903. /**
  16904. * @extends {MDCTabIndicatorFoundation}
  16905. * @final
  16906. */
  16907. var MDCFadingTabIndicatorFoundation = function (_MDCTabIndicatorFound) {
  16908. _inherits(MDCFadingTabIndicatorFoundation, _MDCTabIndicatorFound);
  16909. function MDCFadingTabIndicatorFoundation() {
  16910. _classCallCheck(this, MDCFadingTabIndicatorFoundation);
  16911. return _possibleConstructorReturn(this, (MDCFadingTabIndicatorFoundation.__proto__ || Object.getPrototypeOf(MDCFadingTabIndicatorFoundation)).apply(this, arguments));
  16912. }
  16913. _createClass(MDCFadingTabIndicatorFoundation, [{
  16914. key: 'activate',
  16915. value: function activate() {
  16916. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */].cssClasses.ACTIVE);
  16917. }
  16918. }, {
  16919. key: 'deactivate',
  16920. value: function deactivate() {
  16921. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */].cssClasses.ACTIVE);
  16922. }
  16923. }]);
  16924. return MDCFadingTabIndicatorFoundation;
  16925. }(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */]);
  16926. /* harmony default export */ __webpack_exports__["a"] = (MDCFadingTabIndicatorFoundation);
  16927. /***/ }),
  16928. /* 124 */
  16929. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16930. "use strict";
  16931. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  16932. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(10);
  16933. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(125);
  16934. 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; };
  16935. 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; }; }();
  16936. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  16937. 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; }
  16938. 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; }
  16939. /**
  16940. * @license
  16941. * Copyright 2018 Google Inc.
  16942. *
  16943. * Permission is hereby granted, free of charge, to any person obtaining a copy
  16944. * of this software and associated documentation files (the "Software"), to deal
  16945. * in the Software without restriction, including without limitation the rights
  16946. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  16947. * copies of the Software, and to permit persons to whom the Software is
  16948. * furnished to do so, subject to the following conditions:
  16949. *
  16950. * The above copyright notice and this permission notice shall be included in
  16951. * all copies or substantial portions of the Software.
  16952. *
  16953. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16954. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16955. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  16956. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  16957. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  16958. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  16959. * THE SOFTWARE.
  16960. */
  16961. /* eslint-disable no-unused-vars */
  16962. /* eslint-enable no-unused-vars */
  16963. /**
  16964. * @extends {MDCFoundation<!MDCTabAdapter>}
  16965. * @final
  16966. */
  16967. var MDCTabFoundation = function (_MDCFoundation) {
  16968. _inherits(MDCTabFoundation, _MDCFoundation);
  16969. _createClass(MDCTabFoundation, null, [{
  16970. key: 'cssClasses',
  16971. /** @return enum {string} */
  16972. get: function get() {
  16973. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  16974. }
  16975. /** @return enum {string} */
  16976. }, {
  16977. key: 'strings',
  16978. get: function get() {
  16979. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  16980. }
  16981. /**
  16982. * @see MDCTabAdapter for typing information
  16983. * @return {!MDCTabAdapter}
  16984. */
  16985. }, {
  16986. key: 'defaultAdapter',
  16987. get: function get() {
  16988. return (/** @type {!MDCTabAdapter} */{
  16989. addClass: function addClass() {},
  16990. removeClass: function removeClass() {},
  16991. hasClass: function hasClass() {},
  16992. setAttr: function setAttr() {},
  16993. activateIndicator: function activateIndicator() {},
  16994. deactivateIndicator: function deactivateIndicator() {},
  16995. notifyInteracted: function notifyInteracted() {},
  16996. getOffsetLeft: function getOffsetLeft() {},
  16997. getOffsetWidth: function getOffsetWidth() {},
  16998. getContentOffsetLeft: function getContentOffsetLeft() {},
  16999. getContentOffsetWidth: function getContentOffsetWidth() {},
  17000. focus: function focus() {}
  17001. }
  17002. );
  17003. }
  17004. /** @param {!MDCTabAdapter} adapter */
  17005. }]);
  17006. function MDCTabFoundation(adapter) {
  17007. _classCallCheck(this, MDCTabFoundation);
  17008. /** @private {function(?Event): undefined} */
  17009. var _this = _possibleConstructorReturn(this, (MDCTabFoundation.__proto__ || Object.getPrototypeOf(MDCTabFoundation)).call(this, _extends(MDCTabFoundation.defaultAdapter, adapter)));
  17010. _this.handleClick_ = function () {
  17011. return _this.handleClick();
  17012. };
  17013. return _this;
  17014. }
  17015. /**
  17016. * Handles the "click" event
  17017. */
  17018. _createClass(MDCTabFoundation, [{
  17019. key: 'handleClick',
  17020. value: function handleClick() {
  17021. // It's up to the parent component to keep track of the active Tab and
  17022. // ensure we don't activate a Tab that's already active.
  17023. this.adapter_.notifyInteracted();
  17024. }
  17025. /**
  17026. * Returns the Tab's active state
  17027. * @return {boolean}
  17028. */
  17029. }, {
  17030. key: 'isActive',
  17031. value: function isActive() {
  17032. return this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ACTIVE);
  17033. }
  17034. /**
  17035. * Activates the Tab
  17036. * @param {!ClientRect=} previousIndicatorClientRect
  17037. */
  17038. }, {
  17039. key: 'activate',
  17040. value: function activate(previousIndicatorClientRect) {
  17041. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ACTIVE);
  17042. this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_SELECTED, 'true');
  17043. this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].TABINDEX, '0');
  17044. this.adapter_.activateIndicator(previousIndicatorClientRect);
  17045. this.adapter_.focus();
  17046. }
  17047. /**
  17048. * Deactivates the Tab
  17049. */
  17050. }, {
  17051. key: 'deactivate',
  17052. value: function deactivate() {
  17053. // Early exit
  17054. if (!this.isActive()) {
  17055. return;
  17056. }
  17057. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ACTIVE);
  17058. this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_SELECTED, 'false');
  17059. this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].TABINDEX, '-1');
  17060. this.adapter_.deactivateIndicator();
  17061. }
  17062. /**
  17063. * Returns the dimensions of the Tab
  17064. * @return {!MDCTabDimensions}
  17065. */
  17066. }, {
  17067. key: 'computeDimensions',
  17068. value: function computeDimensions() {
  17069. var rootWidth = this.adapter_.getOffsetWidth();
  17070. var rootLeft = this.adapter_.getOffsetLeft();
  17071. var contentWidth = this.adapter_.getContentOffsetWidth();
  17072. var contentLeft = this.adapter_.getContentOffsetLeft();
  17073. return {
  17074. rootLeft: rootLeft,
  17075. rootRight: rootLeft + rootWidth,
  17076. contentLeft: rootLeft + contentLeft,
  17077. contentRight: rootLeft + contentLeft + contentWidth
  17078. };
  17079. }
  17080. }]);
  17081. return MDCTabFoundation;
  17082. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  17083. /* harmony default export */ __webpack_exports__["a"] = (MDCTabFoundation);
  17084. /***/ }),
  17085. /* 125 */
  17086. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17087. "use strict";
  17088. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  17089. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  17090. /**
  17091. * @license
  17092. * Copyright 2018 Google Inc.
  17093. *
  17094. * Permission is hereby granted, free of charge, to any person obtaining a copy
  17095. * of this software and associated documentation files (the "Software"), to deal
  17096. * in the Software without restriction, including without limitation the rights
  17097. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  17098. * copies of the Software, and to permit persons to whom the Software is
  17099. * furnished to do so, subject to the following conditions:
  17100. *
  17101. * The above copyright notice and this permission notice shall be included in
  17102. * all copies or substantial portions of the Software.
  17103. *
  17104. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17105. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17106. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17107. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  17108. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  17109. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  17110. * THE SOFTWARE.
  17111. */
  17112. /** @enum {string} */
  17113. var cssClasses = {
  17114. ACTIVE: 'mdc-tab--active'
  17115. };
  17116. /** @enum {string} */
  17117. var strings = {
  17118. ARIA_SELECTED: 'aria-selected',
  17119. RIPPLE_SELECTOR: '.mdc-tab__ripple',
  17120. CONTENT_SELECTOR: '.mdc-tab__content',
  17121. TAB_INDICATOR_SELECTOR: '.mdc-tab-indicator',
  17122. TABINDEX: 'tabIndex',
  17123. INTERACTED_EVENT: 'MDCTab:interacted'
  17124. };
  17125. /***/ }),
  17126. /* 126 */
  17127. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17128. "use strict";
  17129. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  17130. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTabBar", function() { return MDCTabBar; });
  17131. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  17132. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_tab_index__ = __webpack_require__(20);
  17133. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_tab_scroller_index__ = __webpack_require__(49);
  17134. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__adapter__ = __webpack_require__(51);
  17135. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation__ = __webpack_require__(132);
  17136. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTabBarFoundation", function() { return __WEBPACK_IMPORTED_MODULE_4__foundation__["a"]; });
  17137. 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; }; }();
  17138. 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); } };
  17139. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  17140. 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; }
  17141. 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; }
  17142. /**
  17143. * @license
  17144. * Copyright 2018 Google Inc.
  17145. *
  17146. * Permission is hereby granted, free of charge, to any person obtaining a copy
  17147. * of this software and associated documentation files (the "Software"), to deal
  17148. * in the Software without restriction, including without limitation the rights
  17149. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  17150. * copies of the Software, and to permit persons to whom the Software is
  17151. * furnished to do so, subject to the following conditions:
  17152. *
  17153. * The above copyright notice and this permission notice shall be included in
  17154. * all copies or substantial portions of the Software.
  17155. *
  17156. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17157. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17158. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17159. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  17160. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  17161. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  17162. * THE SOFTWARE.
  17163. */
  17164. /**
  17165. * @extends {MDCComponent<!MDCTabBarFoundation>}
  17166. * @final
  17167. */
  17168. var MDCTabBar = function (_MDCComponent) {
  17169. _inherits(MDCTabBar, _MDCComponent);
  17170. /**
  17171. * @param {...?} args
  17172. */
  17173. function MDCTabBar() {
  17174. var _ref;
  17175. _classCallCheck(this, MDCTabBar);
  17176. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  17177. args[_key] = arguments[_key];
  17178. }
  17179. /** @private {!Array<!MDCTab>} */
  17180. var _this = _possibleConstructorReturn(this, (_ref = MDCTabBar.__proto__ || Object.getPrototypeOf(MDCTabBar)).call.apply(_ref, [this].concat(args)));
  17181. _this.tabList_;
  17182. /** @type {(function(!Element): !MDCTab)} */
  17183. _this.tabFactory_;
  17184. /** @private {?MDCTabScroller} */
  17185. _this.tabScroller_;
  17186. /** @type {(function(!Element): !MDCTabScroller)} */
  17187. _this.tabScrollerFactory_;
  17188. /** @private {?function(?Event): undefined} */
  17189. _this.handleTabInteraction_;
  17190. /** @private {?function(?Event): undefined} */
  17191. _this.handleKeyDown_;
  17192. return _this;
  17193. }
  17194. /**
  17195. * @param {!Element} root
  17196. * @return {!MDCTabBar}
  17197. */
  17198. _createClass(MDCTabBar, [{
  17199. key: 'initialize',
  17200. /**
  17201. * @param {(function(!Element): !MDCTab)=} tabFactory A function which creates a new MDCTab
  17202. * @param {(function(!Element): !MDCTabScroller)=} tabScrollerFactory A function which creates a new MDCTabScroller
  17203. */
  17204. value: function initialize() {
  17205. var _this2 = this;
  17206. var tabFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (el) {
  17207. return new __WEBPACK_IMPORTED_MODULE_1__material_tab_index__["MDCTab"](el);
  17208. };
  17209. var tabScrollerFactory = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (el) {
  17210. return new __WEBPACK_IMPORTED_MODULE_2__material_tab_scroller_index__["MDCTabScroller"](el);
  17211. };
  17212. this.tabFactory_ = tabFactory;
  17213. this.tabScrollerFactory_ = tabScrollerFactory;
  17214. this.tabList_ = this.getTabElements_().map(function (el) {
  17215. return _this2.tabFactory_(el);
  17216. });
  17217. var tabScrollerElement = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* default */].strings.TAB_SCROLLER_SELECTOR);
  17218. if (tabScrollerElement) {
  17219. this.tabScroller_ = this.tabScrollerFactory_(tabScrollerElement);
  17220. }
  17221. }
  17222. }, {
  17223. key: 'initialSyncWithDOM',
  17224. value: function initialSyncWithDOM() {
  17225. var _this3 = this;
  17226. this.handleTabInteraction_ = function (evt) {
  17227. return _this3.foundation_.handleTabInteraction(evt);
  17228. };
  17229. this.handleKeyDown_ = function (evt) {
  17230. return _this3.foundation_.handleKeyDown(evt);
  17231. };
  17232. this.root_.addEventListener(__WEBPACK_IMPORTED_MODULE_1__material_tab_index__["MDCTabFoundation"].strings.INTERACTED_EVENT, this.handleTabInteraction_);
  17233. this.root_.addEventListener('keydown', this.handleKeyDown_);
  17234. for (var i = 0; i < this.tabList_.length; i++) {
  17235. if (this.tabList_[i].active) {
  17236. this.scrollIntoView(i);
  17237. break;
  17238. }
  17239. }
  17240. }
  17241. }, {
  17242. key: 'destroy',
  17243. value: function destroy() {
  17244. _get(MDCTabBar.prototype.__proto__ || Object.getPrototypeOf(MDCTabBar.prototype), 'destroy', this).call(this);
  17245. this.root_.removeEventListener(__WEBPACK_IMPORTED_MODULE_1__material_tab_index__["MDCTabFoundation"].strings.INTERACTED_EVENT, this.handleTabInteraction_);
  17246. this.root_.removeEventListener('keydown', this.handleKeyDown_);
  17247. this.tabList_.forEach(function (tab) {
  17248. return tab.destroy();
  17249. });
  17250. this.tabScroller_.destroy();
  17251. }
  17252. /**
  17253. * @return {!MDCTabBarFoundation}
  17254. */
  17255. }, {
  17256. key: 'getDefaultFoundation',
  17257. value: function getDefaultFoundation() {
  17258. var _this4 = this;
  17259. return new __WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* default */](
  17260. /** @type {!MDCTabBarAdapter} */{
  17261. scrollTo: function scrollTo(scrollX) {
  17262. return _this4.tabScroller_.scrollTo(scrollX);
  17263. },
  17264. incrementScroll: function incrementScroll(scrollXIncrement) {
  17265. return _this4.tabScroller_.incrementScroll(scrollXIncrement);
  17266. },
  17267. getScrollPosition: function getScrollPosition() {
  17268. return _this4.tabScroller_.getScrollPosition();
  17269. },
  17270. getScrollContentWidth: function getScrollContentWidth() {
  17271. return _this4.tabScroller_.getScrollContentWidth();
  17272. },
  17273. getOffsetWidth: function getOffsetWidth() {
  17274. return _this4.root_.offsetWidth;
  17275. },
  17276. isRTL: function isRTL() {
  17277. return window.getComputedStyle(_this4.root_).getPropertyValue('direction') === 'rtl';
  17278. },
  17279. setActiveTab: function setActiveTab(index) {
  17280. return _this4.foundation_.activateTab(index);
  17281. },
  17282. activateTabAtIndex: function activateTabAtIndex(index, clientRect) {
  17283. return _this4.tabList_[index].activate(clientRect);
  17284. },
  17285. deactivateTabAtIndex: function deactivateTabAtIndex(index) {
  17286. return _this4.tabList_[index].deactivate();
  17287. },
  17288. focusTabAtIndex: function focusTabAtIndex(index) {
  17289. return _this4.tabList_[index].focus();
  17290. },
  17291. getTabIndicatorClientRectAtIndex: function getTabIndicatorClientRectAtIndex(index) {
  17292. return _this4.tabList_[index].computeIndicatorClientRect();
  17293. },
  17294. getTabDimensionsAtIndex: function getTabDimensionsAtIndex(index) {
  17295. return _this4.tabList_[index].computeDimensions();
  17296. },
  17297. getPreviousActiveTabIndex: function getPreviousActiveTabIndex() {
  17298. for (var i = 0; i < _this4.tabList_.length; i++) {
  17299. if (_this4.tabList_[i].active) {
  17300. return i;
  17301. }
  17302. }
  17303. return -1;
  17304. },
  17305. getFocusedTabIndex: function getFocusedTabIndex() {
  17306. var tabElements = _this4.getTabElements_();
  17307. var activeElement = document.activeElement;
  17308. return tabElements.indexOf(activeElement);
  17309. },
  17310. getIndexOfTab: function getIndexOfTab(tabToFind) {
  17311. return _this4.tabList_.indexOf(tabToFind);
  17312. },
  17313. getTabListLength: function getTabListLength() {
  17314. return _this4.tabList_.length;
  17315. },
  17316. notifyTabActivated: function notifyTabActivated(index) {
  17317. return _this4.emit(__WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* default */].strings.TAB_ACTIVATED_EVENT, { index: index }, true);
  17318. }
  17319. });
  17320. }
  17321. /**
  17322. * Activates the tab at the given index
  17323. * @param {number} index The index of the tab
  17324. */
  17325. }, {
  17326. key: 'activateTab',
  17327. value: function activateTab(index) {
  17328. this.foundation_.activateTab(index);
  17329. }
  17330. /**
  17331. * Scrolls the tab at the given index into view
  17332. * @param {number} index THe index of the tab
  17333. */
  17334. }, {
  17335. key: 'scrollIntoView',
  17336. value: function scrollIntoView(index) {
  17337. this.foundation_.scrollIntoView(index);
  17338. }
  17339. }, {
  17340. key: 'getTabElements_',
  17341. value: function getTabElements_() {
  17342. return [].slice.call(this.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* default */].strings.TAB_SELECTOR));
  17343. }
  17344. }, {
  17345. key: 'useAutomaticActivation',
  17346. set: function set(useAutomaticActivation) {
  17347. this.foundation_.setUseAutomaticActivation(useAutomaticActivation);
  17348. }
  17349. }], [{
  17350. key: 'attachTo',
  17351. value: function attachTo(root) {
  17352. return new MDCTabBar(root);
  17353. }
  17354. }]);
  17355. return MDCTabBar;
  17356. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  17357. /***/ }),
  17358. /* 127 */
  17359. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17360. "use strict";
  17361. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  17362. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(50);
  17363. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__adapter__ = __webpack_require__(5);
  17364. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__rtl_scroller__ = __webpack_require__(11);
  17365. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__rtl_default_scroller__ = __webpack_require__(128);
  17366. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__rtl_negative_scroller__ = __webpack_require__(129);
  17367. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__rtl_reverse_scroller__ = __webpack_require__(130);
  17368. 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; };
  17369. 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; }; }();
  17370. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  17371. 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; }
  17372. 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; }
  17373. /**
  17374. * @license
  17375. * Copyright 2018 Google Inc.
  17376. *
  17377. * Permission is hereby granted, free of charge, to any person obtaining a copy
  17378. * of this software and associated documentation files (the "Software"), to deal
  17379. * in the Software without restriction, including without limitation the rights
  17380. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  17381. * copies of the Software, and to permit persons to whom the Software is
  17382. * furnished to do so, subject to the following conditions:
  17383. *
  17384. * The above copyright notice and this permission notice shall be included in
  17385. * all copies or substantial portions of the Software.
  17386. *
  17387. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17388. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17389. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17390. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  17391. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  17392. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  17393. * THE SOFTWARE.
  17394. */
  17395. /* eslint-disable no-unused-vars */
  17396. /* eslint-enable no-unused-vars */
  17397. /**
  17398. * @extends {MDCFoundation<!MDCTabScrollerAdapter>}
  17399. * @final
  17400. */
  17401. var MDCTabScrollerFoundation = function (_MDCFoundation) {
  17402. _inherits(MDCTabScrollerFoundation, _MDCFoundation);
  17403. _createClass(MDCTabScrollerFoundation, null, [{
  17404. key: 'cssClasses',
  17405. /** @return enum {string} */
  17406. get: function get() {
  17407. return __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */];
  17408. }
  17409. /** @return enum {string} */
  17410. }, {
  17411. key: 'strings',
  17412. get: function get() {
  17413. return __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */];
  17414. }
  17415. /**
  17416. * @see MDCTabScrollerAdapter for typing information
  17417. * @return {!MDCTabScrollerAdapter}
  17418. */
  17419. }, {
  17420. key: 'defaultAdapter',
  17421. get: function get() {
  17422. return (/** @type {!MDCTabScrollerAdapter} */{
  17423. eventTargetMatchesSelector: function eventTargetMatchesSelector() {},
  17424. addClass: function addClass() {},
  17425. removeClass: function removeClass() {},
  17426. addScrollAreaClass: function addScrollAreaClass() {},
  17427. setScrollAreaStyleProperty: function setScrollAreaStyleProperty() {},
  17428. setScrollContentStyleProperty: function setScrollContentStyleProperty() {},
  17429. getScrollContentStyleValue: function getScrollContentStyleValue() {},
  17430. setScrollAreaScrollLeft: function setScrollAreaScrollLeft() {},
  17431. getScrollAreaScrollLeft: function getScrollAreaScrollLeft() {},
  17432. getScrollContentOffsetWidth: function getScrollContentOffsetWidth() {},
  17433. getScrollAreaOffsetWidth: function getScrollAreaOffsetWidth() {},
  17434. computeScrollAreaClientRect: function computeScrollAreaClientRect() {},
  17435. computeScrollContentClientRect: function computeScrollContentClientRect() {},
  17436. computeHorizontalScrollbarHeight: function computeHorizontalScrollbarHeight() {}
  17437. }
  17438. );
  17439. }
  17440. /** @param {!MDCTabScrollerAdapter} adapter */
  17441. }]);
  17442. function MDCTabScrollerFoundation(adapter) {
  17443. _classCallCheck(this, MDCTabScrollerFoundation);
  17444. /**
  17445. * This boolean controls whether we should handle the transitionend and interaction events during the animation.
  17446. * @private {boolean}
  17447. */
  17448. var _this = _possibleConstructorReturn(this, (MDCTabScrollerFoundation.__proto__ || Object.getPrototypeOf(MDCTabScrollerFoundation)).call(this, _extends(MDCTabScrollerFoundation.defaultAdapter, adapter)));
  17449. _this.isAnimating_ = false;
  17450. /**
  17451. * The MDCTabScrollerRTL instance varies per browser and allows us to encapsulate the peculiar browser behavior
  17452. * of RTL scrolling in it's own class.
  17453. * @private {?MDCTabScrollerRTL}
  17454. */
  17455. _this.rtlScrollerInstance_;
  17456. return _this;
  17457. }
  17458. _createClass(MDCTabScrollerFoundation, [{
  17459. key: 'init',
  17460. value: function init() {
  17461. // Compute horizontal scrollbar height on scroller with overflow initially hidden, then update overflow to scroll
  17462. // and immediately adjust bottom margin to avoid the scrollbar initially appearing before JS runs.
  17463. var horizontalScrollbarHeight = this.adapter_.computeHorizontalScrollbarHeight();
  17464. this.adapter_.setScrollAreaStyleProperty('margin-bottom', -horizontalScrollbarHeight + 'px');
  17465. this.adapter_.addScrollAreaClass(MDCTabScrollerFoundation.cssClasses.SCROLL_AREA_SCROLL);
  17466. }
  17467. /**
  17468. * Computes the current visual scroll position
  17469. * @return {number}
  17470. */
  17471. }, {
  17472. key: 'getScrollPosition',
  17473. value: function getScrollPosition() {
  17474. if (this.isRTL_()) {
  17475. return this.computeCurrentScrollPositionRTL_();
  17476. }
  17477. var currentTranslateX = this.calculateCurrentTranslateX_();
  17478. var scrollLeft = this.adapter_.getScrollAreaScrollLeft();
  17479. return scrollLeft - currentTranslateX;
  17480. }
  17481. /**
  17482. * Handles interaction events that occur during transition
  17483. */
  17484. }, {
  17485. key: 'handleInteraction',
  17486. value: function handleInteraction() {
  17487. // Early exit if we aren't animating
  17488. if (!this.isAnimating_) {
  17489. return;
  17490. }
  17491. // Prevent other event listeners from handling this event
  17492. this.stopScrollAnimation_();
  17493. }
  17494. /**
  17495. * Handles the transitionend event
  17496. * @param {!Event} evt
  17497. */
  17498. }, {
  17499. key: 'handleTransitionEnd',
  17500. value: function handleTransitionEnd(evt) {
  17501. // Early exit if we aren't animating or the event was triggered by a different element.
  17502. if (!this.isAnimating_ || !this.adapter_.eventTargetMatchesSelector(evt.target, MDCTabScrollerFoundation.strings.CONTENT_SELECTOR)) {
  17503. return;
  17504. }
  17505. this.isAnimating_ = false;
  17506. this.adapter_.removeClass(MDCTabScrollerFoundation.cssClasses.ANIMATING);
  17507. }
  17508. /**
  17509. * Increment the scroll value by the scrollXIncrement
  17510. * @param {number} scrollXIncrement The value by which to increment the scroll position
  17511. */
  17512. }, {
  17513. key: 'incrementScroll',
  17514. value: function incrementScroll(scrollXIncrement) {
  17515. // Early exit for non-operational increment values
  17516. if (scrollXIncrement === 0) {
  17517. return;
  17518. }
  17519. if (this.isRTL_()) {
  17520. return this.incrementScrollRTL_(scrollXIncrement);
  17521. }
  17522. this.incrementScroll_(scrollXIncrement);
  17523. }
  17524. /**
  17525. * Scrolls to the given scrollX value
  17526. * @param {number} scrollX
  17527. */
  17528. }, {
  17529. key: 'scrollTo',
  17530. value: function scrollTo(scrollX) {
  17531. if (this.isRTL_()) {
  17532. return this.scrollToRTL_(scrollX);
  17533. }
  17534. this.scrollTo_(scrollX);
  17535. }
  17536. /**
  17537. * Returns the appropriate version of the MDCTabScrollerRTL
  17538. * @return {!MDCTabScrollerRTL}
  17539. */
  17540. }, {
  17541. key: 'getRTLScroller',
  17542. value: function getRTLScroller() {
  17543. if (!this.rtlScrollerInstance_) {
  17544. this.rtlScrollerInstance_ = this.rtlScrollerFactory_();
  17545. }
  17546. return this.rtlScrollerInstance_;
  17547. }
  17548. /**
  17549. * Returns the translateX value from a CSS matrix transform function string
  17550. * @return {number}
  17551. * @private
  17552. */
  17553. }, {
  17554. key: 'calculateCurrentTranslateX_',
  17555. value: function calculateCurrentTranslateX_() {
  17556. var transformValue = this.adapter_.getScrollContentStyleValue('transform');
  17557. // Early exit if no transform is present
  17558. if (transformValue === 'none') {
  17559. return 0;
  17560. }
  17561. // The transform value comes back as a matrix transformation in the form
  17562. // of `matrix(a, b, c, d, tx, ty)`. We only care about tx (translateX) so
  17563. // we're going to grab all the parenthesized values, strip out tx, and
  17564. // parse it.
  17565. var results = /\((.+)\)/.exec(transformValue)[1];
  17566. var parts = results.split(',');
  17567. return parseFloat(parts[4]);
  17568. }
  17569. /**
  17570. * Calculates a safe scroll value that is > 0 and < the max scroll value
  17571. * @param {number} scrollX The distance to scroll
  17572. * @return {number}
  17573. * @private
  17574. */
  17575. }, {
  17576. key: 'clampScrollValue_',
  17577. value: function clampScrollValue_(scrollX) {
  17578. var edges = this.calculateScrollEdges_();
  17579. return Math.min(Math.max(edges.left, scrollX), edges.right);
  17580. }
  17581. /**
  17582. * @return {number}
  17583. * @private
  17584. */
  17585. }, {
  17586. key: 'computeCurrentScrollPositionRTL_',
  17587. value: function computeCurrentScrollPositionRTL_() {
  17588. var translateX = this.calculateCurrentTranslateX_();
  17589. return this.getRTLScroller().getScrollPositionRTL(translateX);
  17590. }
  17591. /**
  17592. * @return {!MDCTabScrollerHorizontalEdges}
  17593. * @private
  17594. */
  17595. }, {
  17596. key: 'calculateScrollEdges_',
  17597. value: function calculateScrollEdges_() {
  17598. var contentWidth = this.adapter_.getScrollContentOffsetWidth();
  17599. var rootWidth = this.adapter_.getScrollAreaOffsetWidth();
  17600. return (/** @type {!MDCTabScrollerHorizontalEdges} */{
  17601. left: 0,
  17602. right: contentWidth - rootWidth
  17603. }
  17604. );
  17605. }
  17606. /**
  17607. * Internal scroll method
  17608. * @param {number} scrollX The new scroll position
  17609. * @private
  17610. */
  17611. }, {
  17612. key: 'scrollTo_',
  17613. value: function scrollTo_(scrollX) {
  17614. var currentScrollX = this.getScrollPosition();
  17615. var safeScrollX = this.clampScrollValue_(scrollX);
  17616. var scrollDelta = safeScrollX - currentScrollX;
  17617. this.animate_( /** @type {!MDCTabScrollerAnimation} */{
  17618. finalScrollPosition: safeScrollX,
  17619. scrollDelta: scrollDelta
  17620. });
  17621. }
  17622. /**
  17623. * Internal RTL scroll method
  17624. * @param {number} scrollX The new scroll position
  17625. * @private
  17626. */
  17627. }, {
  17628. key: 'scrollToRTL_',
  17629. value: function scrollToRTL_(scrollX) {
  17630. var animation = this.getRTLScroller().scrollToRTL(scrollX);
  17631. this.animate_(animation);
  17632. }
  17633. /**
  17634. * Internal increment scroll method
  17635. * @param {number} scrollX The new scroll position increment
  17636. * @private
  17637. */
  17638. }, {
  17639. key: 'incrementScroll_',
  17640. value: function incrementScroll_(scrollX) {
  17641. var currentScrollX = this.getScrollPosition();
  17642. var targetScrollX = scrollX + currentScrollX;
  17643. var safeScrollX = this.clampScrollValue_(targetScrollX);
  17644. var scrollDelta = safeScrollX - currentScrollX;
  17645. this.animate_( /** @type {!MDCTabScrollerAnimation} */{
  17646. finalScrollPosition: safeScrollX,
  17647. scrollDelta: scrollDelta
  17648. });
  17649. }
  17650. /**
  17651. * Internal incremenet scroll RTL method
  17652. * @param {number} scrollX The new scroll position RTL increment
  17653. * @private
  17654. */
  17655. }, {
  17656. key: 'incrementScrollRTL_',
  17657. value: function incrementScrollRTL_(scrollX) {
  17658. var animation = this.getRTLScroller().incrementScrollRTL(scrollX);
  17659. this.animate_(animation);
  17660. }
  17661. /**
  17662. * Animates the tab scrolling
  17663. * @param {!MDCTabScrollerAnimation} animation The animation to apply
  17664. * @private
  17665. */
  17666. }, {
  17667. key: 'animate_',
  17668. value: function animate_(animation) {
  17669. var _this2 = this;
  17670. // Early exit if translateX is 0, which means there's no animation to perform
  17671. if (animation.scrollDelta === 0) {
  17672. return;
  17673. }
  17674. this.stopScrollAnimation_();
  17675. // This animation uses the FLIP approach.
  17676. // Read more here: https://aerotwist.com/blog/flip-your-animations/
  17677. this.adapter_.setScrollAreaScrollLeft(animation.finalScrollPosition);
  17678. this.adapter_.setScrollContentStyleProperty('transform', 'translateX(' + animation.scrollDelta + 'px)');
  17679. // Force repaint
  17680. this.adapter_.computeScrollAreaClientRect();
  17681. requestAnimationFrame(function () {
  17682. _this2.adapter_.addClass(MDCTabScrollerFoundation.cssClasses.ANIMATING);
  17683. _this2.adapter_.setScrollContentStyleProperty('transform', 'none');
  17684. });
  17685. this.isAnimating_ = true;
  17686. }
  17687. /**
  17688. * Stops scroll animation
  17689. * @private
  17690. */
  17691. }, {
  17692. key: 'stopScrollAnimation_',
  17693. value: function stopScrollAnimation_() {
  17694. this.isAnimating_ = false;
  17695. var currentScrollPosition = this.getAnimatingScrollPosition_();
  17696. this.adapter_.removeClass(MDCTabScrollerFoundation.cssClasses.ANIMATING);
  17697. this.adapter_.setScrollContentStyleProperty('transform', 'translateX(0px)');
  17698. this.adapter_.setScrollAreaScrollLeft(currentScrollPosition);
  17699. }
  17700. /**
  17701. * Gets the current scroll position during animation
  17702. * @return {number}
  17703. * @private
  17704. */
  17705. }, {
  17706. key: 'getAnimatingScrollPosition_',
  17707. value: function getAnimatingScrollPosition_() {
  17708. var currentTranslateX = this.calculateCurrentTranslateX_();
  17709. var scrollLeft = this.adapter_.getScrollAreaScrollLeft();
  17710. if (this.isRTL_()) {
  17711. return this.getRTLScroller().getAnimatingScrollPosition(scrollLeft, currentTranslateX);
  17712. }
  17713. return scrollLeft - currentTranslateX;
  17714. }
  17715. /**
  17716. * Determines the RTL Scroller to use
  17717. * @return {!MDCTabScrollerRTL}
  17718. * @private
  17719. */
  17720. }, {
  17721. key: 'rtlScrollerFactory_',
  17722. value: function rtlScrollerFactory_() {
  17723. // Browsers have three different implementations of scrollLeft in RTL mode,
  17724. // dependent on the browser. The behavior is based off the max LTR
  17725. // scrollleft value and 0.
  17726. //
  17727. // * Default scrolling in RTL *
  17728. // - Left-most value: 0
  17729. // - Right-most value: Max LTR scrollLeft value
  17730. //
  17731. // * Negative scrolling in RTL *
  17732. // - Left-most value: Negated max LTR scrollLeft value
  17733. // - Right-most value: 0
  17734. //
  17735. // * Reverse scrolling in RTL *
  17736. // - Left-most value: Max LTR scrollLeft value
  17737. // - Right-most value: 0
  17738. //
  17739. // We use those principles below to determine which RTL scrollLeft
  17740. // behavior is implemented in the current browser.
  17741. var initialScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  17742. this.adapter_.setScrollAreaScrollLeft(initialScrollLeft - 1);
  17743. var newScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  17744. // If the newScrollLeft value is negative,then we know that the browser has
  17745. // implemented negative RTL scrolling, since all other implementations have
  17746. // only positive values.
  17747. if (newScrollLeft < 0) {
  17748. // Undo the scrollLeft test check
  17749. this.adapter_.setScrollAreaScrollLeft(initialScrollLeft);
  17750. return new __WEBPACK_IMPORTED_MODULE_5__rtl_negative_scroller__["a" /* default */](this.adapter_);
  17751. }
  17752. var rootClientRect = this.adapter_.computeScrollAreaClientRect();
  17753. var contentClientRect = this.adapter_.computeScrollContentClientRect();
  17754. var rightEdgeDelta = Math.round(contentClientRect.right - rootClientRect.right);
  17755. // Undo the scrollLeft test check
  17756. this.adapter_.setScrollAreaScrollLeft(initialScrollLeft);
  17757. // By calculating the clientRect of the root element and the clientRect of
  17758. // the content element, we can determine how much the scroll value changed
  17759. // when we performed the scrollLeft subtraction above.
  17760. if (rightEdgeDelta === newScrollLeft) {
  17761. return new __WEBPACK_IMPORTED_MODULE_6__rtl_reverse_scroller__["a" /* default */](this.adapter_);
  17762. }
  17763. return new __WEBPACK_IMPORTED_MODULE_4__rtl_default_scroller__["a" /* default */](this.adapter_);
  17764. }
  17765. /**
  17766. * @return {boolean}
  17767. * @private
  17768. */
  17769. }, {
  17770. key: 'isRTL_',
  17771. value: function isRTL_() {
  17772. return this.adapter_.getScrollContentStyleValue('direction') === 'rtl';
  17773. }
  17774. }]);
  17775. return MDCTabScrollerFoundation;
  17776. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  17777. /* harmony default export */ __webpack_exports__["a"] = (MDCTabScrollerFoundation);
  17778. /***/ }),
  17779. /* 128 */
  17780. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17781. "use strict";
  17782. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__rtl_scroller__ = __webpack_require__(11);
  17783. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(5);
  17784. 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; }; }();
  17785. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  17786. 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; }
  17787. 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; }
  17788. /**
  17789. * @license
  17790. * Copyright 2018 Google Inc.
  17791. *
  17792. * Permission is hereby granted, free of charge, to any person obtaining a copy
  17793. * of this software and associated documentation files (the "Software"), to deal
  17794. * in the Software without restriction, including without limitation the rights
  17795. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  17796. * copies of the Software, and to permit persons to whom the Software is
  17797. * furnished to do so, subject to the following conditions:
  17798. *
  17799. * The above copyright notice and this permission notice shall be included in
  17800. * all copies or substantial portions of the Software.
  17801. *
  17802. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17803. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17804. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17805. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  17806. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  17807. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  17808. * THE SOFTWARE.
  17809. */
  17810. /* eslint-disable no-unused-vars */
  17811. /* eslint-enable no-unused-vars */
  17812. /**
  17813. * @extends {MDCTabScrollerRTL}
  17814. * @final
  17815. */
  17816. var MDCTabScrollerRTLDefault = function (_MDCTabScrollerRTL) {
  17817. _inherits(MDCTabScrollerRTLDefault, _MDCTabScrollerRTL);
  17818. function MDCTabScrollerRTLDefault() {
  17819. _classCallCheck(this, MDCTabScrollerRTLDefault);
  17820. return _possibleConstructorReturn(this, (MDCTabScrollerRTLDefault.__proto__ || Object.getPrototypeOf(MDCTabScrollerRTLDefault)).apply(this, arguments));
  17821. }
  17822. _createClass(MDCTabScrollerRTLDefault, [{
  17823. key: 'getScrollPositionRTL',
  17824. /**
  17825. * @return {number}
  17826. */
  17827. value: function getScrollPositionRTL() {
  17828. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  17829. var _calculateScrollEdges = this.calculateScrollEdges_(),
  17830. right = _calculateScrollEdges.right;
  17831. // Scroll values on most browsers are ints instead of floats so we round
  17832. return Math.round(right - currentScrollLeft);
  17833. }
  17834. /**
  17835. * @param {number} scrollX
  17836. * @return {!MDCTabScrollerAnimation}
  17837. */
  17838. }, {
  17839. key: 'scrollToRTL',
  17840. value: function scrollToRTL(scrollX) {
  17841. var edges = this.calculateScrollEdges_();
  17842. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  17843. var clampedScrollLeft = this.clampScrollValue_(edges.right - scrollX);
  17844. return (/** @type {!MDCTabScrollerAnimation} */{
  17845. finalScrollPosition: clampedScrollLeft,
  17846. scrollDelta: clampedScrollLeft - currentScrollLeft
  17847. }
  17848. );
  17849. }
  17850. /**
  17851. * @param {number} scrollX
  17852. * @return {!MDCTabScrollerAnimation}
  17853. */
  17854. }, {
  17855. key: 'incrementScrollRTL',
  17856. value: function incrementScrollRTL(scrollX) {
  17857. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  17858. var clampedScrollLeft = this.clampScrollValue_(currentScrollLeft - scrollX);
  17859. return (/** @type {!MDCTabScrollerAnimation} */{
  17860. finalScrollPosition: clampedScrollLeft,
  17861. scrollDelta: clampedScrollLeft - currentScrollLeft
  17862. }
  17863. );
  17864. }
  17865. /**
  17866. * @param {number} scrollX
  17867. * @return {number}
  17868. */
  17869. }, {
  17870. key: 'getAnimatingScrollPosition',
  17871. value: function getAnimatingScrollPosition(scrollX) {
  17872. return scrollX;
  17873. }
  17874. /**
  17875. * @return {!MDCTabScrollerHorizontalEdges}
  17876. * @private
  17877. */
  17878. }, {
  17879. key: 'calculateScrollEdges_',
  17880. value: function calculateScrollEdges_() {
  17881. var contentWidth = this.adapter_.getScrollContentOffsetWidth();
  17882. var rootWidth = this.adapter_.getScrollAreaOffsetWidth();
  17883. return (/** @type {!MDCTabScrollerHorizontalEdges} */{
  17884. left: 0,
  17885. right: contentWidth - rootWidth
  17886. }
  17887. );
  17888. }
  17889. /**
  17890. * @param {number} scrollX
  17891. * @return {number}
  17892. * @private
  17893. */
  17894. }, {
  17895. key: 'clampScrollValue_',
  17896. value: function clampScrollValue_(scrollX) {
  17897. var edges = this.calculateScrollEdges_();
  17898. return Math.min(Math.max(edges.left, scrollX), edges.right);
  17899. }
  17900. }]);
  17901. return MDCTabScrollerRTLDefault;
  17902. }(__WEBPACK_IMPORTED_MODULE_0__rtl_scroller__["a" /* default */]);
  17903. /* harmony default export */ __webpack_exports__["a"] = (MDCTabScrollerRTLDefault);
  17904. /***/ }),
  17905. /* 129 */
  17906. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17907. "use strict";
  17908. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__rtl_scroller__ = __webpack_require__(11);
  17909. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(5);
  17910. 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; }; }();
  17911. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  17912. 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; }
  17913. 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; }
  17914. /**
  17915. * @license
  17916. * Copyright 2018 Google Inc.
  17917. *
  17918. * Permission is hereby granted, free of charge, to any person obtaining a copy
  17919. * of this software and associated documentation files (the "Software"), to deal
  17920. * in the Software without restriction, including without limitation the rights
  17921. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  17922. * copies of the Software, and to permit persons to whom the Software is
  17923. * furnished to do so, subject to the following conditions:
  17924. *
  17925. * The above copyright notice and this permission notice shall be included in
  17926. * all copies or substantial portions of the Software.
  17927. *
  17928. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17929. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17930. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17931. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  17932. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  17933. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  17934. * THE SOFTWARE.
  17935. */
  17936. /* eslint-disable no-unused-vars */
  17937. /* eslint-enable no-unused-vars */
  17938. /**
  17939. * @extends {MDCTabScrollerRTL}
  17940. * @final
  17941. */
  17942. var MDCTabScrollerRTLNegative = function (_MDCTabScrollerRTL) {
  17943. _inherits(MDCTabScrollerRTLNegative, _MDCTabScrollerRTL);
  17944. function MDCTabScrollerRTLNegative() {
  17945. _classCallCheck(this, MDCTabScrollerRTLNegative);
  17946. return _possibleConstructorReturn(this, (MDCTabScrollerRTLNegative.__proto__ || Object.getPrototypeOf(MDCTabScrollerRTLNegative)).apply(this, arguments));
  17947. }
  17948. _createClass(MDCTabScrollerRTLNegative, [{
  17949. key: 'getScrollPositionRTL',
  17950. /**
  17951. * @param {number} translateX The current translateX position
  17952. * @return {number}
  17953. */
  17954. value: function getScrollPositionRTL(translateX) {
  17955. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  17956. return Math.round(translateX - currentScrollLeft);
  17957. }
  17958. /**
  17959. * @param {number} scrollX
  17960. * @return {!MDCTabScrollerAnimation}
  17961. */
  17962. }, {
  17963. key: 'scrollToRTL',
  17964. value: function scrollToRTL(scrollX) {
  17965. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  17966. var clampedScrollLeft = this.clampScrollValue_(-scrollX);
  17967. return (/** @type {!MDCTabScrollerAnimation} */{
  17968. finalScrollPosition: clampedScrollLeft,
  17969. scrollDelta: clampedScrollLeft - currentScrollLeft
  17970. }
  17971. );
  17972. }
  17973. /**
  17974. * @param {number} scrollX
  17975. * @return {!MDCTabScrollerAnimation}
  17976. */
  17977. }, {
  17978. key: 'incrementScrollRTL',
  17979. value: function incrementScrollRTL(scrollX) {
  17980. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  17981. var clampedScrollLeft = this.clampScrollValue_(currentScrollLeft - scrollX);
  17982. return (/** @type {!MDCTabScrollerAnimation} */{
  17983. finalScrollPosition: clampedScrollLeft,
  17984. scrollDelta: clampedScrollLeft - currentScrollLeft
  17985. }
  17986. );
  17987. }
  17988. /**
  17989. * @param {number} scrollX
  17990. * @param {number} translateX
  17991. * @return {number}
  17992. */
  17993. }, {
  17994. key: 'getAnimatingScrollPosition',
  17995. value: function getAnimatingScrollPosition(scrollX, translateX) {
  17996. return scrollX - translateX;
  17997. }
  17998. /**
  17999. * @return {!MDCTabScrollerHorizontalEdges}
  18000. * @private
  18001. */
  18002. }, {
  18003. key: 'calculateScrollEdges_',
  18004. value: function calculateScrollEdges_() {
  18005. var contentWidth = this.adapter_.getScrollContentOffsetWidth();
  18006. var rootWidth = this.adapter_.getScrollAreaOffsetWidth();
  18007. return (/** @type {!MDCTabScrollerHorizontalEdges} */{
  18008. left: rootWidth - contentWidth,
  18009. right: 0
  18010. }
  18011. );
  18012. }
  18013. /**
  18014. * @param {number} scrollX
  18015. * @return {number}
  18016. * @private
  18017. */
  18018. }, {
  18019. key: 'clampScrollValue_',
  18020. value: function clampScrollValue_(scrollX) {
  18021. var edges = this.calculateScrollEdges_();
  18022. return Math.max(Math.min(edges.right, scrollX), edges.left);
  18023. }
  18024. }]);
  18025. return MDCTabScrollerRTLNegative;
  18026. }(__WEBPACK_IMPORTED_MODULE_0__rtl_scroller__["a" /* default */]);
  18027. /* harmony default export */ __webpack_exports__["a"] = (MDCTabScrollerRTLNegative);
  18028. /***/ }),
  18029. /* 130 */
  18030. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18031. "use strict";
  18032. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__rtl_scroller__ = __webpack_require__(11);
  18033. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(5);
  18034. 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; }; }();
  18035. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18036. 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; }
  18037. 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; }
  18038. /**
  18039. * @license
  18040. * Copyright 2018 Google Inc.
  18041. *
  18042. * Permission is hereby granted, free of charge, to any person obtaining a copy
  18043. * of this software and associated documentation files (the "Software"), to deal
  18044. * in the Software without restriction, including without limitation the rights
  18045. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  18046. * copies of the Software, and to permit persons to whom the Software is
  18047. * furnished to do so, subject to the following conditions:
  18048. *
  18049. * The above copyright notice and this permission notice shall be included in
  18050. * all copies or substantial portions of the Software.
  18051. *
  18052. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18053. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18054. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18055. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18056. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18057. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  18058. * THE SOFTWARE.
  18059. */
  18060. /* eslint-disable no-unused-vars */
  18061. /* eslint-enable no-unused-vars */
  18062. /**
  18063. * @extends {MDCTabScrollerRTL}
  18064. * @final
  18065. */
  18066. var MDCTabScrollerRTLReverse = function (_MDCTabScrollerRTL) {
  18067. _inherits(MDCTabScrollerRTLReverse, _MDCTabScrollerRTL);
  18068. function MDCTabScrollerRTLReverse() {
  18069. _classCallCheck(this, MDCTabScrollerRTLReverse);
  18070. return _possibleConstructorReturn(this, (MDCTabScrollerRTLReverse.__proto__ || Object.getPrototypeOf(MDCTabScrollerRTLReverse)).apply(this, arguments));
  18071. }
  18072. _createClass(MDCTabScrollerRTLReverse, [{
  18073. key: 'getScrollPositionRTL',
  18074. /**
  18075. * @param {number} translateX
  18076. * @return {number}
  18077. */
  18078. value: function getScrollPositionRTL(translateX) {
  18079. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  18080. // Scroll values on most browsers are ints instead of floats so we round
  18081. return Math.round(currentScrollLeft - translateX);
  18082. }
  18083. /**
  18084. * @param {number} scrollX
  18085. * @return {!MDCTabScrollerAnimation}
  18086. */
  18087. }, {
  18088. key: 'scrollToRTL',
  18089. value: function scrollToRTL(scrollX) {
  18090. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  18091. var clampedScrollLeft = this.clampScrollValue_(scrollX);
  18092. return (/** @type {!MDCTabScrollerAnimation} */{
  18093. finalScrollPosition: clampedScrollLeft,
  18094. scrollDelta: currentScrollLeft - clampedScrollLeft
  18095. }
  18096. );
  18097. }
  18098. /**
  18099. * @param {number} scrollX
  18100. * @return {!MDCTabScrollerAnimation}
  18101. */
  18102. }, {
  18103. key: 'incrementScrollRTL',
  18104. value: function incrementScrollRTL(scrollX) {
  18105. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  18106. var clampedScrollLeft = this.clampScrollValue_(currentScrollLeft + scrollX);
  18107. return (/** @type {!MDCTabScrollerAnimation} */{
  18108. finalScrollPosition: clampedScrollLeft,
  18109. scrollDelta: currentScrollLeft - clampedScrollLeft
  18110. }
  18111. );
  18112. }
  18113. /**
  18114. * @param {number} scrollX
  18115. * @return {number}
  18116. */
  18117. }, {
  18118. key: 'getAnimatingScrollPosition',
  18119. value: function getAnimatingScrollPosition(scrollX, translateX) {
  18120. return scrollX + translateX;
  18121. }
  18122. /**
  18123. * @return {!MDCTabScrollerHorizontalEdges}
  18124. * @private
  18125. */
  18126. }, {
  18127. key: 'calculateScrollEdges_',
  18128. value: function calculateScrollEdges_() {
  18129. var contentWidth = this.adapter_.getScrollContentOffsetWidth();
  18130. var rootWidth = this.adapter_.getScrollAreaOffsetWidth();
  18131. return (/** @type {!MDCTabScrollerHorizontalEdges} */{
  18132. left: contentWidth - rootWidth,
  18133. right: 0
  18134. }
  18135. );
  18136. }
  18137. /**
  18138. * @param {number} scrollX
  18139. * @return {number}
  18140. * @private
  18141. */
  18142. }, {
  18143. key: 'clampScrollValue_',
  18144. value: function clampScrollValue_(scrollX) {
  18145. var edges = this.calculateScrollEdges_();
  18146. return Math.min(Math.max(edges.right, scrollX), edges.left);
  18147. }
  18148. }]);
  18149. return MDCTabScrollerRTLReverse;
  18150. }(__WEBPACK_IMPORTED_MODULE_0__rtl_scroller__["a" /* default */]);
  18151. /* harmony default export */ __webpack_exports__["a"] = (MDCTabScrollerRTLReverse);
  18152. /***/ }),
  18153. /* 131 */
  18154. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18155. "use strict";
  18156. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  18157. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "computeHorizontalScrollbarHeight", function() { return computeHorizontalScrollbarHeight; });
  18158. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getMatchesProperty", function() { return getMatchesProperty; });
  18159. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__constants__ = __webpack_require__(50);
  18160. /**
  18161. * @license
  18162. * Copyright 2018 Google Inc.
  18163. *
  18164. * Permission is hereby granted, free of charge, to any person obtaining a copy
  18165. * of this software and associated documentation files (the "Software"), to deal
  18166. * in the Software without restriction, including without limitation the rights
  18167. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  18168. * copies of the Software, and to permit persons to whom the Software is
  18169. * furnished to do so, subject to the following conditions:
  18170. *
  18171. * The above copyright notice and this permission notice shall be included in
  18172. * all copies or substantial portions of the Software.
  18173. *
  18174. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18175. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18176. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18177. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18178. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18179. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  18180. * THE SOFTWARE.
  18181. */
  18182. /**
  18183. * Stores result from computeHorizontalScrollbarHeight to avoid redundant processing.
  18184. * @private {number|undefined}
  18185. */
  18186. var horizontalScrollbarHeight_ = void 0;
  18187. /**
  18188. * Computes the height of browser-rendered horizontal scrollbars using a self-created test element.
  18189. * May return 0 (e.g. on OS X browsers under default configuration).
  18190. * @param {!Document} documentObj
  18191. * @param {boolean=} shouldCacheResult
  18192. * @return {number}
  18193. */
  18194. function computeHorizontalScrollbarHeight(documentObj) {
  18195. var shouldCacheResult = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  18196. if (shouldCacheResult && typeof horizontalScrollbarHeight_ !== 'undefined') {
  18197. return horizontalScrollbarHeight_;
  18198. }
  18199. var el = documentObj.createElement('div');
  18200. el.classList.add(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].SCROLL_TEST);
  18201. documentObj.body.appendChild(el);
  18202. var horizontalScrollbarHeight = el.offsetHeight - el.clientHeight;
  18203. documentObj.body.removeChild(el);
  18204. if (shouldCacheResult) {
  18205. horizontalScrollbarHeight_ = horizontalScrollbarHeight;
  18206. }
  18207. return horizontalScrollbarHeight;
  18208. }
  18209. /**
  18210. * @param {!Object} HTMLElementPrototype
  18211. * @return {!Array<string>}
  18212. */
  18213. function getMatchesProperty(HTMLElementPrototype) {
  18214. return ['msMatchesSelector', 'matches'].filter(function (p) {
  18215. return p in HTMLElementPrototype;
  18216. }).pop();
  18217. }
  18218. /***/ }),
  18219. /* 132 */
  18220. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18221. "use strict";
  18222. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  18223. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(133);
  18224. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__adapter__ = __webpack_require__(51);
  18225. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_tab_adapter__ = __webpack_require__(10);
  18226. 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; };
  18227. 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; }; }();
  18228. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18229. 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; }
  18230. 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; }
  18231. /**
  18232. * @license
  18233. * Copyright 2018 Google Inc.
  18234. *
  18235. * Permission is hereby granted, free of charge, to any person obtaining a copy
  18236. * of this software and associated documentation files (the "Software"), to deal
  18237. * in the Software without restriction, including without limitation the rights
  18238. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  18239. * copies of the Software, and to permit persons to whom the Software is
  18240. * furnished to do so, subject to the following conditions:
  18241. *
  18242. * The above copyright notice and this permission notice shall be included in
  18243. * all copies or substantial portions of the Software.
  18244. *
  18245. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18246. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18247. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18248. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18249. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18250. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  18251. * THE SOFTWARE.
  18252. */
  18253. /* eslint-disable no-unused-vars */
  18254. /* eslint-enable no-unused-vars */
  18255. /**
  18256. * @type {Set<string>}
  18257. */
  18258. var ACCEPTABLE_KEYS = new Set();
  18259. // IE11 has no support for new Set with iterable so we need to initialize this by hand
  18260. ACCEPTABLE_KEYS.add(__WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].ARROW_LEFT_KEY);
  18261. ACCEPTABLE_KEYS.add(__WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].ARROW_RIGHT_KEY);
  18262. ACCEPTABLE_KEYS.add(__WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].END_KEY);
  18263. ACCEPTABLE_KEYS.add(__WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].HOME_KEY);
  18264. ACCEPTABLE_KEYS.add(__WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].ENTER_KEY);
  18265. ACCEPTABLE_KEYS.add(__WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].SPACE_KEY);
  18266. /**
  18267. * @type {Map<number, string>}
  18268. */
  18269. var KEYCODE_MAP = new Map();
  18270. // IE11 has no support for new Map with iterable so we need to initialize this by hand
  18271. KEYCODE_MAP.set(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].ARROW_LEFT_KEYCODE, __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].ARROW_LEFT_KEY);
  18272. KEYCODE_MAP.set(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].ARROW_RIGHT_KEYCODE, __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].ARROW_RIGHT_KEY);
  18273. KEYCODE_MAP.set(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].END_KEYCODE, __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].END_KEY);
  18274. KEYCODE_MAP.set(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].HOME_KEYCODE, __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].HOME_KEY);
  18275. KEYCODE_MAP.set(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].ENTER_KEYCODE, __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].ENTER_KEY);
  18276. KEYCODE_MAP.set(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].SPACE_KEYCODE, __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].SPACE_KEY);
  18277. /**
  18278. * @extends {MDCFoundation<!MDCTabBarAdapter>}
  18279. * @final
  18280. */
  18281. var MDCTabBarFoundation = function (_MDCFoundation) {
  18282. _inherits(MDCTabBarFoundation, _MDCFoundation);
  18283. _createClass(MDCTabBarFoundation, null, [{
  18284. key: 'strings',
  18285. /** @return enum {string} */
  18286. get: function get() {
  18287. return __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */];
  18288. }
  18289. /** @return enum {number} */
  18290. }, {
  18291. key: 'numbers',
  18292. get: function get() {
  18293. return __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */];
  18294. }
  18295. /**
  18296. * @see MDCTabBarAdapter for typing information
  18297. * @return {!MDCTabBarAdapter}
  18298. */
  18299. }, {
  18300. key: 'defaultAdapter',
  18301. get: function get() {
  18302. return (/** @type {!MDCTabBarAdapter} */{
  18303. scrollTo: function scrollTo() {},
  18304. incrementScroll: function incrementScroll() {},
  18305. getScrollPosition: function getScrollPosition() {},
  18306. getScrollContentWidth: function getScrollContentWidth() {},
  18307. getOffsetWidth: function getOffsetWidth() {},
  18308. isRTL: function isRTL() {},
  18309. setActiveTab: function setActiveTab() {},
  18310. activateTabAtIndex: function activateTabAtIndex() {},
  18311. deactivateTabAtIndex: function deactivateTabAtIndex() {},
  18312. focusTabAtIndex: function focusTabAtIndex() {},
  18313. getTabIndicatorClientRectAtIndex: function getTabIndicatorClientRectAtIndex() {},
  18314. getTabDimensionsAtIndex: function getTabDimensionsAtIndex() {},
  18315. getPreviousActiveTabIndex: function getPreviousActiveTabIndex() {},
  18316. getFocusedTabIndex: function getFocusedTabIndex() {},
  18317. getIndexOfTab: function getIndexOfTab() {},
  18318. getTabListLength: function getTabListLength() {},
  18319. notifyTabActivated: function notifyTabActivated() {}
  18320. }
  18321. );
  18322. }
  18323. /**
  18324. * @param {!MDCTabBarAdapter} adapter
  18325. * */
  18326. }]);
  18327. function MDCTabBarFoundation(adapter) {
  18328. _classCallCheck(this, MDCTabBarFoundation);
  18329. /** @private {boolean} */
  18330. var _this = _possibleConstructorReturn(this, (MDCTabBarFoundation.__proto__ || Object.getPrototypeOf(MDCTabBarFoundation)).call(this, _extends(MDCTabBarFoundation.defaultAdapter, adapter)));
  18331. _this.useAutomaticActivation_ = false;
  18332. return _this;
  18333. }
  18334. /**
  18335. * Switches between automatic and manual activation modes.
  18336. * See https://www.w3.org/TR/wai-aria-practices/#tabpanel for examples.
  18337. * @param {boolean} useAutomaticActivation
  18338. */
  18339. _createClass(MDCTabBarFoundation, [{
  18340. key: 'setUseAutomaticActivation',
  18341. value: function setUseAutomaticActivation(useAutomaticActivation) {
  18342. this.useAutomaticActivation_ = useAutomaticActivation;
  18343. }
  18344. /**
  18345. * Activates the tab at the given index
  18346. * @param {number} index
  18347. */
  18348. }, {
  18349. key: 'activateTab',
  18350. value: function activateTab(index) {
  18351. var previousActiveIndex = this.adapter_.getPreviousActiveTabIndex();
  18352. if (!this.indexIsInRange_(index) || index === previousActiveIndex) {
  18353. return;
  18354. }
  18355. this.adapter_.deactivateTabAtIndex(previousActiveIndex);
  18356. this.adapter_.activateTabAtIndex(index, this.adapter_.getTabIndicatorClientRectAtIndex(previousActiveIndex));
  18357. this.scrollIntoView(index);
  18358. this.adapter_.notifyTabActivated(index);
  18359. }
  18360. /**
  18361. * Handles the keydown event
  18362. * @param {!Event} evt
  18363. */
  18364. }, {
  18365. key: 'handleKeyDown',
  18366. value: function handleKeyDown(evt) {
  18367. // Get the key from the event
  18368. var key = this.getKeyFromEvent_(evt);
  18369. // Early exit if the event key isn't one of the keyboard navigation keys
  18370. if (key === undefined) {
  18371. return;
  18372. }
  18373. // Prevent default behavior for movement keys, but not for activation keys, since :active is used to apply ripple
  18374. if (!this.isActivationKey_(key)) {
  18375. evt.preventDefault();
  18376. }
  18377. if (this.useAutomaticActivation_) {
  18378. if (this.isActivationKey_(key)) {
  18379. return;
  18380. }
  18381. var index = this.determineTargetFromKey_(this.adapter_.getPreviousActiveTabIndex(), key);
  18382. this.adapter_.setActiveTab(index);
  18383. this.scrollIntoView(index);
  18384. } else {
  18385. var focusedTabIndex = this.adapter_.getFocusedTabIndex();
  18386. if (this.isActivationKey_(key)) {
  18387. this.adapter_.setActiveTab(focusedTabIndex);
  18388. } else {
  18389. var _index = this.determineTargetFromKey_(focusedTabIndex, key);
  18390. this.adapter_.focusTabAtIndex(_index);
  18391. this.scrollIntoView(_index);
  18392. }
  18393. }
  18394. }
  18395. /**
  18396. * Handles the MDCTab:interacted event
  18397. * @param {!Event} evt
  18398. */
  18399. }, {
  18400. key: 'handleTabInteraction',
  18401. value: function handleTabInteraction(evt) {
  18402. this.adapter_.setActiveTab(this.adapter_.getIndexOfTab(evt.detail.tab));
  18403. }
  18404. /**
  18405. * Scrolls the tab at the given index into view
  18406. * @param {number} index The tab index to make visible
  18407. */
  18408. }, {
  18409. key: 'scrollIntoView',
  18410. value: function scrollIntoView(index) {
  18411. // Early exit if the index is out of range
  18412. if (!this.indexIsInRange_(index)) {
  18413. return;
  18414. }
  18415. // Always scroll to 0 if scrolling to the 0th index
  18416. if (index === 0) {
  18417. return this.adapter_.scrollTo(0);
  18418. }
  18419. // Always scroll to the max value if scrolling to the Nth index
  18420. // MDCTabScroller.scrollTo() will never scroll past the max possible value
  18421. if (index === this.adapter_.getTabListLength() - 1) {
  18422. return this.adapter_.scrollTo(this.adapter_.getScrollContentWidth());
  18423. }
  18424. if (this.isRTL_()) {
  18425. return this.scrollIntoViewRTL_(index);
  18426. }
  18427. this.scrollIntoView_(index);
  18428. }
  18429. /**
  18430. * Private method for determining the index of the destination tab based on what key was pressed
  18431. * @param {number} origin The original index from which to determine the destination
  18432. * @param {string} key The name of the key
  18433. * @return {number}
  18434. * @private
  18435. */
  18436. }, {
  18437. key: 'determineTargetFromKey_',
  18438. value: function determineTargetFromKey_(origin, key) {
  18439. var isRTL = this.isRTL_();
  18440. var maxIndex = this.adapter_.getTabListLength() - 1;
  18441. var shouldGoToEnd = key === __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].END_KEY;
  18442. 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;
  18443. 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;
  18444. var index = origin;
  18445. if (shouldGoToEnd) {
  18446. index = maxIndex;
  18447. } else if (shouldDecrement) {
  18448. index -= 1;
  18449. } else if (shouldIncrement) {
  18450. index += 1;
  18451. } else {
  18452. index = 0;
  18453. }
  18454. if (index < 0) {
  18455. index = maxIndex;
  18456. } else if (index > maxIndex) {
  18457. index = 0;
  18458. }
  18459. return index;
  18460. }
  18461. /**
  18462. * Calculates the scroll increment that will make the tab at the given index visible
  18463. * @param {number} index The index of the tab
  18464. * @param {number} nextIndex The index of the next tab
  18465. * @param {number} scrollPosition The current scroll position
  18466. * @param {number} barWidth The width of the Tab Bar
  18467. * @return {number}
  18468. * @private
  18469. */
  18470. }, {
  18471. key: 'calculateScrollIncrement_',
  18472. value: function calculateScrollIncrement_(index, nextIndex, scrollPosition, barWidth) {
  18473. var nextTabDimensions = this.adapter_.getTabDimensionsAtIndex(nextIndex);
  18474. var relativeContentLeft = nextTabDimensions.contentLeft - scrollPosition - barWidth;
  18475. var relativeContentRight = nextTabDimensions.contentRight - scrollPosition;
  18476. var leftIncrement = relativeContentRight - __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].EXTRA_SCROLL_AMOUNT;
  18477. var rightIncrement = relativeContentLeft + __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].EXTRA_SCROLL_AMOUNT;
  18478. if (nextIndex < index) {
  18479. return Math.min(leftIncrement, 0);
  18480. }
  18481. return Math.max(rightIncrement, 0);
  18482. }
  18483. /**
  18484. * Calculates the scroll increment that will make the tab at the given index visible in RTL
  18485. * @param {number} index The index of the tab
  18486. * @param {number} nextIndex The index of the next tab
  18487. * @param {number} scrollPosition The current scroll position
  18488. * @param {number} barWidth The width of the Tab Bar
  18489. * @param {number} scrollContentWidth The width of the scroll content
  18490. * @return {number}
  18491. * @private
  18492. */
  18493. }, {
  18494. key: 'calculateScrollIncrementRTL_',
  18495. value: function calculateScrollIncrementRTL_(index, nextIndex, scrollPosition, barWidth, scrollContentWidth) {
  18496. var nextTabDimensions = this.adapter_.getTabDimensionsAtIndex(nextIndex);
  18497. var relativeContentLeft = scrollContentWidth - nextTabDimensions.contentLeft - scrollPosition;
  18498. var relativeContentRight = scrollContentWidth - nextTabDimensions.contentRight - scrollPosition - barWidth;
  18499. var leftIncrement = relativeContentRight + __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].EXTRA_SCROLL_AMOUNT;
  18500. var rightIncrement = relativeContentLeft - __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].EXTRA_SCROLL_AMOUNT;
  18501. if (nextIndex > index) {
  18502. return Math.max(leftIncrement, 0);
  18503. }
  18504. return Math.min(rightIncrement, 0);
  18505. }
  18506. /**
  18507. * Determines the index of the adjacent tab closest to either edge of the Tab Bar
  18508. * @param {number} index The index of the tab
  18509. * @param {!MDCTabDimensions} tabDimensions The dimensions of the tab
  18510. * @param {number} scrollPosition The current scroll position
  18511. * @param {number} barWidth The width of the tab bar
  18512. * @return {number}
  18513. * @private
  18514. */
  18515. }, {
  18516. key: 'findAdjacentTabIndexClosestToEdge_',
  18517. value: function findAdjacentTabIndexClosestToEdge_(index, tabDimensions, scrollPosition, barWidth) {
  18518. /**
  18519. * Tabs are laid out in the Tab Scroller like this:
  18520. *
  18521. * Scroll Position
  18522. * +---+
  18523. * | | Bar Width
  18524. * | +-----------------------------------+
  18525. * | | |
  18526. * | V V
  18527. * | +-----------------------------------+
  18528. * V | Tab Scroller |
  18529. * +------------+--------------+-------------------+
  18530. * | Tab | Tab | Tab |
  18531. * +------------+--------------+-------------------+
  18532. * | |
  18533. * +-----------------------------------+
  18534. *
  18535. * To determine the next adjacent index, we look at the Tab root left and
  18536. * Tab root right, both relative to the scroll position. If the Tab root
  18537. * left is less than 0, then we know it's out of view to the left. If the
  18538. * Tab root right minus the bar width is greater than 0, we know the Tab is
  18539. * out of view to the right. From there, we either increment or decrement
  18540. * the index.
  18541. */
  18542. var relativeRootLeft = tabDimensions.rootLeft - scrollPosition;
  18543. var relativeRootRight = tabDimensions.rootRight - scrollPosition - barWidth;
  18544. var relativeRootDelta = relativeRootLeft + relativeRootRight;
  18545. var leftEdgeIsCloser = relativeRootLeft < 0 || relativeRootDelta < 0;
  18546. var rightEdgeIsCloser = relativeRootRight > 0 || relativeRootDelta > 0;
  18547. if (leftEdgeIsCloser) {
  18548. return index - 1;
  18549. }
  18550. if (rightEdgeIsCloser) {
  18551. return index + 1;
  18552. }
  18553. return -1;
  18554. }
  18555. /**
  18556. * Determines the index of the adjacent tab closest to either edge of the Tab Bar in RTL
  18557. * @param {number} index The index of the tab
  18558. * @param {!MDCTabDimensions} tabDimensions The dimensions of the tab
  18559. * @param {number} scrollPosition The current scroll position
  18560. * @param {number} barWidth The width of the tab bar
  18561. * @param {number} scrollContentWidth The width of the scroller content
  18562. * @return {number}
  18563. * @private
  18564. */
  18565. }, {
  18566. key: 'findAdjacentTabIndexClosestToEdgeRTL_',
  18567. value: function findAdjacentTabIndexClosestToEdgeRTL_(index, tabDimensions, scrollPosition, barWidth, scrollContentWidth) {
  18568. var rootLeft = scrollContentWidth - tabDimensions.rootLeft - barWidth - scrollPosition;
  18569. var rootRight = scrollContentWidth - tabDimensions.rootRight - scrollPosition;
  18570. var rootDelta = rootLeft + rootRight;
  18571. var leftEdgeIsCloser = rootLeft > 0 || rootDelta > 0;
  18572. var rightEdgeIsCloser = rootRight < 0 || rootDelta < 0;
  18573. if (leftEdgeIsCloser) {
  18574. return index + 1;
  18575. }
  18576. if (rightEdgeIsCloser) {
  18577. return index - 1;
  18578. }
  18579. return -1;
  18580. }
  18581. /**
  18582. * Returns the key associated with a keydown event
  18583. * @param {!Event} evt The keydown event
  18584. * @return {string}
  18585. * @private
  18586. */
  18587. }, {
  18588. key: 'getKeyFromEvent_',
  18589. value: function getKeyFromEvent_(evt) {
  18590. if (ACCEPTABLE_KEYS.has(evt.key)) {
  18591. return evt.key;
  18592. }
  18593. return KEYCODE_MAP.get(evt.keyCode);
  18594. }
  18595. }, {
  18596. key: 'isActivationKey_',
  18597. value: function isActivationKey_(key) {
  18598. return key === __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].SPACE_KEY || key === __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].ENTER_KEY;
  18599. }
  18600. /**
  18601. * Returns whether a given index is inclusively between the ends
  18602. * @param {number} index The index to test
  18603. * @private
  18604. */
  18605. }, {
  18606. key: 'indexIsInRange_',
  18607. value: function indexIsInRange_(index) {
  18608. return index >= 0 && index < this.adapter_.getTabListLength();
  18609. }
  18610. /**
  18611. * Returns the view's RTL property
  18612. * @return {boolean}
  18613. * @private
  18614. */
  18615. }, {
  18616. key: 'isRTL_',
  18617. value: function isRTL_() {
  18618. return this.adapter_.isRTL();
  18619. }
  18620. /**
  18621. * Scrolls the tab at the given index into view for left-to-right useragents
  18622. * @param {number} index The index of the tab to scroll into view
  18623. * @private
  18624. */
  18625. }, {
  18626. key: 'scrollIntoView_',
  18627. value: function scrollIntoView_(index) {
  18628. var scrollPosition = this.adapter_.getScrollPosition();
  18629. var barWidth = this.adapter_.getOffsetWidth();
  18630. var tabDimensions = this.adapter_.getTabDimensionsAtIndex(index);
  18631. var nextIndex = this.findAdjacentTabIndexClosestToEdge_(index, tabDimensions, scrollPosition, barWidth);
  18632. if (!this.indexIsInRange_(nextIndex)) {
  18633. return;
  18634. }
  18635. var scrollIncrement = this.calculateScrollIncrement_(index, nextIndex, scrollPosition, barWidth);
  18636. this.adapter_.incrementScroll(scrollIncrement);
  18637. }
  18638. /**
  18639. * Scrolls the tab at the given index into view in RTL
  18640. * @param {number} index The tab index to make visible
  18641. * @private
  18642. */
  18643. }, {
  18644. key: 'scrollIntoViewRTL_',
  18645. value: function scrollIntoViewRTL_(index) {
  18646. var scrollPosition = this.adapter_.getScrollPosition();
  18647. var barWidth = this.adapter_.getOffsetWidth();
  18648. var tabDimensions = this.adapter_.getTabDimensionsAtIndex(index);
  18649. var scrollWidth = this.adapter_.getScrollContentWidth();
  18650. var nextIndex = this.findAdjacentTabIndexClosestToEdgeRTL_(index, tabDimensions, scrollPosition, barWidth, scrollWidth);
  18651. if (!this.indexIsInRange_(nextIndex)) {
  18652. return;
  18653. }
  18654. var scrollIncrement = this.calculateScrollIncrementRTL_(index, nextIndex, scrollPosition, barWidth, scrollWidth);
  18655. this.adapter_.incrementScroll(scrollIncrement);
  18656. }
  18657. }]);
  18658. return MDCTabBarFoundation;
  18659. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  18660. /* harmony default export */ __webpack_exports__["a"] = (MDCTabBarFoundation);
  18661. /***/ }),
  18662. /* 133 */
  18663. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18664. "use strict";
  18665. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return numbers; });
  18666. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  18667. /**
  18668. * @license
  18669. * Copyright 2018 Google Inc.
  18670. *
  18671. * Permission is hereby granted, free of charge, to any person obtaining a copy
  18672. * of this software and associated documentation files (the "Software"), to deal
  18673. * in the Software without restriction, including without limitation the rights
  18674. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  18675. * copies of the Software, and to permit persons to whom the Software is
  18676. * furnished to do so, subject to the following conditions:
  18677. *
  18678. * The above copyright notice and this permission notice shall be included in
  18679. * all copies or substantial portions of the Software.
  18680. *
  18681. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18682. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18683. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18684. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18685. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18686. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  18687. * THE SOFTWARE.
  18688. */
  18689. /** @enum {string} */
  18690. var strings = {
  18691. TAB_ACTIVATED_EVENT: 'MDCTabBar:activated',
  18692. TAB_SCROLLER_SELECTOR: '.mdc-tab-scroller',
  18693. TAB_SELECTOR: '.mdc-tab',
  18694. ARROW_LEFT_KEY: 'ArrowLeft',
  18695. ARROW_RIGHT_KEY: 'ArrowRight',
  18696. END_KEY: 'End',
  18697. HOME_KEY: 'Home',
  18698. ENTER_KEY: 'Enter',
  18699. SPACE_KEY: 'Space'
  18700. };
  18701. /** @enum {number} */
  18702. var numbers = {
  18703. EXTRA_SCROLL_AMOUNT: 20,
  18704. ARROW_LEFT_KEYCODE: 37,
  18705. ARROW_RIGHT_KEYCODE: 39,
  18706. END_KEYCODE: 35,
  18707. HOME_KEYCODE: 36,
  18708. ENTER_KEYCODE: 13,
  18709. SPACE_KEYCODE: 32
  18710. };
  18711. /***/ }),
  18712. /* 134 */
  18713. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18714. "use strict";
  18715. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  18716. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTextField", function() { return MDCTextField; });
  18717. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  18718. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__ = __webpack_require__(2);
  18719. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_ripple_util__ = __webpack_require__(6);
  18720. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__constants__ = __webpack_require__(52);
  18721. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__adapter__ = __webpack_require__(53);
  18722. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__foundation__ = __webpack_require__(137);
  18723. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__material_line_ripple_index__ = __webpack_require__(17);
  18724. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__helper_text_index__ = __webpack_require__(138);
  18725. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__icon_index__ = __webpack_require__(139);
  18726. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__material_floating_label_index__ = __webpack_require__(16);
  18727. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__material_notched_outline_index__ = __webpack_require__(19);
  18728. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTextFieldFoundation", function() { return __WEBPACK_IMPORTED_MODULE_5__foundation__["a"]; });
  18729. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTextFieldHelperText", function() { return __WEBPACK_IMPORTED_MODULE_7__helper_text_index__["a"]; });
  18730. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTextFieldHelperTextFoundation", function() { return __WEBPACK_IMPORTED_MODULE_7__helper_text_index__["b"]; });
  18731. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTextFieldIcon", function() { return __WEBPACK_IMPORTED_MODULE_8__icon_index__["a"]; });
  18732. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTextFieldIconFoundation", function() { return __WEBPACK_IMPORTED_MODULE_8__icon_index__["b"]; });
  18733. 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; };
  18734. 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; }; }();
  18735. 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); } };
  18736. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18737. 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; }
  18738. 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; }
  18739. /**
  18740. * @license
  18741. * Copyright 2016 Google Inc.
  18742. *
  18743. * Permission is hereby granted, free of charge, to any person obtaining a copy
  18744. * of this software and associated documentation files (the "Software"), to deal
  18745. * in the Software without restriction, including without limitation the rights
  18746. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  18747. * copies of the Software, and to permit persons to whom the Software is
  18748. * furnished to do so, subject to the following conditions:
  18749. *
  18750. * The above copyright notice and this permission notice shall be included in
  18751. * all copies or substantial portions of the Software.
  18752. *
  18753. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18754. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18755. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18756. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18757. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18758. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  18759. * THE SOFTWARE.
  18760. */
  18761. /* eslint-disable no-unused-vars */
  18762. /* eslint-enable no-unused-vars */
  18763. /* eslint-disable no-unused-vars */
  18764. /* eslint-enable no-unused-vars */
  18765. /**
  18766. * @extends {MDCComponent<!MDCTextFieldFoundation>}
  18767. * @final
  18768. */
  18769. var MDCTextField = function (_MDCComponent) {
  18770. _inherits(MDCTextField, _MDCComponent);
  18771. /**
  18772. * @param {...?} args
  18773. */
  18774. function MDCTextField() {
  18775. var _ref;
  18776. _classCallCheck(this, MDCTextField);
  18777. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  18778. args[_key] = arguments[_key];
  18779. }
  18780. /** @private {?Element} */
  18781. var _this = _possibleConstructorReturn(this, (_ref = MDCTextField.__proto__ || Object.getPrototypeOf(MDCTextField)).call.apply(_ref, [this].concat(args)));
  18782. _this.input_;
  18783. /** @type {?MDCRipple} */
  18784. _this.ripple;
  18785. /** @private {?MDCLineRipple} */
  18786. _this.lineRipple_;
  18787. /** @private {?MDCTextFieldHelperText} */
  18788. _this.helperText_;
  18789. /** @private {?MDCTextFieldIcon} */
  18790. _this.icon_;
  18791. /** @private {?MDCFloatingLabel} */
  18792. _this.label_;
  18793. /** @private {?MDCNotchedOutline} */
  18794. _this.outline_;
  18795. return _this;
  18796. }
  18797. /**
  18798. * @param {!Element} root
  18799. * @return {!MDCTextField}
  18800. */
  18801. _createClass(MDCTextField, [{
  18802. key: 'initialize',
  18803. /**
  18804. * @param {(function(!Element): !MDCRipple)=} rippleFactory A function which
  18805. * creates a new MDCRipple.
  18806. * @param {(function(!Element): !MDCLineRipple)=} lineRippleFactory A function which
  18807. * creates a new MDCLineRipple.
  18808. * @param {(function(!Element): !MDCTextFieldHelperText)=} helperTextFactory A function which
  18809. * creates a new MDCTextFieldHelperText.
  18810. * @param {(function(!Element): !MDCTextFieldIcon)=} iconFactory A function which
  18811. * creates a new MDCTextFieldIcon.
  18812. * @param {(function(!Element): !MDCFloatingLabel)=} labelFactory A function which
  18813. * creates a new MDCFloatingLabel.
  18814. * @param {(function(!Element): !MDCNotchedOutline)=} outlineFactory A function which
  18815. * creates a new MDCNotchedOutline.
  18816. */
  18817. value: function initialize() {
  18818. var rippleFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (el, foundation) {
  18819. return new __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRipple"](el, foundation);
  18820. };
  18821. var lineRippleFactory = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (el) {
  18822. return new __WEBPACK_IMPORTED_MODULE_6__material_line_ripple_index__["MDCLineRipple"](el);
  18823. };
  18824. var helperTextFactory = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function (el) {
  18825. return new __WEBPACK_IMPORTED_MODULE_7__helper_text_index__["a" /* MDCTextFieldHelperText */](el);
  18826. };
  18827. var iconFactory = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : function (el) {
  18828. return new __WEBPACK_IMPORTED_MODULE_8__icon_index__["a" /* MDCTextFieldIcon */](el);
  18829. };
  18830. var _this2 = this;
  18831. var labelFactory = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : function (el) {
  18832. return new __WEBPACK_IMPORTED_MODULE_9__material_floating_label_index__["MDCFloatingLabel"](el);
  18833. };
  18834. var outlineFactory = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : function (el) {
  18835. return new __WEBPACK_IMPORTED_MODULE_10__material_notched_outline_index__["MDCNotchedOutline"](el);
  18836. };
  18837. this.input_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["e" /* strings */].INPUT_SELECTOR);
  18838. var labelElement = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["e" /* strings */].LABEL_SELECTOR);
  18839. if (labelElement) {
  18840. this.label_ = labelFactory(labelElement);
  18841. }
  18842. var lineRippleElement = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["e" /* strings */].LINE_RIPPLE_SELECTOR);
  18843. if (lineRippleElement) {
  18844. this.lineRipple_ = lineRippleFactory(lineRippleElement);
  18845. }
  18846. var outlineElement = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["e" /* strings */].OUTLINE_SELECTOR);
  18847. if (outlineElement) {
  18848. this.outline_ = outlineFactory(outlineElement);
  18849. }
  18850. if (this.input_.hasAttribute(__WEBPACK_IMPORTED_MODULE_3__constants__["e" /* strings */].ARIA_CONTROLS)) {
  18851. var helperTextElement = document.getElementById(this.input_.getAttribute(__WEBPACK_IMPORTED_MODULE_3__constants__["e" /* strings */].ARIA_CONTROLS));
  18852. if (helperTextElement) {
  18853. this.helperText_ = helperTextFactory(helperTextElement);
  18854. }
  18855. }
  18856. var iconElement = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["e" /* strings */].ICON_SELECTOR);
  18857. if (iconElement) {
  18858. this.icon_ = iconFactory(iconElement);
  18859. }
  18860. this.ripple = null;
  18861. if (!this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* cssClasses */].TEXTAREA) && !this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* cssClasses */].OUTLINED)) {
  18862. var MATCHES = Object(__WEBPACK_IMPORTED_MODULE_2__material_ripple_util__["getMatchesProperty"])(HTMLElement.prototype);
  18863. var adapter = _extends(__WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRipple"].createAdapter( /** @type {!RippleCapableSurface} */this), {
  18864. isSurfaceActive: function isSurfaceActive() {
  18865. return _this2.input_[MATCHES](':active');
  18866. },
  18867. registerInteractionHandler: function registerInteractionHandler(type, handler) {
  18868. return _this2.input_.addEventListener(type, handler);
  18869. },
  18870. deregisterInteractionHandler: function deregisterInteractionHandler(type, handler) {
  18871. return _this2.input_.removeEventListener(type, handler);
  18872. }
  18873. });
  18874. var foundation = new __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRippleFoundation"](adapter);
  18875. this.ripple = rippleFactory(this.root_, foundation);
  18876. }
  18877. }
  18878. }, {
  18879. key: 'destroy',
  18880. value: function destroy() {
  18881. if (this.ripple) {
  18882. this.ripple.destroy();
  18883. }
  18884. if (this.lineRipple_) {
  18885. this.lineRipple_.destroy();
  18886. }
  18887. if (this.helperText_) {
  18888. this.helperText_.destroy();
  18889. }
  18890. if (this.icon_) {
  18891. this.icon_.destroy();
  18892. }
  18893. if (this.label_) {
  18894. this.label_.destroy();
  18895. }
  18896. if (this.outline_) {
  18897. this.outline_.destroy();
  18898. }
  18899. _get(MDCTextField.prototype.__proto__ || Object.getPrototypeOf(MDCTextField.prototype), 'destroy', this).call(this);
  18900. }
  18901. /**
  18902. * Initiliazes the Text Field's internal state based on the environment's
  18903. * state.
  18904. */
  18905. }, {
  18906. key: 'initialSyncWithDom',
  18907. value: function initialSyncWithDom() {
  18908. this.disabled = this.input_.disabled;
  18909. }
  18910. /**
  18911. * @return {string} The value of the input.
  18912. */
  18913. }, {
  18914. key: 'layout',
  18915. /**
  18916. * Recomputes the outline SVG path for the outline element.
  18917. */
  18918. value: function layout() {
  18919. var openNotch = this.foundation_.shouldFloat;
  18920. this.foundation_.notchOutline(openNotch);
  18921. }
  18922. /**
  18923. * @return {!MDCTextFieldFoundation}
  18924. */
  18925. }, {
  18926. key: 'getDefaultFoundation',
  18927. value: function getDefaultFoundation() {
  18928. var _this3 = this;
  18929. return new __WEBPACK_IMPORTED_MODULE_5__foundation__["a" /* default */](
  18930. /** @type {!MDCTextFieldAdapter} */_extends({
  18931. addClass: function addClass(className) {
  18932. return _this3.root_.classList.add(className);
  18933. },
  18934. removeClass: function removeClass(className) {
  18935. return _this3.root_.classList.remove(className);
  18936. },
  18937. hasClass: function hasClass(className) {
  18938. return _this3.root_.classList.contains(className);
  18939. },
  18940. registerTextFieldInteractionHandler: function registerTextFieldInteractionHandler(evtType, handler) {
  18941. return _this3.root_.addEventListener(evtType, handler);
  18942. },
  18943. deregisterTextFieldInteractionHandler: function deregisterTextFieldInteractionHandler(evtType, handler) {
  18944. return _this3.root_.removeEventListener(evtType, handler);
  18945. },
  18946. registerValidationAttributeChangeHandler: function registerValidationAttributeChangeHandler(handler) {
  18947. var getAttributesList = function getAttributesList(mutationsList) {
  18948. return mutationsList.map(function (mutation) {
  18949. return mutation.attributeName;
  18950. });
  18951. };
  18952. var observer = new MutationObserver(function (mutationsList) {
  18953. return handler(getAttributesList(mutationsList));
  18954. });
  18955. var targetNode = _this3.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["e" /* strings */].INPUT_SELECTOR);
  18956. var config = { attributes: true };
  18957. observer.observe(targetNode, config);
  18958. return observer;
  18959. },
  18960. deregisterValidationAttributeChangeHandler: function deregisterValidationAttributeChangeHandler(observer) {
  18961. return observer.disconnect();
  18962. },
  18963. isFocused: function isFocused() {
  18964. return document.activeElement === _this3.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["e" /* strings */].INPUT_SELECTOR);
  18965. },
  18966. isRtl: function isRtl() {
  18967. return window.getComputedStyle(_this3.root_).getPropertyValue('direction') === 'rtl';
  18968. }
  18969. }, this.getInputAdapterMethods_(), this.getLabelAdapterMethods_(), this.getLineRippleAdapterMethods_(), this.getOutlineAdapterMethods_()), this.getFoundationMap_());
  18970. }
  18971. /**
  18972. * @return {!{
  18973. * shakeLabel: function(boolean): undefined,
  18974. * floatLabel: function(boolean): undefined,
  18975. * hasLabel: function(): boolean,
  18976. * getLabelWidth: function(): number,
  18977. * }}
  18978. */
  18979. }, {
  18980. key: 'getLabelAdapterMethods_',
  18981. value: function getLabelAdapterMethods_() {
  18982. var _this4 = this;
  18983. return {
  18984. shakeLabel: function shakeLabel(shouldShake) {
  18985. return _this4.label_.shake(shouldShake);
  18986. },
  18987. floatLabel: function floatLabel(shouldFloat) {
  18988. return _this4.label_.float(shouldFloat);
  18989. },
  18990. hasLabel: function hasLabel() {
  18991. return !!_this4.label_;
  18992. },
  18993. getLabelWidth: function getLabelWidth() {
  18994. return _this4.label_.getWidth();
  18995. }
  18996. };
  18997. }
  18998. /**
  18999. * @return {!{
  19000. * activateLineRipple: function(): undefined,
  19001. * deactivateLineRipple: function(): undefined,
  19002. * setLineRippleTransformOrigin: function(number): undefined,
  19003. * }}
  19004. */
  19005. }, {
  19006. key: 'getLineRippleAdapterMethods_',
  19007. value: function getLineRippleAdapterMethods_() {
  19008. var _this5 = this;
  19009. return {
  19010. activateLineRipple: function activateLineRipple() {
  19011. if (_this5.lineRipple_) {
  19012. _this5.lineRipple_.activate();
  19013. }
  19014. },
  19015. deactivateLineRipple: function deactivateLineRipple() {
  19016. if (_this5.lineRipple_) {
  19017. _this5.lineRipple_.deactivate();
  19018. }
  19019. },
  19020. setLineRippleTransformOrigin: function setLineRippleTransformOrigin(normalizedX) {
  19021. if (_this5.lineRipple_) {
  19022. _this5.lineRipple_.setRippleCenter(normalizedX);
  19023. }
  19024. }
  19025. };
  19026. }
  19027. /**
  19028. * @return {!{
  19029. * notchOutline: function(number, boolean): undefined,
  19030. * hasOutline: function(): boolean,
  19031. * }}
  19032. */
  19033. }, {
  19034. key: 'getOutlineAdapterMethods_',
  19035. value: function getOutlineAdapterMethods_() {
  19036. var _this6 = this;
  19037. return {
  19038. notchOutline: function notchOutline(labelWidth, isRtl) {
  19039. return _this6.outline_.notch(labelWidth, isRtl);
  19040. },
  19041. closeOutline: function closeOutline() {
  19042. return _this6.outline_.closeNotch();
  19043. },
  19044. hasOutline: function hasOutline() {
  19045. return !!_this6.outline_;
  19046. }
  19047. };
  19048. }
  19049. /**
  19050. * @return {!{
  19051. * registerInputInteractionHandler: function(string, function()): undefined,
  19052. * deregisterInputInteractionHandler: function(string, function()): undefined,
  19053. * getNativeInput: function(): ?Element,
  19054. * }}
  19055. */
  19056. }, {
  19057. key: 'getInputAdapterMethods_',
  19058. value: function getInputAdapterMethods_() {
  19059. var _this7 = this;
  19060. return {
  19061. registerInputInteractionHandler: function registerInputInteractionHandler(evtType, handler) {
  19062. return _this7.input_.addEventListener(evtType, handler);
  19063. },
  19064. deregisterInputInteractionHandler: function deregisterInputInteractionHandler(evtType, handler) {
  19065. return _this7.input_.removeEventListener(evtType, handler);
  19066. },
  19067. getNativeInput: function getNativeInput() {
  19068. return _this7.input_;
  19069. }
  19070. };
  19071. }
  19072. /**
  19073. * Returns a map of all subcomponents to subfoundations.
  19074. * @return {!FoundationMapType}
  19075. */
  19076. }, {
  19077. key: 'getFoundationMap_',
  19078. value: function getFoundationMap_() {
  19079. return {
  19080. helperText: this.helperText_ ? this.helperText_.foundation : undefined,
  19081. icon: this.icon_ ? this.icon_.foundation : undefined
  19082. };
  19083. }
  19084. }, {
  19085. key: 'value',
  19086. get: function get() {
  19087. return this.foundation_.getValue();
  19088. }
  19089. /**
  19090. * @param {string} value The value to set on the input.
  19091. */
  19092. ,
  19093. set: function set(value) {
  19094. this.foundation_.setValue(value);
  19095. }
  19096. /**
  19097. * @return {boolean} True if the Text Field is disabled.
  19098. */
  19099. }, {
  19100. key: 'disabled',
  19101. get: function get() {
  19102. return this.foundation_.isDisabled();
  19103. }
  19104. /**
  19105. * @param {boolean} disabled Sets the Text Field disabled or enabled.
  19106. */
  19107. ,
  19108. set: function set(disabled) {
  19109. this.foundation_.setDisabled(disabled);
  19110. }
  19111. /**
  19112. * @return {boolean} valid True if the Text Field is valid.
  19113. */
  19114. }, {
  19115. key: 'valid',
  19116. get: function get() {
  19117. return this.foundation_.isValid();
  19118. }
  19119. /**
  19120. * @param {boolean} valid Sets the Text Field valid or invalid.
  19121. */
  19122. ,
  19123. set: function set(valid) {
  19124. this.foundation_.setValid(valid);
  19125. }
  19126. /**
  19127. * @return {boolean} True if the Text Field is required.
  19128. */
  19129. }, {
  19130. key: 'required',
  19131. get: function get() {
  19132. return this.input_.required;
  19133. }
  19134. /**
  19135. * @param {boolean} required Sets the Text Field to required.
  19136. */
  19137. ,
  19138. set: function set(required) {
  19139. this.input_.required = required;
  19140. }
  19141. /**
  19142. * @return {string} The input element's validation pattern.
  19143. */
  19144. }, {
  19145. key: 'pattern',
  19146. get: function get() {
  19147. return this.input_.pattern;
  19148. }
  19149. /**
  19150. * @param {string} pattern Sets the input element's validation pattern.
  19151. */
  19152. ,
  19153. set: function set(pattern) {
  19154. this.input_.pattern = pattern;
  19155. }
  19156. /**
  19157. * @return {number} The input element's minLength.
  19158. */
  19159. }, {
  19160. key: 'minLength',
  19161. get: function get() {
  19162. return this.input_.minLength;
  19163. }
  19164. /**
  19165. * @param {number} minLength Sets the input element's minLength.
  19166. */
  19167. ,
  19168. set: function set(minLength) {
  19169. this.input_.minLength = minLength;
  19170. }
  19171. /**
  19172. * @return {number} The input element's maxLength.
  19173. */
  19174. }, {
  19175. key: 'maxLength',
  19176. get: function get() {
  19177. return this.input_.maxLength;
  19178. }
  19179. /**
  19180. * @param {number} maxLength Sets the input element's maxLength.
  19181. */
  19182. ,
  19183. set: function set(maxLength) {
  19184. // Chrome throws exception if maxLength is set < 0
  19185. if (maxLength < 0) {
  19186. this.input_.removeAttribute('maxLength');
  19187. } else {
  19188. this.input_.maxLength = maxLength;
  19189. }
  19190. }
  19191. /**
  19192. * @return {string} The input element's min.
  19193. */
  19194. }, {
  19195. key: 'min',
  19196. get: function get() {
  19197. return this.input_.min;
  19198. }
  19199. /**
  19200. * @param {string} min Sets the input element's min.
  19201. */
  19202. ,
  19203. set: function set(min) {
  19204. this.input_.min = min;
  19205. }
  19206. /**
  19207. * @return {string} The input element's max.
  19208. */
  19209. }, {
  19210. key: 'max',
  19211. get: function get() {
  19212. return this.input_.max;
  19213. }
  19214. /**
  19215. * @param {string} max Sets the input element's max.
  19216. */
  19217. ,
  19218. set: function set(max) {
  19219. this.input_.max = max;
  19220. }
  19221. /**
  19222. * @return {string} The input element's step.
  19223. */
  19224. }, {
  19225. key: 'step',
  19226. get: function get() {
  19227. return this.input_.step;
  19228. }
  19229. /**
  19230. * @param {string} step Sets the input element's step.
  19231. */
  19232. ,
  19233. set: function set(step) {
  19234. this.input_.step = step;
  19235. }
  19236. /**
  19237. * Sets the helper text element content.
  19238. * @param {string} content
  19239. */
  19240. }, {
  19241. key: 'helperTextContent',
  19242. set: function set(content) {
  19243. this.foundation_.setHelperTextContent(content);
  19244. }
  19245. /**
  19246. * Sets the aria label of the icon.
  19247. * @param {string} label
  19248. */
  19249. }, {
  19250. key: 'iconAriaLabel',
  19251. set: function set(label) {
  19252. this.foundation_.setIconAriaLabel(label);
  19253. }
  19254. /**
  19255. * Sets the text content of the icon.
  19256. * @param {string} content
  19257. */
  19258. }, {
  19259. key: 'iconContent',
  19260. set: function set(content) {
  19261. this.foundation_.setIconContent(content);
  19262. }
  19263. /**
  19264. * Enables or disables the use of native validation. Use this for custom validation.
  19265. * @param {boolean} useNativeValidation Set this to false to ignore native input validation.
  19266. */
  19267. }, {
  19268. key: 'useNativeValidation',
  19269. set: function set(useNativeValidation) {
  19270. this.foundation_.setUseNativeValidation(useNativeValidation);
  19271. }
  19272. }], [{
  19273. key: 'attachTo',
  19274. value: function attachTo(root) {
  19275. return new MDCTextField(root);
  19276. }
  19277. }]);
  19278. return MDCTextField;
  19279. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  19280. /***/ }),
  19281. /* 135 */
  19282. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19283. "use strict";
  19284. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  19285. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  19286. /**
  19287. * @license
  19288. * Copyright 2016 Google Inc.
  19289. *
  19290. * Permission is hereby granted, free of charge, to any person obtaining a copy
  19291. * of this software and associated documentation files (the "Software"), to deal
  19292. * in the Software without restriction, including without limitation the rights
  19293. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  19294. * copies of the Software, and to permit persons to whom the Software is
  19295. * furnished to do so, subject to the following conditions:
  19296. *
  19297. * The above copyright notice and this permission notice shall be included in
  19298. * all copies or substantial portions of the Software.
  19299. *
  19300. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19301. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19302. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19303. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19304. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19305. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19306. * THE SOFTWARE.
  19307. */
  19308. /** @enum {string} */
  19309. var strings = {
  19310. ARIA_HIDDEN: 'aria-hidden',
  19311. ROLE: 'role'
  19312. };
  19313. /** @enum {string} */
  19314. var cssClasses = {
  19315. HELPER_TEXT_PERSISTENT: 'mdc-text-field-helper-text--persistent',
  19316. HELPER_TEXT_VALIDATION_MSG: 'mdc-text-field-helper-text--validation-msg'
  19317. };
  19318. /***/ }),
  19319. /* 136 */
  19320. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19321. "use strict";
  19322. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return strings; });
  19323. /**
  19324. * @license
  19325. * Copyright 2016 Google Inc.
  19326. *
  19327. * Permission is hereby granted, free of charge, to any person obtaining a copy
  19328. * of this software and associated documentation files (the "Software"), to deal
  19329. * in the Software without restriction, including without limitation the rights
  19330. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  19331. * copies of the Software, and to permit persons to whom the Software is
  19332. * furnished to do so, subject to the following conditions:
  19333. *
  19334. * The above copyright notice and this permission notice shall be included in
  19335. * all copies or substantial portions of the Software.
  19336. *
  19337. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19338. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19339. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19340. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19341. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19342. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19343. * THE SOFTWARE.
  19344. */
  19345. /** @enum {string} */
  19346. var strings = {
  19347. ICON_EVENT: 'MDCTextField:icon',
  19348. ICON_ROLE: 'button'
  19349. };
  19350. /***/ }),
  19351. /* 137 */
  19352. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19353. "use strict";
  19354. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  19355. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__helper_text_foundation__ = __webpack_require__(22);
  19356. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__icon_foundation__ = __webpack_require__(23);
  19357. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__adapter__ = __webpack_require__(53);
  19358. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__constants__ = __webpack_require__(52);
  19359. 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; };
  19360. 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; }; }();
  19361. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19362. 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; }
  19363. 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; }
  19364. /**
  19365. * @license
  19366. * Copyright 2016 Google Inc.
  19367. *
  19368. * Permission is hereby granted, free of charge, to any person obtaining a copy
  19369. * of this software and associated documentation files (the "Software"), to deal
  19370. * in the Software without restriction, including without limitation the rights
  19371. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  19372. * copies of the Software, and to permit persons to whom the Software is
  19373. * furnished to do so, subject to the following conditions:
  19374. *
  19375. * The above copyright notice and this permission notice shall be included in
  19376. * all copies or substantial portions of the Software.
  19377. *
  19378. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19379. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19380. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19381. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19382. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19383. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19384. * THE SOFTWARE.
  19385. */
  19386. /* eslint-disable no-unused-vars */
  19387. /* eslint-enable no-unused-vars */
  19388. /**
  19389. * @extends {MDCFoundation<!MDCTextFieldAdapter>}
  19390. * @final
  19391. */
  19392. var MDCTextFieldFoundation = function (_MDCFoundation) {
  19393. _inherits(MDCTextFieldFoundation, _MDCFoundation);
  19394. _createClass(MDCTextFieldFoundation, [{
  19395. key: 'shouldShake',
  19396. /** @return {boolean} */
  19397. get: function get() {
  19398. return !this.isValid() && !this.isFocused_ && !!this.getValue();
  19399. }
  19400. /**
  19401. * @return {boolean}
  19402. * @private
  19403. */
  19404. }, {
  19405. key: 'shouldAlwaysFloat_',
  19406. get: function get() {
  19407. var type = this.getNativeInput_().type;
  19408. return __WEBPACK_IMPORTED_MODULE_4__constants__["a" /* ALWAYS_FLOAT_TYPES */].indexOf(type) >= 0;
  19409. }
  19410. /** @return {boolean} */
  19411. }, {
  19412. key: 'shouldFloat',
  19413. get: function get() {
  19414. return this.shouldAlwaysFloat_ || this.isFocused_ || !!this.getValue() || this.isBadInput_();
  19415. }
  19416. /**
  19417. * {@see MDCTextFieldAdapter} for typing information on parameters and return
  19418. * types.
  19419. * @return {!MDCTextFieldAdapter}
  19420. */
  19421. }], [{
  19422. key: 'cssClasses',
  19423. /** @return enum {string} */
  19424. get: function get() {
  19425. return __WEBPACK_IMPORTED_MODULE_4__constants__["c" /* cssClasses */];
  19426. }
  19427. /** @return enum {string} */
  19428. }, {
  19429. key: 'strings',
  19430. get: function get() {
  19431. return __WEBPACK_IMPORTED_MODULE_4__constants__["e" /* strings */];
  19432. }
  19433. /** @return enum {string} */
  19434. }, {
  19435. key: 'numbers',
  19436. get: function get() {
  19437. return __WEBPACK_IMPORTED_MODULE_4__constants__["d" /* numbers */];
  19438. }
  19439. }, {
  19440. key: 'defaultAdapter',
  19441. get: function get() {
  19442. return (/** @type {!MDCTextFieldAdapter} */{
  19443. addClass: function addClass() {},
  19444. removeClass: function removeClass() {},
  19445. hasClass: function hasClass() {},
  19446. registerTextFieldInteractionHandler: function registerTextFieldInteractionHandler() {},
  19447. deregisterTextFieldInteractionHandler: function deregisterTextFieldInteractionHandler() {},
  19448. registerInputInteractionHandler: function registerInputInteractionHandler() {},
  19449. deregisterInputInteractionHandler: function deregisterInputInteractionHandler() {},
  19450. registerValidationAttributeChangeHandler: function registerValidationAttributeChangeHandler() {},
  19451. deregisterValidationAttributeChangeHandler: function deregisterValidationAttributeChangeHandler() {},
  19452. getNativeInput: function getNativeInput() {},
  19453. isFocused: function isFocused() {},
  19454. isRtl: function isRtl() {},
  19455. activateLineRipple: function activateLineRipple() {},
  19456. deactivateLineRipple: function deactivateLineRipple() {},
  19457. setLineRippleTransformOrigin: function setLineRippleTransformOrigin() {},
  19458. shakeLabel: function shakeLabel() {},
  19459. floatLabel: function floatLabel() {},
  19460. hasLabel: function hasLabel() {},
  19461. getLabelWidth: function getLabelWidth() {},
  19462. hasOutline: function hasOutline() {},
  19463. notchOutline: function notchOutline() {},
  19464. closeOutline: function closeOutline() {}
  19465. }
  19466. );
  19467. }
  19468. /**
  19469. * @param {!MDCTextFieldAdapter} adapter
  19470. * @param {!FoundationMapType=} foundationMap Map from subcomponent names to their subfoundations.
  19471. */
  19472. }]);
  19473. function MDCTextFieldFoundation(adapter) {
  19474. var foundationMap = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : /** @type {!FoundationMapType} */{};
  19475. _classCallCheck(this, MDCTextFieldFoundation);
  19476. /** @type {!MDCTextFieldHelperTextFoundation|undefined} */
  19477. var _this = _possibleConstructorReturn(this, (MDCTextFieldFoundation.__proto__ || Object.getPrototypeOf(MDCTextFieldFoundation)).call(this, _extends(MDCTextFieldFoundation.defaultAdapter, adapter)));
  19478. _this.helperText_ = foundationMap.helperText;
  19479. /** @type {!MDCTextFieldIconFoundation|undefined} */
  19480. _this.icon_ = foundationMap.icon;
  19481. /** @private {boolean} */
  19482. _this.isFocused_ = false;
  19483. /** @private {boolean} */
  19484. _this.receivedUserInput_ = false;
  19485. /** @private {boolean} */
  19486. _this.useCustomValidityChecking_ = false;
  19487. /** @private {boolean} */
  19488. _this.isValid_ = true;
  19489. /** @private {boolean} */
  19490. _this.useNativeValidation_ = true;
  19491. /** @private {function(): undefined} */
  19492. _this.inputFocusHandler_ = function () {
  19493. return _this.activateFocus();
  19494. };
  19495. /** @private {function(): undefined} */
  19496. _this.inputBlurHandler_ = function () {
  19497. return _this.deactivateFocus();
  19498. };
  19499. /** @private {function(): undefined} */
  19500. _this.inputInputHandler_ = function () {
  19501. return _this.autoCompleteFocus();
  19502. };
  19503. /** @private {function(!Event): undefined} */
  19504. _this.setPointerXOffset_ = function (evt) {
  19505. return _this.setTransformOrigin(evt);
  19506. };
  19507. /** @private {function(!Event): undefined} */
  19508. _this.textFieldInteractionHandler_ = function () {
  19509. return _this.handleTextFieldInteraction();
  19510. };
  19511. /** @private {function(!Array): undefined} */
  19512. _this.validationAttributeChangeHandler_ = function (attributesList) {
  19513. return _this.handleValidationAttributeChange(attributesList);
  19514. };
  19515. /** @private {!MutationObserver} */
  19516. _this.validationObserver_;
  19517. return _this;
  19518. }
  19519. _createClass(MDCTextFieldFoundation, [{
  19520. key: 'init',
  19521. value: function init() {
  19522. var _this2 = this;
  19523. if (this.adapter_.isFocused()) {
  19524. this.inputFocusHandler_();
  19525. } else if (this.adapter_.hasLabel() && this.shouldFloat) {
  19526. this.notchOutline(true);
  19527. this.adapter_.floatLabel(true);
  19528. }
  19529. this.adapter_.registerInputInteractionHandler('focus', this.inputFocusHandler_);
  19530. this.adapter_.registerInputInteractionHandler('blur', this.inputBlurHandler_);
  19531. this.adapter_.registerInputInteractionHandler('input', this.inputInputHandler_);
  19532. ['mousedown', 'touchstart'].forEach(function (evtType) {
  19533. _this2.adapter_.registerInputInteractionHandler(evtType, _this2.setPointerXOffset_);
  19534. });
  19535. ['click', 'keydown'].forEach(function (evtType) {
  19536. _this2.adapter_.registerTextFieldInteractionHandler(evtType, _this2.textFieldInteractionHandler_);
  19537. });
  19538. this.validationObserver_ = this.adapter_.registerValidationAttributeChangeHandler(this.validationAttributeChangeHandler_);
  19539. }
  19540. }, {
  19541. key: 'destroy',
  19542. value: function destroy() {
  19543. var _this3 = this;
  19544. this.adapter_.deregisterInputInteractionHandler('focus', this.inputFocusHandler_);
  19545. this.adapter_.deregisterInputInteractionHandler('blur', this.inputBlurHandler_);
  19546. this.adapter_.deregisterInputInteractionHandler('input', this.inputInputHandler_);
  19547. ['mousedown', 'touchstart'].forEach(function (evtType) {
  19548. _this3.adapter_.deregisterInputInteractionHandler(evtType, _this3.setPointerXOffset_);
  19549. });
  19550. ['click', 'keydown'].forEach(function (evtType) {
  19551. _this3.adapter_.deregisterTextFieldInteractionHandler(evtType, _this3.textFieldInteractionHandler_);
  19552. });
  19553. this.adapter_.deregisterValidationAttributeChangeHandler(this.validationObserver_);
  19554. }
  19555. /**
  19556. * Handles user interactions with the Text Field.
  19557. */
  19558. }, {
  19559. key: 'handleTextFieldInteraction',
  19560. value: function handleTextFieldInteraction() {
  19561. if (this.adapter_.getNativeInput().disabled) {
  19562. return;
  19563. }
  19564. this.receivedUserInput_ = true;
  19565. }
  19566. /**
  19567. * Handles validation attribute changes
  19568. * @param {!Array<string>} attributesList
  19569. */
  19570. }, {
  19571. key: 'handleValidationAttributeChange',
  19572. value: function handleValidationAttributeChange(attributesList) {
  19573. var _this4 = this;
  19574. attributesList.some(function (attributeName) {
  19575. if (__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* VALIDATION_ATTR_WHITELIST */].indexOf(attributeName) > -1) {
  19576. _this4.styleValidity_(true);
  19577. return true;
  19578. }
  19579. });
  19580. }
  19581. /**
  19582. * Opens/closes the notched outline.
  19583. * @param {boolean} openNotch
  19584. */
  19585. }, {
  19586. key: 'notchOutline',
  19587. value: function notchOutline(openNotch) {
  19588. if (!this.adapter_.hasOutline()) {
  19589. return;
  19590. }
  19591. if (openNotch) {
  19592. var isDense = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_4__constants__["c" /* cssClasses */].DENSE);
  19593. var labelScale = isDense ? __WEBPACK_IMPORTED_MODULE_4__constants__["d" /* numbers */].DENSE_LABEL_SCALE : __WEBPACK_IMPORTED_MODULE_4__constants__["d" /* numbers */].LABEL_SCALE;
  19594. var labelWidth = this.adapter_.getLabelWidth() * labelScale;
  19595. var isRtl = this.adapter_.isRtl();
  19596. this.adapter_.notchOutline(labelWidth, isRtl);
  19597. } else {
  19598. this.adapter_.closeOutline();
  19599. }
  19600. }
  19601. /**
  19602. * Activates the text field focus state.
  19603. */
  19604. }, {
  19605. key: 'activateFocus',
  19606. value: function activateFocus() {
  19607. this.isFocused_ = true;
  19608. this.styleFocused_(this.isFocused_);
  19609. this.adapter_.activateLineRipple();
  19610. if (this.adapter_.hasLabel()) {
  19611. this.notchOutline(this.shouldFloat);
  19612. this.adapter_.floatLabel(this.shouldFloat);
  19613. this.adapter_.shakeLabel(this.shouldShake);
  19614. }
  19615. if (this.helperText_) {
  19616. this.helperText_.showToScreenReader();
  19617. }
  19618. }
  19619. /**
  19620. * Sets the line ripple's transform origin, so that the line ripple activate
  19621. * animation will animate out from the user's click location.
  19622. * @param {!Event} evt
  19623. */
  19624. }, {
  19625. key: 'setTransformOrigin',
  19626. value: function setTransformOrigin(evt) {
  19627. var targetClientRect = evt.target.getBoundingClientRect();
  19628. var evtCoords = { x: evt.clientX, y: evt.clientY };
  19629. var normalizedX = evtCoords.x - targetClientRect.left;
  19630. this.adapter_.setLineRippleTransformOrigin(normalizedX);
  19631. }
  19632. /**
  19633. * Activates the Text Field's focus state in cases when the input value
  19634. * changes without user input (e.g. programatically).
  19635. */
  19636. }, {
  19637. key: 'autoCompleteFocus',
  19638. value: function autoCompleteFocus() {
  19639. if (!this.receivedUserInput_) {
  19640. this.activateFocus();
  19641. }
  19642. }
  19643. /**
  19644. * Deactivates the Text Field's focus state.
  19645. */
  19646. }, {
  19647. key: 'deactivateFocus',
  19648. value: function deactivateFocus() {
  19649. this.isFocused_ = false;
  19650. this.adapter_.deactivateLineRipple();
  19651. var isValid = this.isValid();
  19652. this.styleValidity_(isValid);
  19653. this.styleFocused_(this.isFocused_);
  19654. if (this.adapter_.hasLabel()) {
  19655. this.notchOutline(this.shouldFloat);
  19656. this.adapter_.floatLabel(this.shouldFloat);
  19657. this.adapter_.shakeLabel(this.shouldShake);
  19658. }
  19659. if (!this.shouldFloat) {
  19660. this.receivedUserInput_ = false;
  19661. }
  19662. }
  19663. /**
  19664. * @return {string} The value of the input Element.
  19665. */
  19666. }, {
  19667. key: 'getValue',
  19668. value: function getValue() {
  19669. return this.getNativeInput_().value;
  19670. }
  19671. /**
  19672. * @param {string} value The value to set on the input Element.
  19673. */
  19674. }, {
  19675. key: 'setValue',
  19676. value: function setValue(value) {
  19677. this.getNativeInput_().value = value;
  19678. var isValid = this.isValid();
  19679. this.styleValidity_(isValid);
  19680. if (this.adapter_.hasLabel()) {
  19681. this.notchOutline(this.shouldFloat);
  19682. this.adapter_.floatLabel(this.shouldFloat);
  19683. this.adapter_.shakeLabel(this.shouldShake);
  19684. }
  19685. }
  19686. /**
  19687. * @return {boolean} If a custom validity is set, returns that value.
  19688. * Otherwise, returns the result of native validity checks.
  19689. */
  19690. }, {
  19691. key: 'isValid',
  19692. value: function isValid() {
  19693. return this.useNativeValidation_ ? this.isNativeInputValid_() : this.isValid_;
  19694. }
  19695. /**
  19696. * @param {boolean} isValid Sets the validity state of the Text Field.
  19697. */
  19698. }, {
  19699. key: 'setValid',
  19700. value: function setValid(isValid) {
  19701. this.isValid_ = isValid;
  19702. this.styleValidity_(isValid);
  19703. var shouldShake = !isValid && !this.isFocused_;
  19704. if (this.adapter_.hasLabel()) {
  19705. this.adapter_.shakeLabel(shouldShake);
  19706. }
  19707. }
  19708. /**
  19709. * Enables or disables the use of native validation. Use this for custom validation.
  19710. * @param {boolean} useNativeValidation Set this to false to ignore native input validation.
  19711. */
  19712. }, {
  19713. key: 'setUseNativeValidation',
  19714. value: function setUseNativeValidation(useNativeValidation) {
  19715. this.useNativeValidation_ = useNativeValidation;
  19716. }
  19717. /**
  19718. * @return {boolean} True if the Text Field is disabled.
  19719. */
  19720. }, {
  19721. key: 'isDisabled',
  19722. value: function isDisabled() {
  19723. return this.getNativeInput_().disabled;
  19724. }
  19725. /**
  19726. * @param {boolean} disabled Sets the text-field disabled or enabled.
  19727. */
  19728. }, {
  19729. key: 'setDisabled',
  19730. value: function setDisabled(disabled) {
  19731. this.getNativeInput_().disabled = disabled;
  19732. this.styleDisabled_(disabled);
  19733. }
  19734. /**
  19735. * @param {string} content Sets the content of the helper text.
  19736. */
  19737. }, {
  19738. key: 'setHelperTextContent',
  19739. value: function setHelperTextContent(content) {
  19740. if (this.helperText_) {
  19741. this.helperText_.setContent(content);
  19742. }
  19743. }
  19744. /**
  19745. * Sets the aria label of the icon.
  19746. * @param {string} label
  19747. */
  19748. }, {
  19749. key: 'setIconAriaLabel',
  19750. value: function setIconAriaLabel(label) {
  19751. if (this.icon_) {
  19752. this.icon_.setAriaLabel(label);
  19753. }
  19754. }
  19755. /**
  19756. * Sets the text content of the icon.
  19757. * @param {string} content
  19758. */
  19759. }, {
  19760. key: 'setIconContent',
  19761. value: function setIconContent(content) {
  19762. if (this.icon_) {
  19763. this.icon_.setContent(content);
  19764. }
  19765. }
  19766. /**
  19767. * @return {boolean} True if the Text Field input fails in converting the
  19768. * user-supplied value.
  19769. * @private
  19770. */
  19771. }, {
  19772. key: 'isBadInput_',
  19773. value: function isBadInput_() {
  19774. return this.getNativeInput_().validity.badInput;
  19775. }
  19776. /**
  19777. * @return {boolean} The result of native validity checking
  19778. * (ValidityState.valid).
  19779. */
  19780. }, {
  19781. key: 'isNativeInputValid_',
  19782. value: function isNativeInputValid_() {
  19783. return this.getNativeInput_().validity.valid;
  19784. }
  19785. /**
  19786. * Styles the component based on the validity state.
  19787. * @param {boolean} isValid
  19788. * @private
  19789. */
  19790. }, {
  19791. key: 'styleValidity_',
  19792. value: function styleValidity_(isValid) {
  19793. var INVALID = MDCTextFieldFoundation.cssClasses.INVALID;
  19794. if (isValid) {
  19795. this.adapter_.removeClass(INVALID);
  19796. } else {
  19797. this.adapter_.addClass(INVALID);
  19798. }
  19799. if (this.helperText_) {
  19800. this.helperText_.setValidity(isValid);
  19801. }
  19802. }
  19803. /**
  19804. * Styles the component based on the focused state.
  19805. * @param {boolean} isFocused
  19806. * @private
  19807. */
  19808. }, {
  19809. key: 'styleFocused_',
  19810. value: function styleFocused_(isFocused) {
  19811. var FOCUSED = MDCTextFieldFoundation.cssClasses.FOCUSED;
  19812. if (isFocused) {
  19813. this.adapter_.addClass(FOCUSED);
  19814. } else {
  19815. this.adapter_.removeClass(FOCUSED);
  19816. }
  19817. }
  19818. /**
  19819. * Styles the component based on the disabled state.
  19820. * @param {boolean} isDisabled
  19821. * @private
  19822. */
  19823. }, {
  19824. key: 'styleDisabled_',
  19825. value: function styleDisabled_(isDisabled) {
  19826. var _MDCTextFieldFoundati = MDCTextFieldFoundation.cssClasses,
  19827. DISABLED = _MDCTextFieldFoundati.DISABLED,
  19828. INVALID = _MDCTextFieldFoundati.INVALID;
  19829. if (isDisabled) {
  19830. this.adapter_.addClass(DISABLED);
  19831. this.adapter_.removeClass(INVALID);
  19832. } else {
  19833. this.adapter_.removeClass(DISABLED);
  19834. }
  19835. if (this.icon_) {
  19836. this.icon_.setDisabled(isDisabled);
  19837. }
  19838. }
  19839. /**
  19840. * @return {!Element|!NativeInputType} The native text input from the
  19841. * host environment, or a dummy if none exists.
  19842. * @private
  19843. */
  19844. }, {
  19845. key: 'getNativeInput_',
  19846. value: function getNativeInput_() {
  19847. return this.adapter_.getNativeInput() ||
  19848. /** @type {!NativeInputType} */{
  19849. value: '',
  19850. disabled: false,
  19851. validity: {
  19852. badInput: false,
  19853. valid: true
  19854. }
  19855. };
  19856. }
  19857. }]);
  19858. return MDCTextFieldFoundation;
  19859. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  19860. /* harmony default export */ __webpack_exports__["a"] = (MDCTextFieldFoundation);
  19861. /***/ }),
  19862. /* 138 */
  19863. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19864. "use strict";
  19865. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCTextFieldHelperText; });
  19866. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  19867. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(54);
  19868. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(22);
  19869. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  19870. 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; };
  19871. 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; }; }();
  19872. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19873. 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; }
  19874. 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; }
  19875. /**
  19876. * @license
  19877. * Copyright 2017 Google Inc.
  19878. *
  19879. * Permission is hereby granted, free of charge, to any person obtaining a copy
  19880. * of this software and associated documentation files (the "Software"), to deal
  19881. * in the Software without restriction, including without limitation the rights
  19882. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  19883. * copies of the Software, and to permit persons to whom the Software is
  19884. * furnished to do so, subject to the following conditions:
  19885. *
  19886. * The above copyright notice and this permission notice shall be included in
  19887. * all copies or substantial portions of the Software.
  19888. *
  19889. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19890. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19891. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19892. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19893. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19894. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19895. * THE SOFTWARE.
  19896. */
  19897. /**
  19898. * @extends {MDCComponent<!MDCTextFieldHelperTextFoundation>}
  19899. * @final
  19900. */
  19901. var MDCTextFieldHelperText = function (_MDCComponent) {
  19902. _inherits(MDCTextFieldHelperText, _MDCComponent);
  19903. function MDCTextFieldHelperText() {
  19904. _classCallCheck(this, MDCTextFieldHelperText);
  19905. return _possibleConstructorReturn(this, (MDCTextFieldHelperText.__proto__ || Object.getPrototypeOf(MDCTextFieldHelperText)).apply(this, arguments));
  19906. }
  19907. _createClass(MDCTextFieldHelperText, [{
  19908. key: 'getDefaultFoundation',
  19909. /**
  19910. * @return {!MDCTextFieldHelperTextFoundation}
  19911. */
  19912. value: function getDefaultFoundation() {
  19913. var _this2 = this;
  19914. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]( /** @type {!MDCTextFieldHelperTextAdapter} */_extends({
  19915. addClass: function addClass(className) {
  19916. return _this2.root_.classList.add(className);
  19917. },
  19918. removeClass: function removeClass(className) {
  19919. return _this2.root_.classList.remove(className);
  19920. },
  19921. hasClass: function hasClass(className) {
  19922. return _this2.root_.classList.contains(className);
  19923. },
  19924. setAttr: function setAttr(attr, value) {
  19925. return _this2.root_.setAttribute(attr, value);
  19926. },
  19927. removeAttr: function removeAttr(attr) {
  19928. return _this2.root_.removeAttribute(attr);
  19929. },
  19930. setContent: function setContent(content) {
  19931. _this2.root_.textContent = content;
  19932. }
  19933. }));
  19934. }
  19935. }, {
  19936. key: 'foundation',
  19937. /**
  19938. * @return {!MDCTextFieldHelperTextFoundation}
  19939. */
  19940. get: function get() {
  19941. return this.foundation_;
  19942. }
  19943. }], [{
  19944. key: 'attachTo',
  19945. /**
  19946. * @param {!Element} root
  19947. * @return {!MDCTextFieldHelperText}
  19948. */
  19949. value: function attachTo(root) {
  19950. return new MDCTextFieldHelperText(root);
  19951. }
  19952. }]);
  19953. return MDCTextFieldHelperText;
  19954. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  19955. /***/ }),
  19956. /* 139 */
  19957. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19958. "use strict";
  19959. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCTextFieldIcon; });
  19960. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  19961. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(55);
  19962. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(23);
  19963. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  19964. 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; };
  19965. 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; }; }();
  19966. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19967. 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; }
  19968. 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; }
  19969. /**
  19970. * @license
  19971. * Copyright 2017 Google Inc.
  19972. *
  19973. * Permission is hereby granted, free of charge, to any person obtaining a copy
  19974. * of this software and associated documentation files (the "Software"), to deal
  19975. * in the Software without restriction, including without limitation the rights
  19976. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  19977. * copies of the Software, and to permit persons to whom the Software is
  19978. * furnished to do so, subject to the following conditions:
  19979. *
  19980. * The above copyright notice and this permission notice shall be included in
  19981. * all copies or substantial portions of the Software.
  19982. *
  19983. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19984. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19985. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19986. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19987. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19988. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19989. * THE SOFTWARE.
  19990. */
  19991. /**
  19992. * @extends {MDCComponent<!MDCTextFieldIconFoundation>}
  19993. * @final
  19994. */
  19995. var MDCTextFieldIcon = function (_MDCComponent) {
  19996. _inherits(MDCTextFieldIcon, _MDCComponent);
  19997. function MDCTextFieldIcon() {
  19998. _classCallCheck(this, MDCTextFieldIcon);
  19999. return _possibleConstructorReturn(this, (MDCTextFieldIcon.__proto__ || Object.getPrototypeOf(MDCTextFieldIcon)).apply(this, arguments));
  20000. }
  20001. _createClass(MDCTextFieldIcon, [{
  20002. key: 'getDefaultFoundation',
  20003. /**
  20004. * @return {!MDCTextFieldIconFoundation}
  20005. */
  20006. value: function getDefaultFoundation() {
  20007. var _this2 = this;
  20008. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]( /** @type {!MDCTextFieldIconAdapter} */_extends({
  20009. getAttr: function getAttr(attr) {
  20010. return _this2.root_.getAttribute(attr);
  20011. },
  20012. setAttr: function setAttr(attr, value) {
  20013. return _this2.root_.setAttribute(attr, value);
  20014. },
  20015. removeAttr: function removeAttr(attr) {
  20016. return _this2.root_.removeAttribute(attr);
  20017. },
  20018. setContent: function setContent(content) {
  20019. _this2.root_.textContent = content;
  20020. },
  20021. registerInteractionHandler: function registerInteractionHandler(evtType, handler) {
  20022. return _this2.root_.addEventListener(evtType, handler);
  20023. },
  20024. deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) {
  20025. return _this2.root_.removeEventListener(evtType, handler);
  20026. },
  20027. notifyIconAction: function notifyIconAction() {
  20028. return _this2.emit(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.ICON_EVENT, {} /* evtData */, true /* shouldBubble */);
  20029. }
  20030. }));
  20031. }
  20032. }, {
  20033. key: 'foundation',
  20034. /**
  20035. * @return {!MDCTextFieldIconFoundation}
  20036. */
  20037. get: function get() {
  20038. return this.foundation_;
  20039. }
  20040. }], [{
  20041. key: 'attachTo',
  20042. /**
  20043. * @param {!Element} root
  20044. * @return {!MDCTextFieldIcon}
  20045. */
  20046. value: function attachTo(root) {
  20047. return new MDCTextFieldIcon(root);
  20048. }
  20049. }]);
  20050. return MDCTextFieldIcon;
  20051. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  20052. /***/ }),
  20053. /* 140 */
  20054. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20055. "use strict";
  20056. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  20057. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCToolbar", function() { return MDCToolbar; });
  20058. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_index__ = __webpack_require__(3);
  20059. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__ = __webpack_require__(2);
  20060. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(141);
  20061. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCToolbarFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  20062. 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; }; }();
  20063. 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); } };
  20064. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20065. 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; }
  20066. 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; }
  20067. /**
  20068. * @license
  20069. * Copyright 2017 Google Inc.
  20070. *
  20071. * Permission is hereby granted, free of charge, to any person obtaining a copy
  20072. * of this software and associated documentation files (the "Software"), to deal
  20073. * in the Software without restriction, including without limitation the rights
  20074. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  20075. * copies of the Software, and to permit persons to whom the Software is
  20076. * furnished to do so, subject to the following conditions:
  20077. *
  20078. * The above copyright notice and this permission notice shall be included in
  20079. * all copies or substantial portions of the Software.
  20080. *
  20081. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  20082. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  20083. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  20084. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20085. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20086. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  20087. * THE SOFTWARE.
  20088. */
  20089. var MDCToolbar = function (_MDCComponent) {
  20090. _inherits(MDCToolbar, _MDCComponent);
  20091. function MDCToolbar() {
  20092. _classCallCheck(this, MDCToolbar);
  20093. return _possibleConstructorReturn(this, (MDCToolbar.__proto__ || Object.getPrototypeOf(MDCToolbar)).apply(this, arguments));
  20094. }
  20095. _createClass(MDCToolbar, [{
  20096. key: 'initialize',
  20097. value: function initialize() {
  20098. this.ripples_ = [].map.call(this.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.ICON_SELECTOR), function (icon) {
  20099. var ripple = __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRipple"].attachTo(icon);
  20100. ripple.unbounded = true;
  20101. return ripple;
  20102. });
  20103. }
  20104. }, {
  20105. key: 'destroy',
  20106. value: function destroy() {
  20107. this.ripples_.forEach(function (ripple) {
  20108. ripple.destroy();
  20109. });
  20110. _get(MDCToolbar.prototype.__proto__ || Object.getPrototypeOf(MDCToolbar.prototype), 'destroy', this).call(this);
  20111. }
  20112. }, {
  20113. key: 'getDefaultFoundation',
  20114. value: function getDefaultFoundation() {
  20115. var _this2 = this;
  20116. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]({
  20117. hasClass: function hasClass(className) {
  20118. return _this2.root_.classList.contains(className);
  20119. },
  20120. addClass: function addClass(className) {
  20121. return _this2.root_.classList.add(className);
  20122. },
  20123. removeClass: function removeClass(className) {
  20124. return _this2.root_.classList.remove(className);
  20125. },
  20126. registerScrollHandler: function registerScrollHandler(handler) {
  20127. return window.addEventListener('scroll', handler);
  20128. },
  20129. deregisterScrollHandler: function deregisterScrollHandler(handler) {
  20130. return window.removeEventListener('scroll', handler);
  20131. },
  20132. registerResizeHandler: function registerResizeHandler(handler) {
  20133. return window.addEventListener('resize', handler);
  20134. },
  20135. deregisterResizeHandler: function deregisterResizeHandler(handler) {
  20136. return window.removeEventListener('resize', handler);
  20137. },
  20138. getViewportWidth: function getViewportWidth() {
  20139. return window.innerWidth;
  20140. },
  20141. getViewportScrollY: function getViewportScrollY() {
  20142. return window.pageYOffset;
  20143. },
  20144. getOffsetHeight: function getOffsetHeight() {
  20145. return _this2.root_.offsetHeight;
  20146. },
  20147. getFirstRowElementOffsetHeight: function getFirstRowElementOffsetHeight() {
  20148. return _this2.firstRowElement_.offsetHeight;
  20149. },
  20150. notifyChange: function notifyChange(evtData) {
  20151. return _this2.emit(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.CHANGE_EVENT, evtData);
  20152. },
  20153. setStyle: function setStyle(property, value) {
  20154. return _this2.root_.style.setProperty(property, value);
  20155. },
  20156. setStyleForTitleElement: function setStyleForTitleElement(property, value) {
  20157. return _this2.titleElement_.style.setProperty(property, value);
  20158. },
  20159. setStyleForFlexibleRowElement: function setStyleForFlexibleRowElement(property, value) {
  20160. return _this2.firstRowElement_.style.setProperty(property, value);
  20161. },
  20162. setStyleForFixedAdjustElement: function setStyleForFixedAdjustElement(property, value) {
  20163. if (_this2.fixedAdjustElement) {
  20164. _this2.fixedAdjustElement.style.setProperty(property, value);
  20165. }
  20166. }
  20167. });
  20168. }
  20169. }, {
  20170. key: 'firstRowElement_',
  20171. get: function get() {
  20172. return this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.FIRST_ROW_SELECTOR);
  20173. }
  20174. }, {
  20175. key: 'titleElement_',
  20176. get: function get() {
  20177. return this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.TITLE_SELECTOR);
  20178. }
  20179. }, {
  20180. key: 'fixedAdjustElement',
  20181. set: function set(fixedAdjustElement) {
  20182. this.fixedAdjustElement_ = fixedAdjustElement;
  20183. this.foundation_.updateAdjustElementStyles();
  20184. },
  20185. get: function get() {
  20186. return this.fixedAdjustElement_;
  20187. }
  20188. }], [{
  20189. key: 'attachTo',
  20190. value: function attachTo(root) {
  20191. return new MDCToolbar(root);
  20192. }
  20193. }]);
  20194. return MDCToolbar;
  20195. }(__WEBPACK_IMPORTED_MODULE_0__material_base_index__["MDCComponent"]);
  20196. /***/ }),
  20197. /* 141 */
  20198. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20199. "use strict";
  20200. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  20201. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(142);
  20202. 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; };
  20203. 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; }; }();
  20204. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20205. 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; }
  20206. 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; }
  20207. /**
  20208. * @license
  20209. * Copyright 2017 Google Inc.
  20210. *
  20211. * Permission is hereby granted, free of charge, to any person obtaining a copy
  20212. * of this software and associated documentation files (the "Software"), to deal
  20213. * in the Software without restriction, including without limitation the rights
  20214. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  20215. * copies of the Software, and to permit persons to whom the Software is
  20216. * furnished to do so, subject to the following conditions:
  20217. *
  20218. * The above copyright notice and this permission notice shall be included in
  20219. * all copies or substantial portions of the Software.
  20220. *
  20221. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  20222. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  20223. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  20224. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20225. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20226. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  20227. * THE SOFTWARE.
  20228. */
  20229. var MDCToolbarFoundation = function (_MDCFoundation) {
  20230. _inherits(MDCToolbarFoundation, _MDCFoundation);
  20231. _createClass(MDCToolbarFoundation, null, [{
  20232. key: 'cssClasses',
  20233. get: function get() {
  20234. return __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */];
  20235. }
  20236. }, {
  20237. key: 'strings',
  20238. get: function get() {
  20239. return __WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */];
  20240. }
  20241. }, {
  20242. key: 'numbers',
  20243. get: function get() {
  20244. return __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* numbers */];
  20245. }
  20246. }, {
  20247. key: 'defaultAdapter',
  20248. get: function get() {
  20249. return {
  20250. hasClass: function hasClass() {
  20251. return (/* className: string */ /* boolean */false
  20252. );
  20253. },
  20254. addClass: function addClass() /* className: string */{},
  20255. removeClass: function removeClass() /* className: string */{},
  20256. registerScrollHandler: function registerScrollHandler() /* handler: EventListener */{},
  20257. deregisterScrollHandler: function deregisterScrollHandler() /* handler: EventListener */{},
  20258. registerResizeHandler: function registerResizeHandler() /* handler: EventListener */{},
  20259. deregisterResizeHandler: function deregisterResizeHandler() /* handler: EventListener */{},
  20260. getViewportWidth: function getViewportWidth() {
  20261. return (/* number */0
  20262. );
  20263. },
  20264. getViewportScrollY: function getViewportScrollY() {
  20265. return (/* number */0
  20266. );
  20267. },
  20268. getOffsetHeight: function getOffsetHeight() {
  20269. return (/* number */0
  20270. );
  20271. },
  20272. getFirstRowElementOffsetHeight: function getFirstRowElementOffsetHeight() {
  20273. return (/* number */0
  20274. );
  20275. },
  20276. notifyChange: function notifyChange() /* evtData: {flexibleExpansionRatio: number} */{},
  20277. setStyle: function setStyle() /* property: string, value: string */{},
  20278. setStyleForTitleElement: function setStyleForTitleElement() /* property: string, value: string */{},
  20279. setStyleForFlexibleRowElement: function setStyleForFlexibleRowElement() /* property: string, value: string */{},
  20280. setStyleForFixedAdjustElement: function setStyleForFixedAdjustElement() /* property: string, value: string */{}
  20281. };
  20282. }
  20283. }]);
  20284. function MDCToolbarFoundation(adapter) {
  20285. _classCallCheck(this, MDCToolbarFoundation);
  20286. var _this = _possibleConstructorReturn(this, (MDCToolbarFoundation.__proto__ || Object.getPrototypeOf(MDCToolbarFoundation)).call(this, _extends(MDCToolbarFoundation.defaultAdapter, adapter)));
  20287. _this.resizeHandler_ = function () {
  20288. return _this.checkRowHeight_();
  20289. };
  20290. _this.scrollHandler_ = function () {
  20291. return _this.updateToolbarStyles_();
  20292. };
  20293. _this.checkRowHeightFrame_ = 0;
  20294. _this.scrollFrame_ = 0;
  20295. _this.executedLastChange_ = false;
  20296. _this.calculations_ = {
  20297. toolbarRowHeight: 0,
  20298. // Calculated Height ratio. We use ratio to calculate corresponding heights in resize event.
  20299. toolbarRatio: 0, // The ratio of toolbar height to row height
  20300. flexibleExpansionRatio: 0, // The ratio of flexible space height to row height
  20301. maxTranslateYRatio: 0, // The ratio of max toolbar move up distance to row height
  20302. scrollThresholdRatio: 0, // The ratio of max scrollTop that we should listen to to row height
  20303. // Derived Heights based on the above key ratios.
  20304. toolbarHeight: 0,
  20305. flexibleExpansionHeight: 0, // Flexible row minus toolbar height (derived)
  20306. maxTranslateYDistance: 0, // When toolbar only fix last row (derived)
  20307. scrollThreshold: 0
  20308. };
  20309. // Toolbar fixed behavior
  20310. // If toolbar is fixed
  20311. _this.fixed_ = false;
  20312. // If fixed is targeted only at the last row
  20313. _this.fixedLastrow_ = false;
  20314. // Toolbar flexible behavior
  20315. // If the first row is flexible
  20316. _this.hasFlexibleRow_ = false;
  20317. // If use the default behavior
  20318. _this.useFlexDefaultBehavior_ = false;
  20319. return _this;
  20320. }
  20321. _createClass(MDCToolbarFoundation, [{
  20322. key: 'init',
  20323. value: function init() {
  20324. this.fixed_ = this.adapter_.hasClass(MDCToolbarFoundation.cssClasses.FIXED);
  20325. this.fixedLastrow_ = this.adapter_.hasClass(MDCToolbarFoundation.cssClasses.FIXED_LASTROW) & this.fixed_;
  20326. this.hasFlexibleRow_ = this.adapter_.hasClass(MDCToolbarFoundation.cssClasses.TOOLBAR_ROW_FLEXIBLE);
  20327. if (this.hasFlexibleRow_) {
  20328. this.useFlexDefaultBehavior_ = this.adapter_.hasClass(MDCToolbarFoundation.cssClasses.FLEXIBLE_DEFAULT_BEHAVIOR);
  20329. }
  20330. this.initKeyRatio_();
  20331. this.setKeyHeights_();
  20332. this.adapter_.registerResizeHandler(this.resizeHandler_);
  20333. this.adapter_.registerScrollHandler(this.scrollHandler_);
  20334. }
  20335. }, {
  20336. key: 'destroy',
  20337. value: function destroy() {
  20338. this.adapter_.deregisterResizeHandler(this.resizeHandler_);
  20339. this.adapter_.deregisterScrollHandler(this.scrollHandler_);
  20340. }
  20341. }, {
  20342. key: 'updateAdjustElementStyles',
  20343. value: function updateAdjustElementStyles() {
  20344. if (this.fixed_) {
  20345. this.adapter_.setStyleForFixedAdjustElement('margin-top', this.calculations_.toolbarHeight + 'px');
  20346. }
  20347. }
  20348. }, {
  20349. key: 'getFlexibleExpansionRatio_',
  20350. value: function getFlexibleExpansionRatio_(scrollTop) {
  20351. // To prevent division by zero when there is no flexibleExpansionHeight
  20352. var delta = 0.0001;
  20353. return Math.max(0, 1 - scrollTop / (this.calculations_.flexibleExpansionHeight + delta));
  20354. }
  20355. }, {
  20356. key: 'checkRowHeight_',
  20357. value: function checkRowHeight_() {
  20358. var _this2 = this;
  20359. cancelAnimationFrame(this.checkRowHeightFrame_);
  20360. this.checkRowHeightFrame_ = requestAnimationFrame(function () {
  20361. return _this2.setKeyHeights_();
  20362. });
  20363. }
  20364. }, {
  20365. key: 'setKeyHeights_',
  20366. value: function setKeyHeights_() {
  20367. var newToolbarRowHeight = this.getRowHeight_();
  20368. if (newToolbarRowHeight !== this.calculations_.toolbarRowHeight) {
  20369. this.calculations_.toolbarRowHeight = newToolbarRowHeight;
  20370. this.calculations_.toolbarHeight = this.calculations_.toolbarRatio * this.calculations_.toolbarRowHeight;
  20371. this.calculations_.flexibleExpansionHeight = this.calculations_.flexibleExpansionRatio * this.calculations_.toolbarRowHeight;
  20372. this.calculations_.maxTranslateYDistance = this.calculations_.maxTranslateYRatio * this.calculations_.toolbarRowHeight;
  20373. this.calculations_.scrollThreshold = this.calculations_.scrollThresholdRatio * this.calculations_.toolbarRowHeight;
  20374. this.updateAdjustElementStyles();
  20375. this.updateToolbarStyles_();
  20376. }
  20377. }
  20378. }, {
  20379. key: 'updateToolbarStyles_',
  20380. value: function updateToolbarStyles_() {
  20381. var _this3 = this;
  20382. cancelAnimationFrame(this.scrollFrame_);
  20383. this.scrollFrame_ = requestAnimationFrame(function () {
  20384. var scrollTop = _this3.adapter_.getViewportScrollY();
  20385. var hasScrolledOutOfThreshold = _this3.scrolledOutOfThreshold_(scrollTop);
  20386. if (hasScrolledOutOfThreshold && _this3.executedLastChange_) {
  20387. return;
  20388. }
  20389. var flexibleExpansionRatio = _this3.getFlexibleExpansionRatio_(scrollTop);
  20390. _this3.updateToolbarFlexibleState_(flexibleExpansionRatio);
  20391. if (_this3.fixedLastrow_) {
  20392. _this3.updateToolbarFixedState_(scrollTop);
  20393. }
  20394. if (_this3.hasFlexibleRow_) {
  20395. _this3.updateFlexibleRowElementStyles_(flexibleExpansionRatio);
  20396. }
  20397. _this3.executedLastChange_ = hasScrolledOutOfThreshold;
  20398. _this3.adapter_.notifyChange({ flexibleExpansionRatio: flexibleExpansionRatio });
  20399. });
  20400. }
  20401. }, {
  20402. key: 'scrolledOutOfThreshold_',
  20403. value: function scrolledOutOfThreshold_(scrollTop) {
  20404. return scrollTop > this.calculations_.scrollThreshold;
  20405. }
  20406. }, {
  20407. key: 'initKeyRatio_',
  20408. value: function initKeyRatio_() {
  20409. var toolbarRowHeight = this.getRowHeight_();
  20410. var firstRowMaxRatio = this.adapter_.getFirstRowElementOffsetHeight() / toolbarRowHeight;
  20411. this.calculations_.toolbarRatio = this.adapter_.getOffsetHeight() / toolbarRowHeight;
  20412. this.calculations_.flexibleExpansionRatio = firstRowMaxRatio - 1;
  20413. this.calculations_.maxTranslateYRatio = this.fixedLastrow_ ? this.calculations_.toolbarRatio - firstRowMaxRatio : 0;
  20414. this.calculations_.scrollThresholdRatio = (this.fixedLastrow_ ? this.calculations_.toolbarRatio : firstRowMaxRatio) - 1;
  20415. }
  20416. }, {
  20417. key: 'getRowHeight_',
  20418. value: function getRowHeight_() {
  20419. var breakpoint = MDCToolbarFoundation.numbers.TOOLBAR_MOBILE_BREAKPOINT;
  20420. return this.adapter_.getViewportWidth() < breakpoint ? MDCToolbarFoundation.numbers.TOOLBAR_ROW_MOBILE_HEIGHT : MDCToolbarFoundation.numbers.TOOLBAR_ROW_HEIGHT;
  20421. }
  20422. }, {
  20423. key: 'updateToolbarFlexibleState_',
  20424. value: function updateToolbarFlexibleState_(flexibleExpansionRatio) {
  20425. this.adapter_.removeClass(MDCToolbarFoundation.cssClasses.FLEXIBLE_MAX);
  20426. this.adapter_.removeClass(MDCToolbarFoundation.cssClasses.FLEXIBLE_MIN);
  20427. if (flexibleExpansionRatio === 1) {
  20428. this.adapter_.addClass(MDCToolbarFoundation.cssClasses.FLEXIBLE_MAX);
  20429. } else if (flexibleExpansionRatio === 0) {
  20430. this.adapter_.addClass(MDCToolbarFoundation.cssClasses.FLEXIBLE_MIN);
  20431. }
  20432. }
  20433. }, {
  20434. key: 'updateToolbarFixedState_',
  20435. value: function updateToolbarFixedState_(scrollTop) {
  20436. var translateDistance = Math.max(0, Math.min(scrollTop - this.calculations_.flexibleExpansionHeight, this.calculations_.maxTranslateYDistance));
  20437. this.adapter_.setStyle('transform', 'translateY(' + -translateDistance + 'px)');
  20438. if (translateDistance === this.calculations_.maxTranslateYDistance) {
  20439. this.adapter_.addClass(MDCToolbarFoundation.cssClasses.FIXED_AT_LAST_ROW);
  20440. } else {
  20441. this.adapter_.removeClass(MDCToolbarFoundation.cssClasses.FIXED_AT_LAST_ROW);
  20442. }
  20443. }
  20444. }, {
  20445. key: 'updateFlexibleRowElementStyles_',
  20446. value: function updateFlexibleRowElementStyles_(flexibleExpansionRatio) {
  20447. if (this.fixed_) {
  20448. var height = this.calculations_.flexibleExpansionHeight * flexibleExpansionRatio;
  20449. this.adapter_.setStyleForFlexibleRowElement('height', height + this.calculations_.toolbarRowHeight + 'px');
  20450. }
  20451. if (this.useFlexDefaultBehavior_) {
  20452. this.updateElementStylesDefaultBehavior_(flexibleExpansionRatio);
  20453. }
  20454. }
  20455. }, {
  20456. key: 'updateElementStylesDefaultBehavior_',
  20457. value: function updateElementStylesDefaultBehavior_(flexibleExpansionRatio) {
  20458. var maxTitleSize = MDCToolbarFoundation.numbers.MAX_TITLE_SIZE;
  20459. var minTitleSize = MDCToolbarFoundation.numbers.MIN_TITLE_SIZE;
  20460. var currentTitleSize = (maxTitleSize - minTitleSize) * flexibleExpansionRatio + minTitleSize;
  20461. this.adapter_.setStyleForTitleElement('font-size', currentTitleSize + 'rem');
  20462. }
  20463. }]);
  20464. return MDCToolbarFoundation;
  20465. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  20466. /* harmony default export */ __webpack_exports__["a"] = (MDCToolbarFoundation);
  20467. /***/ }),
  20468. /* 142 */
  20469. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20470. "use strict";
  20471. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  20472. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; });
  20473. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; });
  20474. /**
  20475. * @license
  20476. * Copyright 2017 Google Inc.
  20477. *
  20478. * Permission is hereby granted, free of charge, to any person obtaining a copy
  20479. * of this software and associated documentation files (the "Software"), to deal
  20480. * in the Software without restriction, including without limitation the rights
  20481. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  20482. * copies of the Software, and to permit persons to whom the Software is
  20483. * furnished to do so, subject to the following conditions:
  20484. *
  20485. * The above copyright notice and this permission notice shall be included in
  20486. * all copies or substantial portions of the Software.
  20487. *
  20488. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  20489. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  20490. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  20491. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20492. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20493. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  20494. * THE SOFTWARE.
  20495. */
  20496. var cssClasses = {
  20497. FIXED: 'mdc-toolbar--fixed',
  20498. FIXED_LASTROW: 'mdc-toolbar--fixed-lastrow-only',
  20499. FIXED_AT_LAST_ROW: 'mdc-toolbar--fixed-at-last-row',
  20500. TOOLBAR_ROW_FLEXIBLE: 'mdc-toolbar--flexible',
  20501. FLEXIBLE_DEFAULT_BEHAVIOR: 'mdc-toolbar--flexible-default-behavior',
  20502. FLEXIBLE_MAX: 'mdc-toolbar--flexible-space-maximized',
  20503. FLEXIBLE_MIN: 'mdc-toolbar--flexible-space-minimized'
  20504. };
  20505. var strings = {
  20506. TITLE_SELECTOR: '.mdc-toolbar__title',
  20507. ICON_SELECTOR: '.mdc-toolbar__icon',
  20508. FIRST_ROW_SELECTOR: '.mdc-toolbar__row:first-child',
  20509. CHANGE_EVENT: 'MDCToolbar:change'
  20510. };
  20511. var numbers = {
  20512. MAX_TITLE_SIZE: 2.125,
  20513. MIN_TITLE_SIZE: 1.25,
  20514. TOOLBAR_ROW_HEIGHT: 64,
  20515. TOOLBAR_ROW_MOBILE_HEIGHT: 56,
  20516. TOOLBAR_MOBILE_BREAKPOINT: 600
  20517. };
  20518. /***/ }),
  20519. /* 143 */
  20520. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20521. "use strict";
  20522. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  20523. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTopAppBar", function() { return MDCTopAppBar; });
  20524. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__adapter__ = __webpack_require__(7);
  20525. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_component__ = __webpack_require__(1);
  20526. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_ripple_index__ = __webpack_require__(2);
  20527. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__constants__ = __webpack_require__(8);
  20528. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation__ = __webpack_require__(12);
  20529. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__fixed_foundation__ = __webpack_require__(144);
  20530. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__short_foundation__ = __webpack_require__(145);
  20531. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__standard_foundation__ = __webpack_require__(146);
  20532. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTopAppBarBaseFoundation", function() { return __WEBPACK_IMPORTED_MODULE_4__foundation__["a"]; });
  20533. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTopAppBarFoundation", function() { return __WEBPACK_IMPORTED_MODULE_7__standard_foundation__["a"]; });
  20534. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCFixedTopAppBarFoundation", function() { return __WEBPACK_IMPORTED_MODULE_5__fixed_foundation__["a"]; });
  20535. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCShortTopAppBarFoundation", function() { return __WEBPACK_IMPORTED_MODULE_6__short_foundation__["a"]; });
  20536. 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; };
  20537. 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; }; }();
  20538. 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); } };
  20539. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20540. 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; }
  20541. 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; }
  20542. /**
  20543. * @license
  20544. * Copyright 2018 Google Inc.
  20545. *
  20546. * Permission is hereby granted, free of charge, to any person obtaining a copy
  20547. * of this software and associated documentation files (the "Software"), to deal
  20548. * in the Software without restriction, including without limitation the rights
  20549. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  20550. * copies of the Software, and to permit persons to whom the Software is
  20551. * furnished to do so, subject to the following conditions:
  20552. *
  20553. * The above copyright notice and this permission notice shall be included in
  20554. * all copies or substantial portions of the Software.
  20555. *
  20556. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  20557. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  20558. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  20559. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20560. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20561. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  20562. * THE SOFTWARE.
  20563. */
  20564. /**
  20565. * @extends {MDCComponent<!MDCTopAppBarBaseFoundation>}
  20566. * @final
  20567. */
  20568. var MDCTopAppBar = function (_MDCComponent) {
  20569. _inherits(MDCTopAppBar, _MDCComponent);
  20570. /**
  20571. * @param {...?} args
  20572. */
  20573. function MDCTopAppBar() {
  20574. var _ref;
  20575. _classCallCheck(this, MDCTopAppBar);
  20576. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  20577. args[_key] = arguments[_key];
  20578. }
  20579. /** @private {?Element} */
  20580. var _this = _possibleConstructorReturn(this, (_ref = MDCTopAppBar.__proto__ || Object.getPrototypeOf(MDCTopAppBar)).call.apply(_ref, [this].concat(args)));
  20581. _this.navIcon_;
  20582. /** @type {?Array<MDCRipple>} */
  20583. _this.iconRipples_;
  20584. /** @type {Object} */
  20585. _this.scrollTarget_;
  20586. return _this;
  20587. }
  20588. _createClass(MDCTopAppBar, [{
  20589. key: 'initialize',
  20590. value: function initialize() {
  20591. var rippleFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (el) {
  20592. return __WEBPACK_IMPORTED_MODULE_2__material_ripple_index__["MDCRipple"].attachTo(el);
  20593. };
  20594. this.navIcon_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].NAVIGATION_ICON_SELECTOR);
  20595. // Get all icons in the toolbar and instantiate the ripples
  20596. var icons = [].slice.call(this.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].ACTION_ITEM_SELECTOR));
  20597. if (this.navIcon_) {
  20598. icons.push(this.navIcon_);
  20599. }
  20600. this.iconRipples_ = icons.map(function (icon) {
  20601. var ripple = rippleFactory(icon);
  20602. ripple.unbounded = true;
  20603. return ripple;
  20604. });
  20605. }
  20606. }, {
  20607. key: 'destroy',
  20608. value: function destroy() {
  20609. this.iconRipples_.forEach(function (iconRipple) {
  20610. return iconRipple.destroy();
  20611. });
  20612. _get(MDCTopAppBar.prototype.__proto__ || Object.getPrototypeOf(MDCTopAppBar.prototype), 'destroy', this).call(this);
  20613. }
  20614. }, {
  20615. key: 'setScrollTarget',
  20616. value: function setScrollTarget(target) {
  20617. this.foundation_.destroyScrollHandler();
  20618. this.scrollTarget_ = target;
  20619. this.foundation_.initScrollHandler();
  20620. }
  20621. /**
  20622. * @param {!Element} root
  20623. * @return {!MDCTopAppBar}
  20624. */
  20625. }, {
  20626. key: 'getDefaultFoundation',
  20627. /**
  20628. * @return {!MDCTopAppBarBaseFoundation}
  20629. */
  20630. value: function getDefaultFoundation() {
  20631. var _this2 = this;
  20632. /** @type {!MDCTopAppBarAdapter} */
  20633. var adapter = /** @type {!MDCTopAppBarAdapter} */_extends({
  20634. hasClass: function hasClass(className) {
  20635. return _this2.root_.classList.contains(className);
  20636. },
  20637. addClass: function addClass(className) {
  20638. return _this2.root_.classList.add(className);
  20639. },
  20640. removeClass: function removeClass(className) {
  20641. return _this2.root_.classList.remove(className);
  20642. },
  20643. setStyle: function setStyle(property, value) {
  20644. return _this2.root_.style.setProperty(property, value);
  20645. },
  20646. getTopAppBarHeight: function getTopAppBarHeight() {
  20647. return _this2.root_.clientHeight;
  20648. },
  20649. registerNavigationIconInteractionHandler: function registerNavigationIconInteractionHandler(evtType, handler) {
  20650. if (_this2.navIcon_) {
  20651. _this2.navIcon_.addEventListener(evtType, handler);
  20652. }
  20653. },
  20654. deregisterNavigationIconInteractionHandler: function deregisterNavigationIconInteractionHandler(evtType, handler) {
  20655. if (_this2.navIcon_) {
  20656. _this2.navIcon_.removeEventListener(evtType, handler);
  20657. }
  20658. },
  20659. notifyNavigationIconClicked: function notifyNavigationIconClicked() {
  20660. _this2.emit(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].NAVIGATION_EVENT, {});
  20661. },
  20662. registerScrollHandler: function registerScrollHandler(handler) {
  20663. return _this2.scrollTarget_.addEventListener('scroll', handler);
  20664. },
  20665. deregisterScrollHandler: function deregisterScrollHandler(handler) {
  20666. return _this2.scrollTarget_.removeEventListener('scroll', handler);
  20667. },
  20668. registerResizeHandler: function registerResizeHandler(handler) {
  20669. return window.addEventListener('resize', handler);
  20670. },
  20671. deregisterResizeHandler: function deregisterResizeHandler(handler) {
  20672. return window.removeEventListener('resize', handler);
  20673. },
  20674. getViewportScrollY: function getViewportScrollY() {
  20675. return _this2.scrollTarget_[_this2.scrollTarget_ === window ? 'pageYOffset' : 'scrollTop'];
  20676. },
  20677. getTotalActionItems: function getTotalActionItems() {
  20678. return _this2.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].ACTION_ITEM_SELECTOR).length;
  20679. }
  20680. });
  20681. this.scrollTarget_ = window;
  20682. /** @type {!MDCTopAppBarBaseFoundation} */
  20683. var foundation = void 0;
  20684. if (this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].SHORT_CLASS)) {
  20685. foundation = new __WEBPACK_IMPORTED_MODULE_6__short_foundation__["a" /* default */](adapter);
  20686. } else if (this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].FIXED_CLASS)) {
  20687. foundation = new __WEBPACK_IMPORTED_MODULE_5__fixed_foundation__["a" /* default */](adapter);
  20688. } else {
  20689. foundation = new __WEBPACK_IMPORTED_MODULE_7__standard_foundation__["a" /* default */](adapter);
  20690. }
  20691. return foundation;
  20692. }
  20693. }], [{
  20694. key: 'attachTo',
  20695. value: function attachTo(root) {
  20696. return new MDCTopAppBar(root);
  20697. }
  20698. }]);
  20699. return MDCTopAppBar;
  20700. }(__WEBPACK_IMPORTED_MODULE_1__material_base_component__["a" /* default */]);
  20701. /***/ }),
  20702. /* 144 */
  20703. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20704. "use strict";
  20705. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__constants__ = __webpack_require__(8);
  20706. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(7);
  20707. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(12);
  20708. 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; }; }();
  20709. 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); } };
  20710. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20711. 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; }
  20712. 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; }
  20713. /**
  20714. * @license
  20715. * Copyright 2018 Google Inc.
  20716. *
  20717. * Permission is hereby granted, free of charge, to any person obtaining a copy
  20718. * of this software and associated documentation files (the "Software"), to deal
  20719. * in the Software without restriction, including without limitation the rights
  20720. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  20721. * copies of the Software, and to permit persons to whom the Software is
  20722. * furnished to do so, subject to the following conditions:
  20723. *
  20724. * The above copyright notice and this permission notice shall be included in
  20725. * all copies or substantial portions of the Software.
  20726. *
  20727. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  20728. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  20729. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  20730. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20731. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20732. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  20733. * THE SOFTWARE.
  20734. */
  20735. /**
  20736. * @extends {MDCTopAppBarFoundation<!MDCFixedTopAppBarFoundation>}
  20737. * @final
  20738. */
  20739. var MDCFixedTopAppBarFoundation = function (_MDCTopAppBarFoundati) {
  20740. _inherits(MDCFixedTopAppBarFoundation, _MDCTopAppBarFoundati);
  20741. /**
  20742. * @param {!MDCTopAppBarAdapter} adapter
  20743. */
  20744. function MDCFixedTopAppBarFoundation(adapter) {
  20745. _classCallCheck(this, MDCFixedTopAppBarFoundation);
  20746. /** State variable for the previous scroll iteration top app bar state */
  20747. var _this = _possibleConstructorReturn(this, (MDCFixedTopAppBarFoundation.__proto__ || Object.getPrototypeOf(MDCFixedTopAppBarFoundation)).call(this, adapter));
  20748. _this.wasScrolled_ = false;
  20749. _this.scrollHandler_ = function () {
  20750. return _this.fixedScrollHandler_();
  20751. };
  20752. return _this;
  20753. }
  20754. _createClass(MDCFixedTopAppBarFoundation, [{
  20755. key: 'init',
  20756. value: function init() {
  20757. _get(MDCFixedTopAppBarFoundation.prototype.__proto__ || Object.getPrototypeOf(MDCFixedTopAppBarFoundation.prototype), 'init', this).call(this);
  20758. this.adapter_.registerScrollHandler(this.scrollHandler_);
  20759. }
  20760. }, {
  20761. key: 'destroy',
  20762. value: function destroy() {
  20763. _get(MDCFixedTopAppBarFoundation.prototype.__proto__ || Object.getPrototypeOf(MDCFixedTopAppBarFoundation.prototype), 'destroy', this).call(this);
  20764. this.adapter_.deregisterScrollHandler(this.scrollHandler_);
  20765. }
  20766. /**
  20767. * Scroll handler for applying/removing the modifier class
  20768. * on the fixed top app bar.
  20769. */
  20770. }, {
  20771. key: 'fixedScrollHandler_',
  20772. value: function fixedScrollHandler_() {
  20773. var currentScroll = this.adapter_.getViewportScrollY();
  20774. if (currentScroll <= 0) {
  20775. if (this.wasScrolled_) {
  20776. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].FIXED_SCROLLED_CLASS);
  20777. this.wasScrolled_ = false;
  20778. }
  20779. } else {
  20780. if (!this.wasScrolled_) {
  20781. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].FIXED_SCROLLED_CLASS);
  20782. this.wasScrolled_ = true;
  20783. }
  20784. }
  20785. }
  20786. }]);
  20787. return MDCFixedTopAppBarFoundation;
  20788. }(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]);
  20789. /* harmony default export */ __webpack_exports__["a"] = (MDCFixedTopAppBarFoundation);
  20790. /***/ }),
  20791. /* 145 */
  20792. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20793. "use strict";
  20794. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__adapter__ = __webpack_require__(7);
  20795. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(12);
  20796. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(8);
  20797. 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; }; }();
  20798. 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); } };
  20799. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20800. 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; }
  20801. 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; }
  20802. /**
  20803. * @license
  20804. * Copyright 2018 Google Inc.
  20805. *
  20806. * Permission is hereby granted, free of charge, to any person obtaining a copy
  20807. * of this software and associated documentation files (the "Software"), to deal
  20808. * in the Software without restriction, including without limitation the rights
  20809. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  20810. * copies of the Software, and to permit persons to whom the Software is
  20811. * furnished to do so, subject to the following conditions:
  20812. *
  20813. * The above copyright notice and this permission notice shall be included in
  20814. * all copies or substantial portions of the Software.
  20815. *
  20816. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  20817. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  20818. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  20819. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20820. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20821. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  20822. * THE SOFTWARE.
  20823. */
  20824. /**
  20825. * @extends {MDCTopAppBarBaseFoundation<!MDCShortTopAppBarFoundation>}
  20826. * @final
  20827. */
  20828. var MDCShortTopAppBarFoundation = function (_MDCTopAppBarBaseFoun) {
  20829. _inherits(MDCShortTopAppBarFoundation, _MDCTopAppBarBaseFoun);
  20830. /**
  20831. * @param {!MDCTopAppBarAdapter} adapter
  20832. */
  20833. function MDCShortTopAppBarFoundation(adapter) {
  20834. _classCallCheck(this, MDCShortTopAppBarFoundation);
  20835. // State variable for the current top app bar state
  20836. var _this = _possibleConstructorReturn(this, (MDCShortTopAppBarFoundation.__proto__ || Object.getPrototypeOf(MDCShortTopAppBarFoundation)).call(this, adapter));
  20837. _this.isCollapsed = false;
  20838. _this.scrollHandler_ = function () {
  20839. return _this.shortAppBarScrollHandler_();
  20840. };
  20841. return _this;
  20842. }
  20843. _createClass(MDCShortTopAppBarFoundation, [{
  20844. key: 'init',
  20845. value: function init() {
  20846. _get(MDCShortTopAppBarFoundation.prototype.__proto__ || Object.getPrototypeOf(MDCShortTopAppBarFoundation.prototype), 'init', this).call(this);
  20847. var isAlwaysCollapsed = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SHORT_COLLAPSED_CLASS);
  20848. if (this.adapter_.getTotalActionItems() > 0) {
  20849. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SHORT_HAS_ACTION_ITEM_CLASS);
  20850. }
  20851. if (!isAlwaysCollapsed) {
  20852. this.adapter_.registerScrollHandler(this.scrollHandler_);
  20853. this.shortAppBarScrollHandler_();
  20854. }
  20855. }
  20856. }, {
  20857. key: 'destroy',
  20858. value: function destroy() {
  20859. _get(MDCShortTopAppBarFoundation.prototype.__proto__ || Object.getPrototypeOf(MDCShortTopAppBarFoundation.prototype), 'destroy', this).call(this);
  20860. this.adapter_.deregisterScrollHandler(this.scrollHandler_);
  20861. }
  20862. /**
  20863. * Scroll handler for applying/removing the collapsed modifier class
  20864. * on the short top app bar.
  20865. * @private
  20866. */
  20867. }, {
  20868. key: 'shortAppBarScrollHandler_',
  20869. value: function shortAppBarScrollHandler_() {
  20870. var currentScroll = this.adapter_.getViewportScrollY();
  20871. if (currentScroll <= 0) {
  20872. if (this.isCollapsed) {
  20873. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SHORT_COLLAPSED_CLASS);
  20874. this.isCollapsed = false;
  20875. }
  20876. } else {
  20877. if (!this.isCollapsed) {
  20878. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SHORT_COLLAPSED_CLASS);
  20879. this.isCollapsed = true;
  20880. }
  20881. }
  20882. }
  20883. }]);
  20884. return MDCShortTopAppBarFoundation;
  20885. }(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]);
  20886. /* harmony default export */ __webpack_exports__["a"] = (MDCShortTopAppBarFoundation);
  20887. /***/ }),
  20888. /* 146 */
  20889. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20890. "use strict";
  20891. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__adapter__ = __webpack_require__(7);
  20892. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(12);
  20893. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(8);
  20894. 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; }; }();
  20895. 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); } };
  20896. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20897. 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; }
  20898. 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; }
  20899. /**
  20900. * @license
  20901. * Copyright 2018 Google Inc.
  20902. *
  20903. * Permission is hereby granted, free of charge, to any person obtaining a copy
  20904. * of this software and associated documentation files (the "Software"), to deal
  20905. * in the Software without restriction, including without limitation the rights
  20906. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  20907. * copies of the Software, and to permit persons to whom the Software is
  20908. * furnished to do so, subject to the following conditions:
  20909. *
  20910. * The above copyright notice and this permission notice shall be included in
  20911. * all copies or substantial portions of the Software.
  20912. *
  20913. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  20914. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  20915. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  20916. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20917. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20918. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  20919. * THE SOFTWARE.
  20920. */
  20921. var INITIAL_VALUE = 0;
  20922. /**
  20923. * @extends {MDCTopAppBarBaseFoundation<!MDCTopAppBarFoundation>}
  20924. * @final
  20925. */
  20926. var MDCTopAppBarFoundation = function (_MDCTopAppBarBaseFoun) {
  20927. _inherits(MDCTopAppBarFoundation, _MDCTopAppBarBaseFoun);
  20928. /**
  20929. * @param {!MDCTopAppBarAdapter} adapter
  20930. */
  20931. function MDCTopAppBarFoundation(adapter) {
  20932. _classCallCheck(this, MDCTopAppBarFoundation);
  20933. /**
  20934. * Used for diffs of current scroll position vs previous scroll position
  20935. * @private {number}
  20936. */
  20937. var _this = _possibleConstructorReturn(this, (MDCTopAppBarFoundation.__proto__ || Object.getPrototypeOf(MDCTopAppBarFoundation)).call(this, adapter));
  20938. _this.lastScrollPosition_ = _this.adapter_.getViewportScrollY();
  20939. /**
  20940. * Used to verify when the top app bar is completely showing or completely hidden
  20941. * @private {number}
  20942. */
  20943. _this.topAppBarHeight_ = _this.adapter_.getTopAppBarHeight();
  20944. /**
  20945. * wasDocked_ is used to indicate if the top app bar was docked in the previous
  20946. * scroll handler iteration.
  20947. * @private {boolean}
  20948. */
  20949. _this.wasDocked_ = true;
  20950. /**
  20951. * isDockedShowing_ is used to indicate if the top app bar is docked in the fully
  20952. * shown position.
  20953. * @private {boolean}
  20954. */
  20955. _this.isDockedShowing_ = true;
  20956. /**
  20957. * Variable for current scroll position of the top app bar
  20958. * @private {number}
  20959. */
  20960. _this.currentAppBarOffsetTop_ = 0;
  20961. /**
  20962. * Used to prevent the top app bar from being scrolled out of view during resize events
  20963. * @private {boolean} */
  20964. _this.isCurrentlyBeingResized_ = false;
  20965. /**
  20966. * The timeout that's used to throttle the resize events
  20967. * @private {number}
  20968. */
  20969. _this.resizeThrottleId_ = INITIAL_VALUE;
  20970. /**
  20971. * The timeout that's used to debounce toggling the isCurrentlyBeingResized_ variable after a resize
  20972. * @private {number}
  20973. */
  20974. _this.resizeDebounceId_ = INITIAL_VALUE;
  20975. _this.scrollHandler_ = function () {
  20976. return _this.topAppBarScrollHandler_();
  20977. };
  20978. _this.resizeHandler_ = function () {
  20979. return _this.topAppBarResizeHandler_();
  20980. };
  20981. return _this;
  20982. }
  20983. _createClass(MDCTopAppBarFoundation, [{
  20984. key: 'init',
  20985. value: function init() {
  20986. _get(MDCTopAppBarFoundation.prototype.__proto__ || Object.getPrototypeOf(MDCTopAppBarFoundation.prototype), 'init', this).call(this);
  20987. this.adapter_.registerScrollHandler(this.scrollHandler_);
  20988. this.adapter_.registerResizeHandler(this.resizeHandler_);
  20989. }
  20990. }, {
  20991. key: 'destroy',
  20992. value: function destroy() {
  20993. _get(MDCTopAppBarFoundation.prototype.__proto__ || Object.getPrototypeOf(MDCTopAppBarFoundation.prototype), 'destroy', this).call(this);
  20994. this.adapter_.deregisterScrollHandler(this.scrollHandler_);
  20995. this.adapter_.deregisterResizeHandler(this.resizeHandler_);
  20996. this.adapter_.setStyle('top', '');
  20997. }
  20998. /**
  20999. * Function to determine if the DOM needs to update.
  21000. * @return {boolean}
  21001. * @private
  21002. */
  21003. }, {
  21004. key: 'checkForUpdate_',
  21005. value: function checkForUpdate_() {
  21006. var offscreenBoundaryTop = -this.topAppBarHeight_;
  21007. var hasAnyPixelsOffscreen = this.currentAppBarOffsetTop_ < 0;
  21008. var hasAnyPixelsOnscreen = this.currentAppBarOffsetTop_ > offscreenBoundaryTop;
  21009. var partiallyShowing = hasAnyPixelsOffscreen && hasAnyPixelsOnscreen;
  21010. // If it's partially showing, it can't be docked.
  21011. if (partiallyShowing) {
  21012. this.wasDocked_ = false;
  21013. } else {
  21014. // Not previously docked and not partially showing, it's now docked.
  21015. if (!this.wasDocked_) {
  21016. this.wasDocked_ = true;
  21017. return true;
  21018. } else if (this.isDockedShowing_ !== hasAnyPixelsOnscreen) {
  21019. this.isDockedShowing_ = hasAnyPixelsOnscreen;
  21020. return true;
  21021. }
  21022. }
  21023. return partiallyShowing;
  21024. }
  21025. /**
  21026. * Function to move the top app bar if needed.
  21027. * @private
  21028. */
  21029. }, {
  21030. key: 'moveTopAppBar_',
  21031. value: function moveTopAppBar_() {
  21032. if (this.checkForUpdate_()) {
  21033. // Once the top app bar is fully hidden we use the max potential top app bar height as our offset
  21034. // so the top app bar doesn't show if the window resizes and the new height > the old height.
  21035. var offset = this.currentAppBarOffsetTop_;
  21036. if (Math.abs(offset) >= this.topAppBarHeight_) {
  21037. offset = -__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].MAX_TOP_APP_BAR_HEIGHT;
  21038. }
  21039. this.adapter_.setStyle('top', offset + 'px');
  21040. }
  21041. }
  21042. /**
  21043. * Scroll handler for the default scroll behavior of the top app bar.
  21044. * @private
  21045. */
  21046. }, {
  21047. key: 'topAppBarScrollHandler_',
  21048. value: function topAppBarScrollHandler_() {
  21049. var currentScrollPosition = Math.max(this.adapter_.getViewportScrollY(), 0);
  21050. var diff = currentScrollPosition - this.lastScrollPosition_;
  21051. this.lastScrollPosition_ = currentScrollPosition;
  21052. // If the window is being resized the lastScrollPosition_ needs to be updated but the
  21053. // current scroll of the top app bar should stay in the same position.
  21054. if (!this.isCurrentlyBeingResized_) {
  21055. this.currentAppBarOffsetTop_ -= diff;
  21056. if (this.currentAppBarOffsetTop_ > 0) {
  21057. this.currentAppBarOffsetTop_ = 0;
  21058. } else if (Math.abs(this.currentAppBarOffsetTop_) > this.topAppBarHeight_) {
  21059. this.currentAppBarOffsetTop_ = -this.topAppBarHeight_;
  21060. }
  21061. this.moveTopAppBar_();
  21062. }
  21063. }
  21064. /**
  21065. * Top app bar resize handler that throttle/debounce functions that execute updates.
  21066. * @private
  21067. */
  21068. }, {
  21069. key: 'topAppBarResizeHandler_',
  21070. value: function topAppBarResizeHandler_() {
  21071. var _this2 = this;
  21072. // Throttle resize events 10 p/s
  21073. if (!this.resizeThrottleId_) {
  21074. this.resizeThrottleId_ = setTimeout(function () {
  21075. _this2.resizeThrottleId_ = INITIAL_VALUE;
  21076. _this2.throttledResizeHandler_();
  21077. }, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].DEBOUNCE_THROTTLE_RESIZE_TIME_MS);
  21078. }
  21079. this.isCurrentlyBeingResized_ = true;
  21080. if (this.resizeDebounceId_) {
  21081. clearTimeout(this.resizeDebounceId_);
  21082. }
  21083. this.resizeDebounceId_ = setTimeout(function () {
  21084. _this2.topAppBarScrollHandler_();
  21085. _this2.isCurrentlyBeingResized_ = false;
  21086. _this2.resizeDebounceId_ = INITIAL_VALUE;
  21087. }, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].DEBOUNCE_THROTTLE_RESIZE_TIME_MS);
  21088. }
  21089. /**
  21090. * Throttled function that updates the top app bar scrolled values if the
  21091. * top app bar height changes.
  21092. * @private
  21093. */
  21094. }, {
  21095. key: 'throttledResizeHandler_',
  21096. value: function throttledResizeHandler_() {
  21097. var currentHeight = this.adapter_.getTopAppBarHeight();
  21098. if (this.topAppBarHeight_ !== currentHeight) {
  21099. this.wasDocked_ = false;
  21100. // Since the top app bar has a different height depending on the screen width, this
  21101. // will ensure that the top app bar remains in the correct location if
  21102. // completely hidden and a resize makes the top app bar a different height.
  21103. this.currentAppBarOffsetTop_ -= this.topAppBarHeight_ - currentHeight;
  21104. this.topAppBarHeight_ = currentHeight;
  21105. }
  21106. this.topAppBarScrollHandler_();
  21107. }
  21108. }]);
  21109. return MDCTopAppBarFoundation;
  21110. }(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]);
  21111. /* harmony default export */ __webpack_exports__["a"] = (MDCTopAppBarFoundation);
  21112. /***/ })
  21113. /******/ ]);
  21114. });
  21115. //# sourceMappingURL=material-components-web.js.map