material-components-web.js 707 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531
  1. /**
  2. * @license
  3. * Copyright Google LLC All Rights Reserved.
  4. *
  5. * Use of this source code is governed by an MIT-style license that can be
  6. * found in the LICENSE file at https://github.com/material-components/material-components-web/blob/master/LICENSE
  7. */
  8. (function webpackUniversalModuleDefinition(root, factory) {
  9. if (typeof exports === "object" && typeof module === "object") module.exports = factory(); else if (typeof define === "function" && define.amd) define([], factory); else if (typeof exports === "object") exports["mdc"] = factory(); else root["mdc"] = factory();
  10. })(this, function() {
  11. return function(modules) {
  12. var installedModules = {};
  13. function __webpack_require__(moduleId) {
  14. if (installedModules[moduleId]) {
  15. return installedModules[moduleId].exports;
  16. }
  17. var module = installedModules[moduleId] = {
  18. i: moduleId,
  19. l: false,
  20. exports: {}
  21. };
  22. modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  23. module.l = true;
  24. return module.exports;
  25. }
  26. __webpack_require__.m = modules;
  27. __webpack_require__.c = installedModules;
  28. __webpack_require__.d = function(exports, name, getter) {
  29. if (!__webpack_require__.o(exports, name)) {
  30. Object.defineProperty(exports, name, {
  31. configurable: false,
  32. enumerable: true,
  33. get: getter
  34. });
  35. }
  36. };
  37. __webpack_require__.n = function(module) {
  38. var getter = module && module.__esModule ? function getDefault() {
  39. return module["default"];
  40. } : function getModuleExports() {
  41. return module;
  42. };
  43. __webpack_require__.d(getter, "a", getter);
  44. return getter;
  45. };
  46. __webpack_require__.o = function(object, property) {
  47. return Object.prototype.hasOwnProperty.call(object, property);
  48. };
  49. __webpack_require__.p = "";
  50. return __webpack_require__(__webpack_require__.s = 78);
  51. }([ function(module, exports, __webpack_require__) {
  52. "use strict";
  53. Object.defineProperty(exports, "__esModule", {
  54. value: true
  55. });
  56. var MDCFoundation = function() {
  57. function MDCFoundation(adapter) {
  58. if (adapter === void 0) {
  59. adapter = {};
  60. }
  61. this.adapter_ = adapter;
  62. }
  63. Object.defineProperty(MDCFoundation, "cssClasses", {
  64. get: function get() {
  65. return {};
  66. },
  67. enumerable: true,
  68. configurable: true
  69. });
  70. Object.defineProperty(MDCFoundation, "strings", {
  71. get: function get() {
  72. return {};
  73. },
  74. enumerable: true,
  75. configurable: true
  76. });
  77. Object.defineProperty(MDCFoundation, "numbers", {
  78. get: function get() {
  79. return {};
  80. },
  81. enumerable: true,
  82. configurable: true
  83. });
  84. Object.defineProperty(MDCFoundation, "defaultAdapter", {
  85. get: function get() {
  86. return {};
  87. },
  88. enumerable: true,
  89. configurable: true
  90. });
  91. MDCFoundation.prototype.init = function() {};
  92. MDCFoundation.prototype.destroy = function() {};
  93. return MDCFoundation;
  94. }();
  95. exports.MDCFoundation = MDCFoundation;
  96. exports.default = MDCFoundation;
  97. }, function(module, exports, __webpack_require__) {
  98. "use strict";
  99. var __read = this && this.__read || function(o, n) {
  100. var m = typeof Symbol === "function" && o[Symbol.iterator];
  101. if (!m) return o;
  102. var i = m.call(o), r, ar = [], e;
  103. try {
  104. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
  105. ar.push(r.value);
  106. }
  107. } catch (error) {
  108. e = {
  109. error: error
  110. };
  111. } finally {
  112. try {
  113. if (r && !r.done && (m = i["return"])) m.call(i);
  114. } finally {
  115. if (e) throw e.error;
  116. }
  117. }
  118. return ar;
  119. };
  120. var __spread = this && this.__spread || function() {
  121. for (var ar = [], i = 0; i < arguments.length; i++) {
  122. ar = ar.concat(__read(arguments[i]));
  123. }
  124. return ar;
  125. };
  126. Object.defineProperty(exports, "__esModule", {
  127. value: true
  128. });
  129. var foundation_1 = __webpack_require__(0);
  130. var MDCComponent = function() {
  131. function MDCComponent(root, foundation) {
  132. var args = [];
  133. for (var _i = 2; _i < arguments.length; _i++) {
  134. args[_i - 2] = arguments[_i];
  135. }
  136. this.root_ = root;
  137. this.initialize.apply(this, __spread(args));
  138. this.foundation_ = foundation === undefined ? this.getDefaultFoundation() : foundation;
  139. this.foundation_.init();
  140. this.initialSyncWithDOM();
  141. }
  142. MDCComponent.attachTo = function(root) {
  143. return new MDCComponent(root, new foundation_1.MDCFoundation({}));
  144. };
  145. MDCComponent.prototype.initialize = function() {
  146. var _args = [];
  147. for (var _i = 0; _i < arguments.length; _i++) {
  148. _args[_i] = arguments[_i];
  149. }
  150. };
  151. MDCComponent.prototype.getDefaultFoundation = function() {
  152. throw new Error("Subclasses must override getDefaultFoundation to return a properly configured " + "foundation class");
  153. };
  154. MDCComponent.prototype.initialSyncWithDOM = function() {};
  155. MDCComponent.prototype.destroy = function() {
  156. this.foundation_.destroy();
  157. };
  158. MDCComponent.prototype.listen = function(evtType, handler) {
  159. this.root_.addEventListener(evtType, handler);
  160. };
  161. MDCComponent.prototype.unlisten = function(evtType, handler) {
  162. this.root_.removeEventListener(evtType, handler);
  163. };
  164. MDCComponent.prototype.emit = function(evtType, evtData, shouldBubble) {
  165. if (shouldBubble === void 0) {
  166. shouldBubble = false;
  167. }
  168. var evt;
  169. if (typeof CustomEvent === "function") {
  170. evt = new CustomEvent(evtType, {
  171. bubbles: shouldBubble,
  172. detail: evtData
  173. });
  174. } else {
  175. evt = document.createEvent("CustomEvent");
  176. evt.initCustomEvent(evtType, shouldBubble, false, evtData);
  177. }
  178. this.root_.dispatchEvent(evt);
  179. };
  180. return MDCComponent;
  181. }();
  182. exports.MDCComponent = MDCComponent;
  183. exports.default = MDCComponent;
  184. }, function(module, exports, __webpack_require__) {
  185. "use strict";
  186. var __extends = this && this.__extends || function() {
  187. var _extendStatics = function extendStatics(d, b) {
  188. _extendStatics = Object.setPrototypeOf || {
  189. __proto__: []
  190. } instanceof Array && function(d, b) {
  191. d.__proto__ = b;
  192. } || function(d, b) {
  193. for (var p in b) {
  194. if (b.hasOwnProperty(p)) d[p] = b[p];
  195. }
  196. };
  197. return _extendStatics(d, b);
  198. };
  199. return function(d, b) {
  200. _extendStatics(d, b);
  201. function __() {
  202. this.constructor = d;
  203. }
  204. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  205. };
  206. }();
  207. var __importStar = this && this.__importStar || function(mod) {
  208. if (mod && mod.__esModule) return mod;
  209. var result = {};
  210. if (mod != null) for (var k in mod) {
  211. if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  212. }
  213. result["default"] = mod;
  214. return result;
  215. };
  216. Object.defineProperty(exports, "__esModule", {
  217. value: true
  218. });
  219. var component_1 = __webpack_require__(1);
  220. var ponyfill_1 = __webpack_require__(3);
  221. var foundation_1 = __webpack_require__(4);
  222. var util = __importStar(__webpack_require__(11));
  223. var MDCRipple = function(_super) {
  224. __extends(MDCRipple, _super);
  225. function MDCRipple() {
  226. var _this = _super !== null && _super.apply(this, arguments) || this;
  227. _this.disabled = false;
  228. return _this;
  229. }
  230. MDCRipple.attachTo = function(root, opts) {
  231. if (opts === void 0) {
  232. opts = {
  233. isUnbounded: undefined
  234. };
  235. }
  236. var ripple = new MDCRipple(root);
  237. if (opts.isUnbounded !== undefined) {
  238. ripple.unbounded = opts.isUnbounded;
  239. }
  240. return ripple;
  241. };
  242. MDCRipple.createAdapter = function(instance) {
  243. return {
  244. addClass: function addClass(className) {
  245. return instance.root_.classList.add(className);
  246. },
  247. browserSupportsCssVars: function browserSupportsCssVars() {
  248. return util.supportsCssVariables(window);
  249. },
  250. computeBoundingRect: function computeBoundingRect() {
  251. return instance.root_.getBoundingClientRect();
  252. },
  253. containsEventTarget: function containsEventTarget(target) {
  254. return instance.root_.contains(target);
  255. },
  256. deregisterDocumentInteractionHandler: function deregisterDocumentInteractionHandler(evtType, handler) {
  257. return document.documentElement.removeEventListener(evtType, handler, util.applyPassive());
  258. },
  259. deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) {
  260. return instance.root_.removeEventListener(evtType, handler, util.applyPassive());
  261. },
  262. deregisterResizeHandler: function deregisterResizeHandler(handler) {
  263. return window.removeEventListener("resize", handler);
  264. },
  265. getWindowPageOffset: function getWindowPageOffset() {
  266. return {
  267. x: window.pageXOffset,
  268. y: window.pageYOffset
  269. };
  270. },
  271. isSurfaceActive: function isSurfaceActive() {
  272. return ponyfill_1.matches(instance.root_, ":active");
  273. },
  274. isSurfaceDisabled: function isSurfaceDisabled() {
  275. return Boolean(instance.disabled);
  276. },
  277. isUnbounded: function isUnbounded() {
  278. return Boolean(instance.unbounded);
  279. },
  280. registerDocumentInteractionHandler: function registerDocumentInteractionHandler(evtType, handler) {
  281. return document.documentElement.addEventListener(evtType, handler, util.applyPassive());
  282. },
  283. registerInteractionHandler: function registerInteractionHandler(evtType, handler) {
  284. return instance.root_.addEventListener(evtType, handler, util.applyPassive());
  285. },
  286. registerResizeHandler: function registerResizeHandler(handler) {
  287. return window.addEventListener("resize", handler);
  288. },
  289. removeClass: function removeClass(className) {
  290. return instance.root_.classList.remove(className);
  291. },
  292. updateCssVariable: function updateCssVariable(varName, value) {
  293. return instance.root_.style.setProperty(varName, value);
  294. }
  295. };
  296. };
  297. Object.defineProperty(MDCRipple.prototype, "unbounded", {
  298. get: function get() {
  299. return Boolean(this.unbounded_);
  300. },
  301. set: function set(unbounded) {
  302. this.unbounded_ = Boolean(unbounded);
  303. this.setUnbounded_();
  304. },
  305. enumerable: true,
  306. configurable: true
  307. });
  308. MDCRipple.prototype.activate = function() {
  309. this.foundation_.activate();
  310. };
  311. MDCRipple.prototype.deactivate = function() {
  312. this.foundation_.deactivate();
  313. };
  314. MDCRipple.prototype.layout = function() {
  315. this.foundation_.layout();
  316. };
  317. MDCRipple.prototype.getDefaultFoundation = function() {
  318. return new foundation_1.MDCRippleFoundation(MDCRipple.createAdapter(this));
  319. };
  320. MDCRipple.prototype.initialSyncWithDOM = function() {
  321. var root = this.root_;
  322. this.unbounded = "mdcRippleIsUnbounded" in root.dataset;
  323. };
  324. MDCRipple.prototype.setUnbounded_ = function() {
  325. this.foundation_.setUnbounded(Boolean(this.unbounded_));
  326. };
  327. return MDCRipple;
  328. }(component_1.MDCComponent);
  329. exports.MDCRipple = MDCRipple;
  330. }, function(module, exports, __webpack_require__) {
  331. "use strict";
  332. Object.defineProperty(exports, "__esModule", {
  333. value: true
  334. });
  335. function closest(element, selector) {
  336. if (element.closest) {
  337. return element.closest(selector);
  338. }
  339. var el = element;
  340. while (el) {
  341. if (matches(el, selector)) {
  342. return el;
  343. }
  344. el = el.parentElement;
  345. }
  346. return null;
  347. }
  348. exports.closest = closest;
  349. function matches(element, selector) {
  350. var nativeMatches = element.matches || element.webkitMatchesSelector || element.msMatchesSelector;
  351. return nativeMatches.call(element, selector);
  352. }
  353. exports.matches = matches;
  354. }, function(module, exports, __webpack_require__) {
  355. "use strict";
  356. var __extends = this && this.__extends || function() {
  357. var _extendStatics = function extendStatics(d, b) {
  358. _extendStatics = Object.setPrototypeOf || {
  359. __proto__: []
  360. } instanceof Array && function(d, b) {
  361. d.__proto__ = b;
  362. } || function(d, b) {
  363. for (var p in b) {
  364. if (b.hasOwnProperty(p)) d[p] = b[p];
  365. }
  366. };
  367. return _extendStatics(d, b);
  368. };
  369. return function(d, b) {
  370. _extendStatics(d, b);
  371. function __() {
  372. this.constructor = d;
  373. }
  374. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  375. };
  376. }();
  377. var __assign = this && this.__assign || function() {
  378. __assign = Object.assign || function(t) {
  379. for (var s, i = 1, n = arguments.length; i < n; i++) {
  380. s = arguments[i];
  381. for (var p in s) {
  382. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  383. }
  384. }
  385. return t;
  386. };
  387. return __assign.apply(this, arguments);
  388. };
  389. Object.defineProperty(exports, "__esModule", {
  390. value: true
  391. });
  392. var foundation_1 = __webpack_require__(0);
  393. var constants_1 = __webpack_require__(83);
  394. var util_1 = __webpack_require__(11);
  395. var ACTIVATION_EVENT_TYPES = [ "touchstart", "pointerdown", "mousedown", "keydown" ];
  396. var POINTER_DEACTIVATION_EVENT_TYPES = [ "touchend", "pointerup", "mouseup", "contextmenu" ];
  397. var activatedTargets = [];
  398. var MDCRippleFoundation = function(_super) {
  399. __extends(MDCRippleFoundation, _super);
  400. function MDCRippleFoundation(adapter) {
  401. var _this = _super.call(this, __assign({}, MDCRippleFoundation.defaultAdapter, adapter)) || this;
  402. _this.activationAnimationHasEnded_ = false;
  403. _this.activationTimer_ = 0;
  404. _this.fgDeactivationRemovalTimer_ = 0;
  405. _this.fgScale_ = "0";
  406. _this.frame_ = {
  407. width: 0,
  408. height: 0
  409. };
  410. _this.initialSize_ = 0;
  411. _this.layoutFrame_ = 0;
  412. _this.maxRadius_ = 0;
  413. _this.unboundedCoords_ = {
  414. left: 0,
  415. top: 0
  416. };
  417. _this.activationState_ = _this.defaultActivationState_();
  418. _this.activationTimerCallback_ = function() {
  419. _this.activationAnimationHasEnded_ = true;
  420. _this.runDeactivationUXLogicIfReady_();
  421. };
  422. _this.activateHandler_ = function(e) {
  423. return _this.activate_(e);
  424. };
  425. _this.deactivateHandler_ = function() {
  426. return _this.deactivate_();
  427. };
  428. _this.focusHandler_ = function() {
  429. return _this.handleFocus();
  430. };
  431. _this.blurHandler_ = function() {
  432. return _this.handleBlur();
  433. };
  434. _this.resizeHandler_ = function() {
  435. return _this.layout();
  436. };
  437. return _this;
  438. }
  439. Object.defineProperty(MDCRippleFoundation, "cssClasses", {
  440. get: function get() {
  441. return constants_1.cssClasses;
  442. },
  443. enumerable: true,
  444. configurable: true
  445. });
  446. Object.defineProperty(MDCRippleFoundation, "strings", {
  447. get: function get() {
  448. return constants_1.strings;
  449. },
  450. enumerable: true,
  451. configurable: true
  452. });
  453. Object.defineProperty(MDCRippleFoundation, "numbers", {
  454. get: function get() {
  455. return constants_1.numbers;
  456. },
  457. enumerable: true,
  458. configurable: true
  459. });
  460. Object.defineProperty(MDCRippleFoundation, "defaultAdapter", {
  461. get: function get() {
  462. return {
  463. addClass: function addClass() {
  464. return undefined;
  465. },
  466. browserSupportsCssVars: function browserSupportsCssVars() {
  467. return true;
  468. },
  469. computeBoundingRect: function computeBoundingRect() {
  470. return {
  471. top: 0,
  472. right: 0,
  473. bottom: 0,
  474. left: 0,
  475. width: 0,
  476. height: 0
  477. };
  478. },
  479. containsEventTarget: function containsEventTarget() {
  480. return true;
  481. },
  482. deregisterDocumentInteractionHandler: function deregisterDocumentInteractionHandler() {
  483. return undefined;
  484. },
  485. deregisterInteractionHandler: function deregisterInteractionHandler() {
  486. return undefined;
  487. },
  488. deregisterResizeHandler: function deregisterResizeHandler() {
  489. return undefined;
  490. },
  491. getWindowPageOffset: function getWindowPageOffset() {
  492. return {
  493. x: 0,
  494. y: 0
  495. };
  496. },
  497. isSurfaceActive: function isSurfaceActive() {
  498. return true;
  499. },
  500. isSurfaceDisabled: function isSurfaceDisabled() {
  501. return true;
  502. },
  503. isUnbounded: function isUnbounded() {
  504. return true;
  505. },
  506. registerDocumentInteractionHandler: function registerDocumentInteractionHandler() {
  507. return undefined;
  508. },
  509. registerInteractionHandler: function registerInteractionHandler() {
  510. return undefined;
  511. },
  512. registerResizeHandler: function registerResizeHandler() {
  513. return undefined;
  514. },
  515. removeClass: function removeClass() {
  516. return undefined;
  517. },
  518. updateCssVariable: function updateCssVariable() {
  519. return undefined;
  520. }
  521. };
  522. },
  523. enumerable: true,
  524. configurable: true
  525. });
  526. MDCRippleFoundation.prototype.init = function() {
  527. var _this = this;
  528. var supportsPressRipple = this.supportsPressRipple_();
  529. this.registerRootHandlers_(supportsPressRipple);
  530. if (supportsPressRipple) {
  531. var _a = MDCRippleFoundation.cssClasses, ROOT_1 = _a.ROOT, UNBOUNDED_1 = _a.UNBOUNDED;
  532. requestAnimationFrame(function() {
  533. _this.adapter_.addClass(ROOT_1);
  534. if (_this.adapter_.isUnbounded()) {
  535. _this.adapter_.addClass(UNBOUNDED_1);
  536. _this.layoutInternal_();
  537. }
  538. });
  539. }
  540. };
  541. MDCRippleFoundation.prototype.destroy = function() {
  542. var _this = this;
  543. if (this.supportsPressRipple_()) {
  544. if (this.activationTimer_) {
  545. clearTimeout(this.activationTimer_);
  546. this.activationTimer_ = 0;
  547. this.adapter_.removeClass(MDCRippleFoundation.cssClasses.FG_ACTIVATION);
  548. }
  549. if (this.fgDeactivationRemovalTimer_) {
  550. clearTimeout(this.fgDeactivationRemovalTimer_);
  551. this.fgDeactivationRemovalTimer_ = 0;
  552. this.adapter_.removeClass(MDCRippleFoundation.cssClasses.FG_DEACTIVATION);
  553. }
  554. var _a = MDCRippleFoundation.cssClasses, ROOT_2 = _a.ROOT, UNBOUNDED_2 = _a.UNBOUNDED;
  555. requestAnimationFrame(function() {
  556. _this.adapter_.removeClass(ROOT_2);
  557. _this.adapter_.removeClass(UNBOUNDED_2);
  558. _this.removeCssVars_();
  559. });
  560. }
  561. this.deregisterRootHandlers_();
  562. this.deregisterDeactivationHandlers_();
  563. };
  564. MDCRippleFoundation.prototype.activate = function(evt) {
  565. this.activate_(evt);
  566. };
  567. MDCRippleFoundation.prototype.deactivate = function() {
  568. this.deactivate_();
  569. };
  570. MDCRippleFoundation.prototype.layout = function() {
  571. var _this = this;
  572. if (this.layoutFrame_) {
  573. cancelAnimationFrame(this.layoutFrame_);
  574. }
  575. this.layoutFrame_ = requestAnimationFrame(function() {
  576. _this.layoutInternal_();
  577. _this.layoutFrame_ = 0;
  578. });
  579. };
  580. MDCRippleFoundation.prototype.setUnbounded = function(unbounded) {
  581. var UNBOUNDED = MDCRippleFoundation.cssClasses.UNBOUNDED;
  582. if (unbounded) {
  583. this.adapter_.addClass(UNBOUNDED);
  584. } else {
  585. this.adapter_.removeClass(UNBOUNDED);
  586. }
  587. };
  588. MDCRippleFoundation.prototype.handleFocus = function() {
  589. var _this = this;
  590. requestAnimationFrame(function() {
  591. return _this.adapter_.addClass(MDCRippleFoundation.cssClasses.BG_FOCUSED);
  592. });
  593. };
  594. MDCRippleFoundation.prototype.handleBlur = function() {
  595. var _this = this;
  596. requestAnimationFrame(function() {
  597. return _this.adapter_.removeClass(MDCRippleFoundation.cssClasses.BG_FOCUSED);
  598. });
  599. };
  600. MDCRippleFoundation.prototype.supportsPressRipple_ = function() {
  601. return this.adapter_.browserSupportsCssVars();
  602. };
  603. MDCRippleFoundation.prototype.defaultActivationState_ = function() {
  604. return {
  605. activationEvent: undefined,
  606. hasDeactivationUXRun: false,
  607. isActivated: false,
  608. isProgrammatic: false,
  609. wasActivatedByPointer: false,
  610. wasElementMadeActive: false
  611. };
  612. };
  613. MDCRippleFoundation.prototype.registerRootHandlers_ = function(supportsPressRipple) {
  614. var _this = this;
  615. if (supportsPressRipple) {
  616. ACTIVATION_EVENT_TYPES.forEach(function(evtType) {
  617. _this.adapter_.registerInteractionHandler(evtType, _this.activateHandler_);
  618. });
  619. if (this.adapter_.isUnbounded()) {
  620. this.adapter_.registerResizeHandler(this.resizeHandler_);
  621. }
  622. }
  623. this.adapter_.registerInteractionHandler("focus", this.focusHandler_);
  624. this.adapter_.registerInteractionHandler("blur", this.blurHandler_);
  625. };
  626. MDCRippleFoundation.prototype.registerDeactivationHandlers_ = function(evt) {
  627. var _this = this;
  628. if (evt.type === "keydown") {
  629. this.adapter_.registerInteractionHandler("keyup", this.deactivateHandler_);
  630. } else {
  631. POINTER_DEACTIVATION_EVENT_TYPES.forEach(function(evtType) {
  632. _this.adapter_.registerDocumentInteractionHandler(evtType, _this.deactivateHandler_);
  633. });
  634. }
  635. };
  636. MDCRippleFoundation.prototype.deregisterRootHandlers_ = function() {
  637. var _this = this;
  638. ACTIVATION_EVENT_TYPES.forEach(function(evtType) {
  639. _this.adapter_.deregisterInteractionHandler(evtType, _this.activateHandler_);
  640. });
  641. this.adapter_.deregisterInteractionHandler("focus", this.focusHandler_);
  642. this.adapter_.deregisterInteractionHandler("blur", this.blurHandler_);
  643. if (this.adapter_.isUnbounded()) {
  644. this.adapter_.deregisterResizeHandler(this.resizeHandler_);
  645. }
  646. };
  647. MDCRippleFoundation.prototype.deregisterDeactivationHandlers_ = function() {
  648. var _this = this;
  649. this.adapter_.deregisterInteractionHandler("keyup", this.deactivateHandler_);
  650. POINTER_DEACTIVATION_EVENT_TYPES.forEach(function(evtType) {
  651. _this.adapter_.deregisterDocumentInteractionHandler(evtType, _this.deactivateHandler_);
  652. });
  653. };
  654. MDCRippleFoundation.prototype.removeCssVars_ = function() {
  655. var _this = this;
  656. var rippleStrings = MDCRippleFoundation.strings;
  657. var keys = Object.keys(rippleStrings);
  658. keys.forEach(function(key) {
  659. if (key.indexOf("VAR_") === 0) {
  660. _this.adapter_.updateCssVariable(rippleStrings[key], null);
  661. }
  662. });
  663. };
  664. MDCRippleFoundation.prototype.activate_ = function(evt) {
  665. var _this = this;
  666. if (this.adapter_.isSurfaceDisabled()) {
  667. return;
  668. }
  669. var activationState = this.activationState_;
  670. if (activationState.isActivated) {
  671. return;
  672. }
  673. var previousActivationEvent = this.previousActivationEvent_;
  674. var isSameInteraction = previousActivationEvent && evt !== undefined && previousActivationEvent.type !== evt.type;
  675. if (isSameInteraction) {
  676. return;
  677. }
  678. activationState.isActivated = true;
  679. activationState.isProgrammatic = evt === undefined;
  680. activationState.activationEvent = evt;
  681. activationState.wasActivatedByPointer = activationState.isProgrammatic ? false : evt !== undefined && (evt.type === "mousedown" || evt.type === "touchstart" || evt.type === "pointerdown");
  682. var hasActivatedChild = evt !== undefined && activatedTargets.length > 0 && activatedTargets.some(function(target) {
  683. return _this.adapter_.containsEventTarget(target);
  684. });
  685. if (hasActivatedChild) {
  686. this.resetActivationState_();
  687. return;
  688. }
  689. if (evt !== undefined) {
  690. activatedTargets.push(evt.target);
  691. this.registerDeactivationHandlers_(evt);
  692. }
  693. activationState.wasElementMadeActive = this.checkElementMadeActive_(evt);
  694. if (activationState.wasElementMadeActive) {
  695. this.animateActivation_();
  696. }
  697. requestAnimationFrame(function() {
  698. activatedTargets = [];
  699. if (!activationState.wasElementMadeActive && evt !== undefined && (evt.key === " " || evt.keyCode === 32)) {
  700. activationState.wasElementMadeActive = _this.checkElementMadeActive_(evt);
  701. if (activationState.wasElementMadeActive) {
  702. _this.animateActivation_();
  703. }
  704. }
  705. if (!activationState.wasElementMadeActive) {
  706. _this.activationState_ = _this.defaultActivationState_();
  707. }
  708. });
  709. };
  710. MDCRippleFoundation.prototype.checkElementMadeActive_ = function(evt) {
  711. return evt !== undefined && evt.type === "keydown" ? this.adapter_.isSurfaceActive() : true;
  712. };
  713. MDCRippleFoundation.prototype.animateActivation_ = function() {
  714. var _this = this;
  715. var _a = MDCRippleFoundation.strings, VAR_FG_TRANSLATE_START = _a.VAR_FG_TRANSLATE_START, VAR_FG_TRANSLATE_END = _a.VAR_FG_TRANSLATE_END;
  716. var _b = MDCRippleFoundation.cssClasses, FG_DEACTIVATION = _b.FG_DEACTIVATION, FG_ACTIVATION = _b.FG_ACTIVATION;
  717. var DEACTIVATION_TIMEOUT_MS = MDCRippleFoundation.numbers.DEACTIVATION_TIMEOUT_MS;
  718. this.layoutInternal_();
  719. var translateStart = "";
  720. var translateEnd = "";
  721. if (!this.adapter_.isUnbounded()) {
  722. var _c = this.getFgTranslationCoordinates_(), startPoint = _c.startPoint, endPoint = _c.endPoint;
  723. translateStart = startPoint.x + "px, " + startPoint.y + "px";
  724. translateEnd = endPoint.x + "px, " + endPoint.y + "px";
  725. }
  726. this.adapter_.updateCssVariable(VAR_FG_TRANSLATE_START, translateStart);
  727. this.adapter_.updateCssVariable(VAR_FG_TRANSLATE_END, translateEnd);
  728. clearTimeout(this.activationTimer_);
  729. clearTimeout(this.fgDeactivationRemovalTimer_);
  730. this.rmBoundedActivationClasses_();
  731. this.adapter_.removeClass(FG_DEACTIVATION);
  732. this.adapter_.computeBoundingRect();
  733. this.adapter_.addClass(FG_ACTIVATION);
  734. this.activationTimer_ = setTimeout(function() {
  735. return _this.activationTimerCallback_();
  736. }, DEACTIVATION_TIMEOUT_MS);
  737. };
  738. MDCRippleFoundation.prototype.getFgTranslationCoordinates_ = function() {
  739. var _a = this.activationState_, activationEvent = _a.activationEvent, wasActivatedByPointer = _a.wasActivatedByPointer;
  740. var startPoint;
  741. if (wasActivatedByPointer) {
  742. startPoint = util_1.getNormalizedEventCoords(activationEvent, this.adapter_.getWindowPageOffset(), this.adapter_.computeBoundingRect());
  743. } else {
  744. startPoint = {
  745. x: this.frame_.width / 2,
  746. y: this.frame_.height / 2
  747. };
  748. }
  749. startPoint = {
  750. x: startPoint.x - this.initialSize_ / 2,
  751. y: startPoint.y - this.initialSize_ / 2
  752. };
  753. var endPoint = {
  754. x: this.frame_.width / 2 - this.initialSize_ / 2,
  755. y: this.frame_.height / 2 - this.initialSize_ / 2
  756. };
  757. return {
  758. startPoint: startPoint,
  759. endPoint: endPoint
  760. };
  761. };
  762. MDCRippleFoundation.prototype.runDeactivationUXLogicIfReady_ = function() {
  763. var _this = this;
  764. var FG_DEACTIVATION = MDCRippleFoundation.cssClasses.FG_DEACTIVATION;
  765. var _a = this.activationState_, hasDeactivationUXRun = _a.hasDeactivationUXRun, isActivated = _a.isActivated;
  766. var activationHasEnded = hasDeactivationUXRun || !isActivated;
  767. if (activationHasEnded && this.activationAnimationHasEnded_) {
  768. this.rmBoundedActivationClasses_();
  769. this.adapter_.addClass(FG_DEACTIVATION);
  770. this.fgDeactivationRemovalTimer_ = setTimeout(function() {
  771. _this.adapter_.removeClass(FG_DEACTIVATION);
  772. }, constants_1.numbers.FG_DEACTIVATION_MS);
  773. }
  774. };
  775. MDCRippleFoundation.prototype.rmBoundedActivationClasses_ = function() {
  776. var FG_ACTIVATION = MDCRippleFoundation.cssClasses.FG_ACTIVATION;
  777. this.adapter_.removeClass(FG_ACTIVATION);
  778. this.activationAnimationHasEnded_ = false;
  779. this.adapter_.computeBoundingRect();
  780. };
  781. MDCRippleFoundation.prototype.resetActivationState_ = function() {
  782. var _this = this;
  783. this.previousActivationEvent_ = this.activationState_.activationEvent;
  784. this.activationState_ = this.defaultActivationState_();
  785. setTimeout(function() {
  786. return _this.previousActivationEvent_ = undefined;
  787. }, MDCRippleFoundation.numbers.TAP_DELAY_MS);
  788. };
  789. MDCRippleFoundation.prototype.deactivate_ = function() {
  790. var _this = this;
  791. var activationState = this.activationState_;
  792. if (!activationState.isActivated) {
  793. return;
  794. }
  795. var state = __assign({}, activationState);
  796. if (activationState.isProgrammatic) {
  797. requestAnimationFrame(function() {
  798. return _this.animateDeactivation_(state);
  799. });
  800. this.resetActivationState_();
  801. } else {
  802. this.deregisterDeactivationHandlers_();
  803. requestAnimationFrame(function() {
  804. _this.activationState_.hasDeactivationUXRun = true;
  805. _this.animateDeactivation_(state);
  806. _this.resetActivationState_();
  807. });
  808. }
  809. };
  810. MDCRippleFoundation.prototype.animateDeactivation_ = function(_a) {
  811. var wasActivatedByPointer = _a.wasActivatedByPointer, wasElementMadeActive = _a.wasElementMadeActive;
  812. if (wasActivatedByPointer || wasElementMadeActive) {
  813. this.runDeactivationUXLogicIfReady_();
  814. }
  815. };
  816. MDCRippleFoundation.prototype.layoutInternal_ = function() {
  817. var _this = this;
  818. this.frame_ = this.adapter_.computeBoundingRect();
  819. var maxDim = Math.max(this.frame_.height, this.frame_.width);
  820. var getBoundedRadius = function getBoundedRadius() {
  821. var hypotenuse = Math.sqrt(Math.pow(_this.frame_.width, 2) + Math.pow(_this.frame_.height, 2));
  822. return hypotenuse + MDCRippleFoundation.numbers.PADDING;
  823. };
  824. this.maxRadius_ = this.adapter_.isUnbounded() ? maxDim : getBoundedRadius();
  825. this.initialSize_ = Math.floor(maxDim * MDCRippleFoundation.numbers.INITIAL_ORIGIN_SCALE);
  826. this.fgScale_ = "" + this.maxRadius_ / this.initialSize_;
  827. this.updateLayoutCssVars_();
  828. };
  829. MDCRippleFoundation.prototype.updateLayoutCssVars_ = function() {
  830. var _a = MDCRippleFoundation.strings, VAR_FG_SIZE = _a.VAR_FG_SIZE, VAR_LEFT = _a.VAR_LEFT, VAR_TOP = _a.VAR_TOP, VAR_FG_SCALE = _a.VAR_FG_SCALE;
  831. this.adapter_.updateCssVariable(VAR_FG_SIZE, this.initialSize_ + "px");
  832. this.adapter_.updateCssVariable(VAR_FG_SCALE, this.fgScale_);
  833. if (this.adapter_.isUnbounded()) {
  834. this.unboundedCoords_ = {
  835. left: Math.round(this.frame_.width / 2 - this.initialSize_ / 2),
  836. top: Math.round(this.frame_.height / 2 - this.initialSize_ / 2)
  837. };
  838. this.adapter_.updateCssVariable(VAR_LEFT, this.unboundedCoords_.left + "px");
  839. this.adapter_.updateCssVariable(VAR_TOP, this.unboundedCoords_.top + "px");
  840. }
  841. };
  842. return MDCRippleFoundation;
  843. }(foundation_1.MDCFoundation);
  844. exports.MDCRippleFoundation = MDCRippleFoundation;
  845. exports.default = MDCRippleFoundation;
  846. }, function(module, exports, __webpack_require__) {
  847. "use strict";
  848. var __extends = this && this.__extends || function() {
  849. var _extendStatics = function extendStatics(d, b) {
  850. _extendStatics = Object.setPrototypeOf || {
  851. __proto__: []
  852. } instanceof Array && function(d, b) {
  853. d.__proto__ = b;
  854. } || function(d, b) {
  855. for (var p in b) {
  856. if (b.hasOwnProperty(p)) d[p] = b[p];
  857. }
  858. };
  859. return _extendStatics(d, b);
  860. };
  861. return function(d, b) {
  862. _extendStatics(d, b);
  863. function __() {
  864. this.constructor = d;
  865. }
  866. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  867. };
  868. }();
  869. var __assign = this && this.__assign || function() {
  870. __assign = Object.assign || function(t) {
  871. for (var s, i = 1, n = arguments.length; i < n; i++) {
  872. s = arguments[i];
  873. for (var p in s) {
  874. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  875. }
  876. }
  877. return t;
  878. };
  879. return __assign.apply(this, arguments);
  880. };
  881. Object.defineProperty(exports, "__esModule", {
  882. value: true
  883. });
  884. var foundation_1 = __webpack_require__(0);
  885. var constants_1 = __webpack_require__(35);
  886. var ELEMENTS_KEY_ALLOWED_IN = [ "input", "button", "textarea", "select" ];
  887. function isNumberArray(selectedIndex) {
  888. return selectedIndex instanceof Array;
  889. }
  890. var MDCListFoundation = function(_super) {
  891. __extends(MDCListFoundation, _super);
  892. function MDCListFoundation(adapter) {
  893. var _this = _super.call(this, __assign({}, MDCListFoundation.defaultAdapter, adapter)) || this;
  894. _this.wrapFocus_ = false;
  895. _this.isVertical_ = true;
  896. _this.isSingleSelectionList_ = false;
  897. _this.selectedIndex_ = constants_1.numbers.UNSET_INDEX;
  898. _this.focusedItemIndex_ = constants_1.numbers.UNSET_INDEX;
  899. _this.useActivatedClass_ = false;
  900. _this.ariaCurrentAttrValue_ = null;
  901. _this.isCheckboxList_ = false;
  902. _this.isRadioList_ = false;
  903. return _this;
  904. }
  905. Object.defineProperty(MDCListFoundation, "strings", {
  906. get: function get() {
  907. return constants_1.strings;
  908. },
  909. enumerable: true,
  910. configurable: true
  911. });
  912. Object.defineProperty(MDCListFoundation, "cssClasses", {
  913. get: function get() {
  914. return constants_1.cssClasses;
  915. },
  916. enumerable: true,
  917. configurable: true
  918. });
  919. Object.defineProperty(MDCListFoundation, "numbers", {
  920. get: function get() {
  921. return constants_1.numbers;
  922. },
  923. enumerable: true,
  924. configurable: true
  925. });
  926. Object.defineProperty(MDCListFoundation, "defaultAdapter", {
  927. get: function get() {
  928. return {
  929. addClassForElementIndex: function addClassForElementIndex() {
  930. return undefined;
  931. },
  932. focusItemAtIndex: function focusItemAtIndex() {
  933. return undefined;
  934. },
  935. getAttributeForElementIndex: function getAttributeForElementIndex() {
  936. return null;
  937. },
  938. getFocusedElementIndex: function getFocusedElementIndex() {
  939. return 0;
  940. },
  941. getListItemCount: function getListItemCount() {
  942. return 0;
  943. },
  944. hasCheckboxAtIndex: function hasCheckboxAtIndex() {
  945. return false;
  946. },
  947. hasRadioAtIndex: function hasRadioAtIndex() {
  948. return false;
  949. },
  950. isCheckboxCheckedAtIndex: function isCheckboxCheckedAtIndex() {
  951. return false;
  952. },
  953. isFocusInsideList: function isFocusInsideList() {
  954. return false;
  955. },
  956. isRootFocused: function isRootFocused() {
  957. return false;
  958. },
  959. notifyAction: function notifyAction() {
  960. return undefined;
  961. },
  962. removeClassForElementIndex: function removeClassForElementIndex() {
  963. return undefined;
  964. },
  965. setAttributeForElementIndex: function setAttributeForElementIndex() {
  966. return undefined;
  967. },
  968. setCheckedCheckboxOrRadioAtIndex: function setCheckedCheckboxOrRadioAtIndex() {
  969. return undefined;
  970. },
  971. setTabIndexForListItemChildren: function setTabIndexForListItemChildren() {
  972. return undefined;
  973. }
  974. };
  975. },
  976. enumerable: true,
  977. configurable: true
  978. });
  979. MDCListFoundation.prototype.layout = function() {
  980. if (this.adapter_.getListItemCount() === 0) {
  981. return;
  982. }
  983. if (this.adapter_.hasCheckboxAtIndex(0)) {
  984. this.isCheckboxList_ = true;
  985. } else if (this.adapter_.hasRadioAtIndex(0)) {
  986. this.isRadioList_ = true;
  987. }
  988. };
  989. MDCListFoundation.prototype.setWrapFocus = function(value) {
  990. this.wrapFocus_ = value;
  991. };
  992. MDCListFoundation.prototype.setVerticalOrientation = function(value) {
  993. this.isVertical_ = value;
  994. };
  995. MDCListFoundation.prototype.setSingleSelection = function(value) {
  996. this.isSingleSelectionList_ = value;
  997. };
  998. MDCListFoundation.prototype.setUseActivatedClass = function(useActivated) {
  999. this.useActivatedClass_ = useActivated;
  1000. };
  1001. MDCListFoundation.prototype.getSelectedIndex = function() {
  1002. return this.selectedIndex_;
  1003. };
  1004. MDCListFoundation.prototype.setSelectedIndex = function(index) {
  1005. if (!this.isIndexValid_(index)) {
  1006. return;
  1007. }
  1008. if (this.isCheckboxList_) {
  1009. this.setCheckboxAtIndex_(index);
  1010. } else if (this.isRadioList_) {
  1011. this.setRadioAtIndex_(index);
  1012. } else {
  1013. this.setSingleSelectionAtIndex_(index);
  1014. }
  1015. };
  1016. MDCListFoundation.prototype.handleFocusIn = function(_, listItemIndex) {
  1017. if (listItemIndex >= 0) {
  1018. this.adapter_.setTabIndexForListItemChildren(listItemIndex, "0");
  1019. }
  1020. };
  1021. MDCListFoundation.prototype.handleFocusOut = function(_, listItemIndex) {
  1022. var _this = this;
  1023. if (listItemIndex >= 0) {
  1024. this.adapter_.setTabIndexForListItemChildren(listItemIndex, "-1");
  1025. }
  1026. setTimeout(function() {
  1027. if (!_this.adapter_.isFocusInsideList()) {
  1028. _this.setTabindexToFirstSelectedItem_();
  1029. }
  1030. }, 0);
  1031. };
  1032. MDCListFoundation.prototype.handleKeydown = function(evt, isRootListItem, listItemIndex) {
  1033. var isArrowLeft = evt.key === "ArrowLeft" || evt.keyCode === 37;
  1034. var isArrowUp = evt.key === "ArrowUp" || evt.keyCode === 38;
  1035. var isArrowRight = evt.key === "ArrowRight" || evt.keyCode === 39;
  1036. var isArrowDown = evt.key === "ArrowDown" || evt.keyCode === 40;
  1037. var isHome = evt.key === "Home" || evt.keyCode === 36;
  1038. var isEnd = evt.key === "End" || evt.keyCode === 35;
  1039. var isEnter = evt.key === "Enter" || evt.keyCode === 13;
  1040. var isSpace = evt.key === "Space" || evt.keyCode === 32;
  1041. if (this.adapter_.isRootFocused()) {
  1042. if (isArrowUp || isEnd) {
  1043. evt.preventDefault();
  1044. this.focusLastElement();
  1045. } else if (isArrowDown || isHome) {
  1046. evt.preventDefault();
  1047. this.focusFirstElement();
  1048. }
  1049. return;
  1050. }
  1051. var currentIndex = this.adapter_.getFocusedElementIndex();
  1052. if (currentIndex === -1) {
  1053. currentIndex = listItemIndex;
  1054. if (currentIndex < 0) {
  1055. return;
  1056. }
  1057. }
  1058. var nextIndex;
  1059. if (this.isVertical_ && isArrowDown || !this.isVertical_ && isArrowRight) {
  1060. this.preventDefaultEvent_(evt);
  1061. nextIndex = this.focusNextElement(currentIndex);
  1062. } else if (this.isVertical_ && isArrowUp || !this.isVertical_ && isArrowLeft) {
  1063. this.preventDefaultEvent_(evt);
  1064. nextIndex = this.focusPrevElement(currentIndex);
  1065. } else if (isHome) {
  1066. this.preventDefaultEvent_(evt);
  1067. nextIndex = this.focusFirstElement();
  1068. } else if (isEnd) {
  1069. this.preventDefaultEvent_(evt);
  1070. nextIndex = this.focusLastElement();
  1071. } else if (isEnter || isSpace) {
  1072. if (isRootListItem) {
  1073. var target = evt.target;
  1074. if (target && target.tagName === "A" && isEnter) {
  1075. return;
  1076. }
  1077. this.preventDefaultEvent_(evt);
  1078. if (this.isSelectableList_()) {
  1079. this.setSelectedIndexOnAction_(currentIndex);
  1080. }
  1081. this.adapter_.notifyAction(currentIndex);
  1082. }
  1083. }
  1084. this.focusedItemIndex_ = currentIndex;
  1085. if (nextIndex !== undefined) {
  1086. this.setTabindexAtIndex_(nextIndex);
  1087. this.focusedItemIndex_ = nextIndex;
  1088. }
  1089. };
  1090. MDCListFoundation.prototype.handleClick = function(index, toggleCheckbox) {
  1091. if (index === constants_1.numbers.UNSET_INDEX) {
  1092. return;
  1093. }
  1094. if (this.isSelectableList_()) {
  1095. this.setSelectedIndexOnAction_(index, toggleCheckbox);
  1096. }
  1097. this.adapter_.notifyAction(index);
  1098. this.setTabindexAtIndex_(index);
  1099. this.focusedItemIndex_ = index;
  1100. };
  1101. MDCListFoundation.prototype.focusNextElement = function(index) {
  1102. var count = this.adapter_.getListItemCount();
  1103. var nextIndex = index + 1;
  1104. if (nextIndex >= count) {
  1105. if (this.wrapFocus_) {
  1106. nextIndex = 0;
  1107. } else {
  1108. return index;
  1109. }
  1110. }
  1111. this.adapter_.focusItemAtIndex(nextIndex);
  1112. return nextIndex;
  1113. };
  1114. MDCListFoundation.prototype.focusPrevElement = function(index) {
  1115. var prevIndex = index - 1;
  1116. if (prevIndex < 0) {
  1117. if (this.wrapFocus_) {
  1118. prevIndex = this.adapter_.getListItemCount() - 1;
  1119. } else {
  1120. return index;
  1121. }
  1122. }
  1123. this.adapter_.focusItemAtIndex(prevIndex);
  1124. return prevIndex;
  1125. };
  1126. MDCListFoundation.prototype.focusFirstElement = function() {
  1127. this.adapter_.focusItemAtIndex(0);
  1128. return 0;
  1129. };
  1130. MDCListFoundation.prototype.focusLastElement = function() {
  1131. var lastIndex = this.adapter_.getListItemCount() - 1;
  1132. this.adapter_.focusItemAtIndex(lastIndex);
  1133. return lastIndex;
  1134. };
  1135. MDCListFoundation.prototype.preventDefaultEvent_ = function(evt) {
  1136. var target = evt.target;
  1137. var tagName = ("" + target.tagName).toLowerCase();
  1138. if (ELEMENTS_KEY_ALLOWED_IN.indexOf(tagName) === -1) {
  1139. evt.preventDefault();
  1140. }
  1141. };
  1142. MDCListFoundation.prototype.setSingleSelectionAtIndex_ = function(index) {
  1143. if (this.selectedIndex_ === index) {
  1144. return;
  1145. }
  1146. var selectedClassName = constants_1.cssClasses.LIST_ITEM_SELECTED_CLASS;
  1147. if (this.useActivatedClass_) {
  1148. selectedClassName = constants_1.cssClasses.LIST_ITEM_ACTIVATED_CLASS;
  1149. }
  1150. if (this.selectedIndex_ !== constants_1.numbers.UNSET_INDEX) {
  1151. this.adapter_.removeClassForElementIndex(this.selectedIndex_, selectedClassName);
  1152. }
  1153. this.adapter_.addClassForElementIndex(index, selectedClassName);
  1154. this.setAriaForSingleSelectionAtIndex_(index);
  1155. this.selectedIndex_ = index;
  1156. };
  1157. MDCListFoundation.prototype.setAriaForSingleSelectionAtIndex_ = function(index) {
  1158. if (this.selectedIndex_ === constants_1.numbers.UNSET_INDEX) {
  1159. this.ariaCurrentAttrValue_ = this.adapter_.getAttributeForElementIndex(index, constants_1.strings.ARIA_CURRENT);
  1160. }
  1161. var isAriaCurrent = this.ariaCurrentAttrValue_ !== null;
  1162. var ariaAttribute = isAriaCurrent ? constants_1.strings.ARIA_CURRENT : constants_1.strings.ARIA_SELECTED;
  1163. if (this.selectedIndex_ !== constants_1.numbers.UNSET_INDEX) {
  1164. this.adapter_.setAttributeForElementIndex(this.selectedIndex_, ariaAttribute, "false");
  1165. }
  1166. var ariaAttributeValue = isAriaCurrent ? this.ariaCurrentAttrValue_ : "true";
  1167. this.adapter_.setAttributeForElementIndex(index, ariaAttribute, ariaAttributeValue);
  1168. };
  1169. MDCListFoundation.prototype.setRadioAtIndex_ = function(index) {
  1170. this.adapter_.setCheckedCheckboxOrRadioAtIndex(index, true);
  1171. if (this.selectedIndex_ !== constants_1.numbers.UNSET_INDEX) {
  1172. this.adapter_.setAttributeForElementIndex(this.selectedIndex_, constants_1.strings.ARIA_CHECKED, "false");
  1173. }
  1174. this.adapter_.setAttributeForElementIndex(index, constants_1.strings.ARIA_CHECKED, "true");
  1175. this.selectedIndex_ = index;
  1176. };
  1177. MDCListFoundation.prototype.setCheckboxAtIndex_ = function(index) {
  1178. for (var i = 0; i < this.adapter_.getListItemCount(); i++) {
  1179. var isChecked = false;
  1180. if (index.indexOf(i) >= 0) {
  1181. isChecked = true;
  1182. }
  1183. this.adapter_.setCheckedCheckboxOrRadioAtIndex(i, isChecked);
  1184. this.adapter_.setAttributeForElementIndex(i, constants_1.strings.ARIA_CHECKED, isChecked ? "true" : "false");
  1185. }
  1186. this.selectedIndex_ = index;
  1187. };
  1188. MDCListFoundation.prototype.setTabindexAtIndex_ = function(index) {
  1189. if (this.focusedItemIndex_ === constants_1.numbers.UNSET_INDEX && index !== 0) {
  1190. this.adapter_.setAttributeForElementIndex(0, "tabindex", "-1");
  1191. } else if (this.focusedItemIndex_ >= 0 && this.focusedItemIndex_ !== index) {
  1192. this.adapter_.setAttributeForElementIndex(this.focusedItemIndex_, "tabindex", "-1");
  1193. }
  1194. this.adapter_.setAttributeForElementIndex(index, "tabindex", "0");
  1195. };
  1196. MDCListFoundation.prototype.isSelectableList_ = function() {
  1197. return this.isSingleSelectionList_ || this.isCheckboxList_ || this.isRadioList_;
  1198. };
  1199. MDCListFoundation.prototype.setTabindexToFirstSelectedItem_ = function() {
  1200. var targetIndex = 0;
  1201. if (this.isSelectableList_()) {
  1202. if (typeof this.selectedIndex_ === "number" && this.selectedIndex_ !== constants_1.numbers.UNSET_INDEX) {
  1203. targetIndex = this.selectedIndex_;
  1204. } else if (isNumberArray(this.selectedIndex_) && this.selectedIndex_.length > 0) {
  1205. targetIndex = this.selectedIndex_.reduce(function(currentIndex, minIndex) {
  1206. return Math.min(currentIndex, minIndex);
  1207. });
  1208. }
  1209. }
  1210. this.setTabindexAtIndex_(targetIndex);
  1211. };
  1212. MDCListFoundation.prototype.isIndexValid_ = function(index) {
  1213. var _this = this;
  1214. if (index instanceof Array) {
  1215. if (!this.isCheckboxList_) {
  1216. throw new Error("MDCListFoundation: Array of index is only supported for checkbox based list");
  1217. }
  1218. if (index.length === 0) {
  1219. return true;
  1220. } else {
  1221. return index.some(function(i) {
  1222. return _this.isIndexInRange_(i);
  1223. });
  1224. }
  1225. } else if (typeof index === "number") {
  1226. if (this.isCheckboxList_) {
  1227. throw new Error("MDCListFoundation: Expected array of index for checkbox based list but got number: " + index);
  1228. }
  1229. return this.isIndexInRange_(index);
  1230. } else {
  1231. return false;
  1232. }
  1233. };
  1234. MDCListFoundation.prototype.isIndexInRange_ = function(index) {
  1235. var listSize = this.adapter_.getListItemCount();
  1236. return index >= 0 && index < listSize;
  1237. };
  1238. MDCListFoundation.prototype.setSelectedIndexOnAction_ = function(index, toggleCheckbox) {
  1239. if (toggleCheckbox === void 0) {
  1240. toggleCheckbox = true;
  1241. }
  1242. if (this.isCheckboxList_) {
  1243. this.toggleCheckboxAtIndex_(index, toggleCheckbox);
  1244. } else {
  1245. this.setSelectedIndex(index);
  1246. }
  1247. };
  1248. MDCListFoundation.prototype.toggleCheckboxAtIndex_ = function(index, toggleCheckbox) {
  1249. var isChecked = this.adapter_.isCheckboxCheckedAtIndex(index);
  1250. if (toggleCheckbox) {
  1251. isChecked = !isChecked;
  1252. this.adapter_.setCheckedCheckboxOrRadioAtIndex(index, isChecked);
  1253. }
  1254. this.adapter_.setAttributeForElementIndex(index, constants_1.strings.ARIA_CHECKED, isChecked ? "true" : "false");
  1255. var selectedIndexes = this.selectedIndex_ === constants_1.numbers.UNSET_INDEX ? [] : this.selectedIndex_.slice();
  1256. if (isChecked) {
  1257. selectedIndexes.push(index);
  1258. } else {
  1259. selectedIndexes = selectedIndexes.filter(function(i) {
  1260. return i !== index;
  1261. });
  1262. }
  1263. this.selectedIndex_ = selectedIndexes;
  1264. };
  1265. return MDCListFoundation;
  1266. }(foundation_1.MDCFoundation);
  1267. exports.MDCListFoundation = MDCListFoundation;
  1268. exports.default = MDCListFoundation;
  1269. }, function(module, exports, __webpack_require__) {
  1270. "use strict";
  1271. Object.defineProperty(exports, "__esModule", {
  1272. value: true
  1273. });
  1274. var cssClasses = {
  1275. ANCHOR: "mdc-menu-surface--anchor",
  1276. ANIMATING_CLOSED: "mdc-menu-surface--animating-closed",
  1277. ANIMATING_OPEN: "mdc-menu-surface--animating-open",
  1278. FIXED: "mdc-menu-surface--fixed",
  1279. OPEN: "mdc-menu-surface--open",
  1280. ROOT: "mdc-menu-surface"
  1281. };
  1282. exports.cssClasses = cssClasses;
  1283. var strings = {
  1284. CLOSED_EVENT: "MDCMenuSurface:closed",
  1285. OPENED_EVENT: "MDCMenuSurface:opened",
  1286. 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"])' ].join(", ")
  1287. };
  1288. exports.strings = strings;
  1289. var numbers = {
  1290. TRANSITION_OPEN_DURATION: 120,
  1291. TRANSITION_CLOSE_DURATION: 75,
  1292. MARGIN_TO_EDGE: 32,
  1293. ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO: .67
  1294. };
  1295. exports.numbers = numbers;
  1296. var CornerBit;
  1297. (function(CornerBit) {
  1298. CornerBit[CornerBit["BOTTOM"] = 1] = "BOTTOM";
  1299. CornerBit[CornerBit["CENTER"] = 2] = "CENTER";
  1300. CornerBit[CornerBit["RIGHT"] = 4] = "RIGHT";
  1301. CornerBit[CornerBit["FLIP_RTL"] = 8] = "FLIP_RTL";
  1302. })(CornerBit || (CornerBit = {}));
  1303. exports.CornerBit = CornerBit;
  1304. var Corner;
  1305. (function(Corner) {
  1306. Corner[Corner["TOP_LEFT"] = 0] = "TOP_LEFT";
  1307. Corner[Corner["TOP_RIGHT"] = 4] = "TOP_RIGHT";
  1308. Corner[Corner["BOTTOM_LEFT"] = 1] = "BOTTOM_LEFT";
  1309. Corner[Corner["BOTTOM_RIGHT"] = 5] = "BOTTOM_RIGHT";
  1310. Corner[Corner["TOP_START"] = 8] = "TOP_START";
  1311. Corner[Corner["TOP_END"] = 12] = "TOP_END";
  1312. Corner[Corner["BOTTOM_START"] = 9] = "BOTTOM_START";
  1313. Corner[Corner["BOTTOM_END"] = 13] = "BOTTOM_END";
  1314. })(Corner || (Corner = {}));
  1315. exports.Corner = Corner;
  1316. }, function(module, exports, __webpack_require__) {
  1317. "use strict";
  1318. Object.defineProperty(exports, "__esModule", {
  1319. value: true
  1320. });
  1321. var cssClasses = {
  1322. FIXED_CLASS: "mdc-top-app-bar--fixed",
  1323. FIXED_SCROLLED_CLASS: "mdc-top-app-bar--fixed-scrolled",
  1324. SHORT_CLASS: "mdc-top-app-bar--short",
  1325. SHORT_COLLAPSED_CLASS: "mdc-top-app-bar--short-collapsed",
  1326. SHORT_HAS_ACTION_ITEM_CLASS: "mdc-top-app-bar--short-has-action-item"
  1327. };
  1328. exports.cssClasses = cssClasses;
  1329. var numbers = {
  1330. DEBOUNCE_THROTTLE_RESIZE_TIME_MS: 100,
  1331. MAX_TOP_APP_BAR_HEIGHT: 128
  1332. };
  1333. exports.numbers = numbers;
  1334. var strings = {
  1335. ACTION_ITEM_SELECTOR: ".mdc-top-app-bar__action-item",
  1336. NAVIGATION_EVENT: "MDCTopAppBar:nav",
  1337. NAVIGATION_ICON_SELECTOR: ".mdc-top-app-bar__navigation-icon",
  1338. ROOT_SELECTOR: ".mdc-top-app-bar",
  1339. TITLE_SELECTOR: ".mdc-top-app-bar__title"
  1340. };
  1341. exports.strings = strings;
  1342. }, function(module, exports, __webpack_require__) {
  1343. "use strict";
  1344. var __extends = this && this.__extends || function() {
  1345. var _extendStatics = function extendStatics(d, b) {
  1346. _extendStatics = Object.setPrototypeOf || {
  1347. __proto__: []
  1348. } instanceof Array && function(d, b) {
  1349. d.__proto__ = b;
  1350. } || function(d, b) {
  1351. for (var p in b) {
  1352. if (b.hasOwnProperty(p)) d[p] = b[p];
  1353. }
  1354. };
  1355. return _extendStatics(d, b);
  1356. };
  1357. return function(d, b) {
  1358. _extendStatics(d, b);
  1359. function __() {
  1360. this.constructor = d;
  1361. }
  1362. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  1363. };
  1364. }();
  1365. var __assign = this && this.__assign || function() {
  1366. __assign = Object.assign || function(t) {
  1367. for (var s, i = 1, n = arguments.length; i < n; i++) {
  1368. s = arguments[i];
  1369. for (var p in s) {
  1370. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  1371. }
  1372. }
  1373. return t;
  1374. };
  1375. return __assign.apply(this, arguments);
  1376. };
  1377. var __values = this && this.__values || function(o) {
  1378. var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
  1379. if (m) return m.call(o);
  1380. return {
  1381. next: function next() {
  1382. if (o && i >= o.length) o = void 0;
  1383. return {
  1384. value: o && o[i++],
  1385. done: !o
  1386. };
  1387. }
  1388. };
  1389. };
  1390. Object.defineProperty(exports, "__esModule", {
  1391. value: true
  1392. });
  1393. var foundation_1 = __webpack_require__(0);
  1394. var constants_1 = __webpack_require__(6);
  1395. var MDCMenuSurfaceFoundation = function(_super) {
  1396. __extends(MDCMenuSurfaceFoundation, _super);
  1397. function MDCMenuSurfaceFoundation(adapter) {
  1398. var _this = _super.call(this, __assign({}, MDCMenuSurfaceFoundation.defaultAdapter, adapter)) || this;
  1399. _this.isOpen_ = false;
  1400. _this.isQuickOpen_ = false;
  1401. _this.isHoistedElement_ = false;
  1402. _this.isFixedPosition_ = false;
  1403. _this.openAnimationEndTimerId_ = 0;
  1404. _this.closeAnimationEndTimerId_ = 0;
  1405. _this.animationRequestId_ = 0;
  1406. _this.anchorCorner_ = constants_1.Corner.TOP_START;
  1407. _this.anchorMargin_ = {
  1408. top: 0,
  1409. right: 0,
  1410. bottom: 0,
  1411. left: 0
  1412. };
  1413. _this.position_ = {
  1414. x: 0,
  1415. y: 0
  1416. };
  1417. return _this;
  1418. }
  1419. Object.defineProperty(MDCMenuSurfaceFoundation, "cssClasses", {
  1420. get: function get() {
  1421. return constants_1.cssClasses;
  1422. },
  1423. enumerable: true,
  1424. configurable: true
  1425. });
  1426. Object.defineProperty(MDCMenuSurfaceFoundation, "strings", {
  1427. get: function get() {
  1428. return constants_1.strings;
  1429. },
  1430. enumerable: true,
  1431. configurable: true
  1432. });
  1433. Object.defineProperty(MDCMenuSurfaceFoundation, "numbers", {
  1434. get: function get() {
  1435. return constants_1.numbers;
  1436. },
  1437. enumerable: true,
  1438. configurable: true
  1439. });
  1440. Object.defineProperty(MDCMenuSurfaceFoundation, "Corner", {
  1441. get: function get() {
  1442. return constants_1.Corner;
  1443. },
  1444. enumerable: true,
  1445. configurable: true
  1446. });
  1447. Object.defineProperty(MDCMenuSurfaceFoundation, "defaultAdapter", {
  1448. get: function get() {
  1449. return {
  1450. addClass: function addClass() {
  1451. return undefined;
  1452. },
  1453. removeClass: function removeClass() {
  1454. return undefined;
  1455. },
  1456. hasClass: function hasClass() {
  1457. return false;
  1458. },
  1459. hasAnchor: function hasAnchor() {
  1460. return false;
  1461. },
  1462. isElementInContainer: function isElementInContainer() {
  1463. return false;
  1464. },
  1465. isFocused: function isFocused() {
  1466. return false;
  1467. },
  1468. isFirstElementFocused: function isFirstElementFocused() {
  1469. return false;
  1470. },
  1471. isLastElementFocused: function isLastElementFocused() {
  1472. return false;
  1473. },
  1474. isRtl: function isRtl() {
  1475. return false;
  1476. },
  1477. getInnerDimensions: function getInnerDimensions() {
  1478. return {
  1479. height: 0,
  1480. width: 0
  1481. };
  1482. },
  1483. getAnchorDimensions: function getAnchorDimensions() {
  1484. return null;
  1485. },
  1486. getWindowDimensions: function getWindowDimensions() {
  1487. return {
  1488. height: 0,
  1489. width: 0
  1490. };
  1491. },
  1492. getBodyDimensions: function getBodyDimensions() {
  1493. return {
  1494. height: 0,
  1495. width: 0
  1496. };
  1497. },
  1498. getWindowScroll: function getWindowScroll() {
  1499. return {
  1500. x: 0,
  1501. y: 0
  1502. };
  1503. },
  1504. setPosition: function setPosition() {
  1505. return undefined;
  1506. },
  1507. setMaxHeight: function setMaxHeight() {
  1508. return undefined;
  1509. },
  1510. setTransformOrigin: function setTransformOrigin() {
  1511. return undefined;
  1512. },
  1513. saveFocus: function saveFocus() {
  1514. return undefined;
  1515. },
  1516. restoreFocus: function restoreFocus() {
  1517. return undefined;
  1518. },
  1519. focusFirstElement: function focusFirstElement() {
  1520. return undefined;
  1521. },
  1522. focusLastElement: function focusLastElement() {
  1523. return undefined;
  1524. },
  1525. notifyClose: function notifyClose() {
  1526. return undefined;
  1527. },
  1528. notifyOpen: function notifyOpen() {
  1529. return undefined;
  1530. }
  1531. };
  1532. },
  1533. enumerable: true,
  1534. configurable: true
  1535. });
  1536. MDCMenuSurfaceFoundation.prototype.init = function() {
  1537. var _a = MDCMenuSurfaceFoundation.cssClasses, ROOT = _a.ROOT, OPEN = _a.OPEN;
  1538. if (!this.adapter_.hasClass(ROOT)) {
  1539. throw new Error(ROOT + " class required in root element.");
  1540. }
  1541. if (this.adapter_.hasClass(OPEN)) {
  1542. this.isOpen_ = true;
  1543. }
  1544. };
  1545. MDCMenuSurfaceFoundation.prototype.destroy = function() {
  1546. clearTimeout(this.openAnimationEndTimerId_);
  1547. clearTimeout(this.closeAnimationEndTimerId_);
  1548. cancelAnimationFrame(this.animationRequestId_);
  1549. };
  1550. MDCMenuSurfaceFoundation.prototype.setAnchorCorner = function(corner) {
  1551. this.anchorCorner_ = corner;
  1552. };
  1553. MDCMenuSurfaceFoundation.prototype.setAnchorMargin = function(margin) {
  1554. this.anchorMargin_.top = margin.top || 0;
  1555. this.anchorMargin_.right = margin.right || 0;
  1556. this.anchorMargin_.bottom = margin.bottom || 0;
  1557. this.anchorMargin_.left = margin.left || 0;
  1558. };
  1559. MDCMenuSurfaceFoundation.prototype.setIsHoisted = function(isHoisted) {
  1560. this.isHoistedElement_ = isHoisted;
  1561. };
  1562. MDCMenuSurfaceFoundation.prototype.setFixedPosition = function(isFixedPosition) {
  1563. this.isFixedPosition_ = isFixedPosition;
  1564. };
  1565. MDCMenuSurfaceFoundation.prototype.setAbsolutePosition = function(x, y) {
  1566. this.position_.x = this.isFinite_(x) ? x : 0;
  1567. this.position_.y = this.isFinite_(y) ? y : 0;
  1568. };
  1569. MDCMenuSurfaceFoundation.prototype.setQuickOpen = function(quickOpen) {
  1570. this.isQuickOpen_ = quickOpen;
  1571. };
  1572. MDCMenuSurfaceFoundation.prototype.isOpen = function() {
  1573. return this.isOpen_;
  1574. };
  1575. MDCMenuSurfaceFoundation.prototype.open = function() {
  1576. var _this = this;
  1577. this.adapter_.saveFocus();
  1578. if (!this.isQuickOpen_) {
  1579. this.adapter_.addClass(MDCMenuSurfaceFoundation.cssClasses.ANIMATING_OPEN);
  1580. }
  1581. this.animationRequestId_ = requestAnimationFrame(function() {
  1582. _this.adapter_.addClass(MDCMenuSurfaceFoundation.cssClasses.OPEN);
  1583. _this.dimensions_ = _this.adapter_.getInnerDimensions();
  1584. _this.autoPosition_();
  1585. if (_this.isQuickOpen_) {
  1586. _this.adapter_.notifyOpen();
  1587. } else {
  1588. _this.openAnimationEndTimerId_ = setTimeout(function() {
  1589. _this.openAnimationEndTimerId_ = 0;
  1590. _this.adapter_.removeClass(MDCMenuSurfaceFoundation.cssClasses.ANIMATING_OPEN);
  1591. _this.adapter_.notifyOpen();
  1592. }, constants_1.numbers.TRANSITION_OPEN_DURATION);
  1593. }
  1594. });
  1595. this.isOpen_ = true;
  1596. };
  1597. MDCMenuSurfaceFoundation.prototype.close = function() {
  1598. var _this = this;
  1599. if (!this.isQuickOpen_) {
  1600. this.adapter_.addClass(MDCMenuSurfaceFoundation.cssClasses.ANIMATING_CLOSED);
  1601. }
  1602. requestAnimationFrame(function() {
  1603. _this.adapter_.removeClass(MDCMenuSurfaceFoundation.cssClasses.OPEN);
  1604. if (_this.isQuickOpen_) {
  1605. _this.adapter_.notifyClose();
  1606. } else {
  1607. _this.closeAnimationEndTimerId_ = setTimeout(function() {
  1608. _this.closeAnimationEndTimerId_ = 0;
  1609. _this.adapter_.removeClass(MDCMenuSurfaceFoundation.cssClasses.ANIMATING_CLOSED);
  1610. _this.adapter_.notifyClose();
  1611. }, constants_1.numbers.TRANSITION_CLOSE_DURATION);
  1612. }
  1613. });
  1614. this.isOpen_ = false;
  1615. this.maybeRestoreFocus_();
  1616. };
  1617. MDCMenuSurfaceFoundation.prototype.handleBodyClick = function(evt) {
  1618. var el = evt.target;
  1619. if (this.adapter_.isElementInContainer(el)) {
  1620. return;
  1621. }
  1622. this.close();
  1623. };
  1624. MDCMenuSurfaceFoundation.prototype.handleKeydown = function(evt) {
  1625. var keyCode = evt.keyCode, key = evt.key, shiftKey = evt.shiftKey;
  1626. var isEscape = key === "Escape" || keyCode === 27;
  1627. var isTab = key === "Tab" || keyCode === 9;
  1628. if (isEscape) {
  1629. this.close();
  1630. } else if (isTab) {
  1631. if (this.adapter_.isLastElementFocused() && !shiftKey) {
  1632. this.adapter_.focusFirstElement();
  1633. evt.preventDefault();
  1634. } else if (this.adapter_.isFirstElementFocused() && shiftKey) {
  1635. this.adapter_.focusLastElement();
  1636. evt.preventDefault();
  1637. }
  1638. }
  1639. };
  1640. MDCMenuSurfaceFoundation.prototype.autoPosition_ = function() {
  1641. var _a;
  1642. this.measurements_ = this.getAutoLayoutMeasurements_();
  1643. var corner = this.getOriginCorner_();
  1644. var maxMenuSurfaceHeight = this.getMenuSurfaceMaxHeight_(corner);
  1645. var verticalAlignment = this.hasBit_(corner, constants_1.CornerBit.BOTTOM) ? "bottom" : "top";
  1646. var horizontalAlignment = this.hasBit_(corner, constants_1.CornerBit.RIGHT) ? "right" : "left";
  1647. var horizontalOffset = this.getHorizontalOriginOffset_(corner);
  1648. var verticalOffset = this.getVerticalOriginOffset_(corner);
  1649. var _b = this.measurements_, anchorSize = _b.anchorSize, surfaceSize = _b.surfaceSize;
  1650. var position = (_a = {}, _a[horizontalAlignment] = horizontalOffset, _a[verticalAlignment] = verticalOffset,
  1651. _a);
  1652. if (anchorSize.width / surfaceSize.width > constants_1.numbers.ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO) {
  1653. horizontalAlignment = "center";
  1654. }
  1655. if (this.isHoistedElement_ || this.isFixedPosition_) {
  1656. this.adjustPositionForHoistedElement_(position);
  1657. }
  1658. this.adapter_.setTransformOrigin(horizontalAlignment + " " + verticalAlignment);
  1659. this.adapter_.setPosition(position);
  1660. this.adapter_.setMaxHeight(maxMenuSurfaceHeight ? maxMenuSurfaceHeight + "px" : "");
  1661. };
  1662. MDCMenuSurfaceFoundation.prototype.getAutoLayoutMeasurements_ = function() {
  1663. var anchorRect = this.adapter_.getAnchorDimensions();
  1664. var bodySize = this.adapter_.getBodyDimensions();
  1665. var viewportSize = this.adapter_.getWindowDimensions();
  1666. var windowScroll = this.adapter_.getWindowScroll();
  1667. if (!anchorRect) {
  1668. anchorRect = {
  1669. top: this.position_.y,
  1670. right: this.position_.x,
  1671. bottom: this.position_.y,
  1672. left: this.position_.x,
  1673. width: 0,
  1674. height: 0
  1675. };
  1676. }
  1677. return {
  1678. anchorSize: anchorRect,
  1679. bodySize: bodySize,
  1680. surfaceSize: this.dimensions_,
  1681. viewportDistance: {
  1682. top: anchorRect.top,
  1683. right: viewportSize.width - anchorRect.right,
  1684. bottom: viewportSize.height - anchorRect.bottom,
  1685. left: anchorRect.left
  1686. },
  1687. viewportSize: viewportSize,
  1688. windowScroll: windowScroll
  1689. };
  1690. };
  1691. MDCMenuSurfaceFoundation.prototype.getOriginCorner_ = function() {
  1692. var corner = constants_1.Corner.TOP_LEFT;
  1693. var _a = this.measurements_, viewportDistance = _a.viewportDistance, anchorSize = _a.anchorSize, surfaceSize = _a.surfaceSize;
  1694. var isBottomAligned = this.hasBit_(this.anchorCorner_, constants_1.CornerBit.BOTTOM);
  1695. var availableTop = isBottomAligned ? viewportDistance.top + anchorSize.height + this.anchorMargin_.bottom : viewportDistance.top + this.anchorMargin_.top;
  1696. var availableBottom = isBottomAligned ? viewportDistance.bottom - this.anchorMargin_.bottom : viewportDistance.bottom + anchorSize.height - this.anchorMargin_.top;
  1697. var topOverflow = surfaceSize.height - availableTop;
  1698. var bottomOverflow = surfaceSize.height - availableBottom;
  1699. if (bottomOverflow > 0 && topOverflow < bottomOverflow) {
  1700. corner = this.setBit_(corner, constants_1.CornerBit.BOTTOM);
  1701. }
  1702. var isRtl = this.adapter_.isRtl();
  1703. var isFlipRtl = this.hasBit_(this.anchorCorner_, constants_1.CornerBit.FLIP_RTL);
  1704. var avoidHorizontalOverlap = this.hasBit_(this.anchorCorner_, constants_1.CornerBit.RIGHT);
  1705. var isAlignedRight = avoidHorizontalOverlap && !isRtl || !avoidHorizontalOverlap && isFlipRtl && isRtl;
  1706. var availableLeft = isAlignedRight ? viewportDistance.left + anchorSize.width + this.anchorMargin_.right : viewportDistance.left + this.anchorMargin_.left;
  1707. var availableRight = isAlignedRight ? viewportDistance.right - this.anchorMargin_.right : viewportDistance.right + anchorSize.width - this.anchorMargin_.left;
  1708. var leftOverflow = surfaceSize.width - availableLeft;
  1709. var rightOverflow = surfaceSize.width - availableRight;
  1710. if (leftOverflow < 0 && isAlignedRight && isRtl || avoidHorizontalOverlap && !isAlignedRight && leftOverflow < 0 || rightOverflow > 0 && leftOverflow < rightOverflow) {
  1711. corner = this.setBit_(corner, constants_1.CornerBit.RIGHT);
  1712. }
  1713. return corner;
  1714. };
  1715. MDCMenuSurfaceFoundation.prototype.getMenuSurfaceMaxHeight_ = function(corner) {
  1716. var viewportDistance = this.measurements_.viewportDistance;
  1717. var maxHeight = 0;
  1718. var isBottomAligned = this.hasBit_(corner, constants_1.CornerBit.BOTTOM);
  1719. var isBottomAnchored = this.hasBit_(this.anchorCorner_, constants_1.CornerBit.BOTTOM);
  1720. var MARGIN_TO_EDGE = MDCMenuSurfaceFoundation.numbers.MARGIN_TO_EDGE;
  1721. if (isBottomAligned) {
  1722. maxHeight = viewportDistance.top + this.anchorMargin_.top - MARGIN_TO_EDGE;
  1723. if (!isBottomAnchored) {
  1724. maxHeight += this.measurements_.anchorSize.height;
  1725. }
  1726. } else {
  1727. maxHeight = viewportDistance.bottom - this.anchorMargin_.bottom + this.measurements_.anchorSize.height - MARGIN_TO_EDGE;
  1728. if (isBottomAnchored) {
  1729. maxHeight -= this.measurements_.anchorSize.height;
  1730. }
  1731. }
  1732. return maxHeight;
  1733. };
  1734. MDCMenuSurfaceFoundation.prototype.getHorizontalOriginOffset_ = function(corner) {
  1735. var anchorSize = this.measurements_.anchorSize;
  1736. var isRightAligned = this.hasBit_(corner, constants_1.CornerBit.RIGHT);
  1737. var avoidHorizontalOverlap = this.hasBit_(this.anchorCorner_, constants_1.CornerBit.RIGHT);
  1738. if (isRightAligned) {
  1739. var rightOffset = avoidHorizontalOverlap ? anchorSize.width - this.anchorMargin_.left : this.anchorMargin_.right;
  1740. if (this.isHoistedElement_ || this.isFixedPosition_) {
  1741. return rightOffset - (this.measurements_.viewportSize.width - this.measurements_.bodySize.width);
  1742. }
  1743. return rightOffset;
  1744. }
  1745. return avoidHorizontalOverlap ? anchorSize.width - this.anchorMargin_.right : this.anchorMargin_.left;
  1746. };
  1747. MDCMenuSurfaceFoundation.prototype.getVerticalOriginOffset_ = function(corner) {
  1748. var anchorSize = this.measurements_.anchorSize;
  1749. var isBottomAligned = this.hasBit_(corner, constants_1.CornerBit.BOTTOM);
  1750. var avoidVerticalOverlap = this.hasBit_(this.anchorCorner_, constants_1.CornerBit.BOTTOM);
  1751. var y = 0;
  1752. if (isBottomAligned) {
  1753. y = avoidVerticalOverlap ? anchorSize.height - this.anchorMargin_.top : -this.anchorMargin_.bottom;
  1754. } else {
  1755. y = avoidVerticalOverlap ? anchorSize.height + this.anchorMargin_.bottom : this.anchorMargin_.top;
  1756. }
  1757. return y;
  1758. };
  1759. MDCMenuSurfaceFoundation.prototype.adjustPositionForHoistedElement_ = function(position) {
  1760. var e_1, _a;
  1761. var _b = this.measurements_, windowScroll = _b.windowScroll, viewportDistance = _b.viewportDistance;
  1762. var props = Object.keys(position);
  1763. try {
  1764. for (var props_1 = __values(props), props_1_1 = props_1.next(); !props_1_1.done; props_1_1 = props_1.next()) {
  1765. var prop = props_1_1.value;
  1766. var value = position[prop] || 0;
  1767. value += viewportDistance[prop];
  1768. if (!this.isFixedPosition_) {
  1769. if (prop === "top") {
  1770. value += windowScroll.y;
  1771. } else if (prop === "bottom") {
  1772. value -= windowScroll.y;
  1773. } else if (prop === "left") {
  1774. value += windowScroll.x;
  1775. } else {
  1776. value -= windowScroll.x;
  1777. }
  1778. }
  1779. position[prop] = value;
  1780. }
  1781. } catch (e_1_1) {
  1782. e_1 = {
  1783. error: e_1_1
  1784. };
  1785. } finally {
  1786. try {
  1787. if (props_1_1 && !props_1_1.done && (_a = props_1.return)) _a.call(props_1);
  1788. } finally {
  1789. if (e_1) throw e_1.error;
  1790. }
  1791. }
  1792. };
  1793. MDCMenuSurfaceFoundation.prototype.maybeRestoreFocus_ = function() {
  1794. var isRootFocused = this.adapter_.isFocused();
  1795. var childHasFocus = document.activeElement && this.adapter_.isElementInContainer(document.activeElement);
  1796. if (isRootFocused || childHasFocus) {
  1797. this.adapter_.restoreFocus();
  1798. }
  1799. };
  1800. MDCMenuSurfaceFoundation.prototype.hasBit_ = function(corner, bit) {
  1801. return Boolean(corner & bit);
  1802. };
  1803. MDCMenuSurfaceFoundation.prototype.setBit_ = function(corner, bit) {
  1804. return corner | bit;
  1805. };
  1806. MDCMenuSurfaceFoundation.prototype.isFinite_ = function(num) {
  1807. return typeof num === "number" && isFinite(num);
  1808. };
  1809. return MDCMenuSurfaceFoundation;
  1810. }(foundation_1.MDCFoundation);
  1811. exports.MDCMenuSurfaceFoundation = MDCMenuSurfaceFoundation;
  1812. exports.default = MDCMenuSurfaceFoundation;
  1813. }, function(module, exports, __webpack_require__) {
  1814. "use strict";
  1815. var __extends = this && this.__extends || function() {
  1816. var _extendStatics = function extendStatics(d, b) {
  1817. _extendStatics = Object.setPrototypeOf || {
  1818. __proto__: []
  1819. } instanceof Array && function(d, b) {
  1820. d.__proto__ = b;
  1821. } || function(d, b) {
  1822. for (var p in b) {
  1823. if (b.hasOwnProperty(p)) d[p] = b[p];
  1824. }
  1825. };
  1826. return _extendStatics(d, b);
  1827. };
  1828. return function(d, b) {
  1829. _extendStatics(d, b);
  1830. function __() {
  1831. this.constructor = d;
  1832. }
  1833. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  1834. };
  1835. }();
  1836. var __assign = this && this.__assign || function() {
  1837. __assign = Object.assign || function(t) {
  1838. for (var s, i = 1, n = arguments.length; i < n; i++) {
  1839. s = arguments[i];
  1840. for (var p in s) {
  1841. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  1842. }
  1843. }
  1844. return t;
  1845. };
  1846. return __assign.apply(this, arguments);
  1847. };
  1848. Object.defineProperty(exports, "__esModule", {
  1849. value: true
  1850. });
  1851. var foundation_1 = __webpack_require__(0);
  1852. var constants_1 = __webpack_require__(144);
  1853. var MDCTabIndicatorFoundation = function(_super) {
  1854. __extends(MDCTabIndicatorFoundation, _super);
  1855. function MDCTabIndicatorFoundation(adapter) {
  1856. return _super.call(this, __assign({}, MDCTabIndicatorFoundation.defaultAdapter, adapter)) || this;
  1857. }
  1858. Object.defineProperty(MDCTabIndicatorFoundation, "cssClasses", {
  1859. get: function get() {
  1860. return constants_1.cssClasses;
  1861. },
  1862. enumerable: true,
  1863. configurable: true
  1864. });
  1865. Object.defineProperty(MDCTabIndicatorFoundation, "strings", {
  1866. get: function get() {
  1867. return constants_1.strings;
  1868. },
  1869. enumerable: true,
  1870. configurable: true
  1871. });
  1872. Object.defineProperty(MDCTabIndicatorFoundation, "defaultAdapter", {
  1873. get: function get() {
  1874. return {
  1875. addClass: function addClass() {
  1876. return undefined;
  1877. },
  1878. removeClass: function removeClass() {
  1879. return undefined;
  1880. },
  1881. computeContentClientRect: function computeContentClientRect() {
  1882. return {
  1883. top: 0,
  1884. right: 0,
  1885. bottom: 0,
  1886. left: 0,
  1887. width: 0,
  1888. height: 0
  1889. };
  1890. },
  1891. setContentStyleProperty: function setContentStyleProperty() {
  1892. return undefined;
  1893. }
  1894. };
  1895. },
  1896. enumerable: true,
  1897. configurable: true
  1898. });
  1899. MDCTabIndicatorFoundation.prototype.computeContentClientRect = function() {
  1900. return this.adapter_.computeContentClientRect();
  1901. };
  1902. return MDCTabIndicatorFoundation;
  1903. }(foundation_1.MDCFoundation);
  1904. exports.MDCTabIndicatorFoundation = MDCTabIndicatorFoundation;
  1905. exports.default = MDCTabIndicatorFoundation;
  1906. }, function(module, exports, __webpack_require__) {
  1907. "use strict";
  1908. Object.defineProperty(exports, "__esModule", {
  1909. value: true
  1910. });
  1911. var cssPropertyNameMap = {
  1912. animation: {
  1913. prefixed: "-webkit-animation",
  1914. standard: "animation"
  1915. },
  1916. transform: {
  1917. prefixed: "-webkit-transform",
  1918. standard: "transform"
  1919. },
  1920. transition: {
  1921. prefixed: "-webkit-transition",
  1922. standard: "transition"
  1923. }
  1924. };
  1925. var jsEventTypeMap = {
  1926. animationend: {
  1927. cssProperty: "animation",
  1928. prefixed: "webkitAnimationEnd",
  1929. standard: "animationend"
  1930. },
  1931. animationiteration: {
  1932. cssProperty: "animation",
  1933. prefixed: "webkitAnimationIteration",
  1934. standard: "animationiteration"
  1935. },
  1936. animationstart: {
  1937. cssProperty: "animation",
  1938. prefixed: "webkitAnimationStart",
  1939. standard: "animationstart"
  1940. },
  1941. transitionend: {
  1942. cssProperty: "transition",
  1943. prefixed: "webkitTransitionEnd",
  1944. standard: "transitionend"
  1945. }
  1946. };
  1947. function isWindow(windowObj) {
  1948. return Boolean(windowObj.document) && typeof windowObj.document.createElement === "function";
  1949. }
  1950. function getCorrectPropertyName(windowObj, cssProperty) {
  1951. if (isWindow(windowObj) && cssProperty in cssPropertyNameMap) {
  1952. var el = windowObj.document.createElement("div");
  1953. var _a = cssPropertyNameMap[cssProperty], standard = _a.standard, prefixed = _a.prefixed;
  1954. var isStandard = standard in el.style;
  1955. return isStandard ? standard : prefixed;
  1956. }
  1957. return cssProperty;
  1958. }
  1959. exports.getCorrectPropertyName = getCorrectPropertyName;
  1960. function getCorrectEventName(windowObj, eventType) {
  1961. if (isWindow(windowObj) && eventType in jsEventTypeMap) {
  1962. var el = windowObj.document.createElement("div");
  1963. var _a = jsEventTypeMap[eventType], standard = _a.standard, prefixed = _a.prefixed, cssProperty = _a.cssProperty;
  1964. var isStandard = cssProperty in el.style;
  1965. return isStandard ? standard : prefixed;
  1966. }
  1967. return eventType;
  1968. }
  1969. exports.getCorrectEventName = getCorrectEventName;
  1970. }, function(module, exports, __webpack_require__) {
  1971. "use strict";
  1972. Object.defineProperty(exports, "__esModule", {
  1973. value: true
  1974. });
  1975. var supportsCssVariables_;
  1976. var supportsPassive_;
  1977. function detectEdgePseudoVarBug(windowObj) {
  1978. var document = windowObj.document;
  1979. var node = document.createElement("div");
  1980. node.className = "mdc-ripple-surface--test-edge-var-bug";
  1981. document.body.appendChild(node);
  1982. var computedStyle = windowObj.getComputedStyle(node);
  1983. var hasPseudoVarBug = computedStyle !== null && computedStyle.borderTopStyle === "solid";
  1984. if (node.parentNode) {
  1985. node.parentNode.removeChild(node);
  1986. }
  1987. return hasPseudoVarBug;
  1988. }
  1989. function supportsCssVariables(windowObj, forceRefresh) {
  1990. if (forceRefresh === void 0) {
  1991. forceRefresh = false;
  1992. }
  1993. var CSS = windowObj.CSS;
  1994. var supportsCssVars = supportsCssVariables_;
  1995. if (typeof supportsCssVariables_ === "boolean" && !forceRefresh) {
  1996. return supportsCssVariables_;
  1997. }
  1998. var supportsFunctionPresent = CSS && typeof CSS.supports === "function";
  1999. if (!supportsFunctionPresent) {
  2000. return false;
  2001. }
  2002. var explicitlySupportsCssVars = CSS.supports("--css-vars", "yes");
  2003. var weAreFeatureDetectingSafari10plus = CSS.supports("(--css-vars: yes)") && CSS.supports("color", "#00000000");
  2004. if (explicitlySupportsCssVars || weAreFeatureDetectingSafari10plus) {
  2005. supportsCssVars = !detectEdgePseudoVarBug(windowObj);
  2006. } else {
  2007. supportsCssVars = false;
  2008. }
  2009. if (!forceRefresh) {
  2010. supportsCssVariables_ = supportsCssVars;
  2011. }
  2012. return supportsCssVars;
  2013. }
  2014. exports.supportsCssVariables = supportsCssVariables;
  2015. function applyPassive(globalObj, forceRefresh) {
  2016. if (globalObj === void 0) {
  2017. globalObj = window;
  2018. }
  2019. if (forceRefresh === void 0) {
  2020. forceRefresh = false;
  2021. }
  2022. if (supportsPassive_ === undefined || forceRefresh) {
  2023. var isSupported_1 = false;
  2024. try {
  2025. globalObj.document.addEventListener("test", function() {
  2026. return undefined;
  2027. }, {
  2028. get passive() {
  2029. isSupported_1 = true;
  2030. return isSupported_1;
  2031. }
  2032. });
  2033. } catch (e) {}
  2034. supportsPassive_ = isSupported_1;
  2035. }
  2036. return supportsPassive_ ? {
  2037. passive: true
  2038. } : false;
  2039. }
  2040. exports.applyPassive = applyPassive;
  2041. function getNormalizedEventCoords(evt, pageOffset, clientRect) {
  2042. if (!evt) {
  2043. return {
  2044. x: 0,
  2045. y: 0
  2046. };
  2047. }
  2048. var x = pageOffset.x, y = pageOffset.y;
  2049. var documentX = x + clientRect.left;
  2050. var documentY = y + clientRect.top;
  2051. var normalizedX;
  2052. var normalizedY;
  2053. if (evt.type === "touchstart") {
  2054. var touchEvent = evt;
  2055. normalizedX = touchEvent.changedTouches[0].pageX - documentX;
  2056. normalizedY = touchEvent.changedTouches[0].pageY - documentY;
  2057. } else {
  2058. var mouseEvent = evt;
  2059. normalizedX = mouseEvent.pageX - documentX;
  2060. normalizedY = mouseEvent.pageY - documentY;
  2061. }
  2062. return {
  2063. x: normalizedX,
  2064. y: normalizedY
  2065. };
  2066. }
  2067. exports.getNormalizedEventCoords = getNormalizedEventCoords;
  2068. }, function(module, exports, __webpack_require__) {
  2069. "use strict";
  2070. var __extends = this && this.__extends || function() {
  2071. var _extendStatics = function extendStatics(d, b) {
  2072. _extendStatics = Object.setPrototypeOf || {
  2073. __proto__: []
  2074. } instanceof Array && function(d, b) {
  2075. d.__proto__ = b;
  2076. } || function(d, b) {
  2077. for (var p in b) {
  2078. if (b.hasOwnProperty(p)) d[p] = b[p];
  2079. }
  2080. };
  2081. return _extendStatics(d, b);
  2082. };
  2083. return function(d, b) {
  2084. _extendStatics(d, b);
  2085. function __() {
  2086. this.constructor = d;
  2087. }
  2088. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  2089. };
  2090. }();
  2091. var __assign = this && this.__assign || function() {
  2092. __assign = Object.assign || function(t) {
  2093. for (var s, i = 1, n = arguments.length; i < n; i++) {
  2094. s = arguments[i];
  2095. for (var p in s) {
  2096. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  2097. }
  2098. }
  2099. return t;
  2100. };
  2101. return __assign.apply(this, arguments);
  2102. };
  2103. Object.defineProperty(exports, "__esModule", {
  2104. value: true
  2105. });
  2106. var foundation_1 = __webpack_require__(0);
  2107. var constants_1 = __webpack_require__(29);
  2108. var emptyClientRect = {
  2109. bottom: 0,
  2110. height: 0,
  2111. left: 0,
  2112. right: 0,
  2113. top: 0,
  2114. width: 0
  2115. };
  2116. var MDCChipFoundation = function(_super) {
  2117. __extends(MDCChipFoundation, _super);
  2118. function MDCChipFoundation(adapter) {
  2119. var _this = _super.call(this, __assign({}, MDCChipFoundation.defaultAdapter, adapter)) || this;
  2120. _this.shouldRemoveOnTrailingIconClick_ = true;
  2121. return _this;
  2122. }
  2123. Object.defineProperty(MDCChipFoundation, "strings", {
  2124. get: function get() {
  2125. return constants_1.strings;
  2126. },
  2127. enumerable: true,
  2128. configurable: true
  2129. });
  2130. Object.defineProperty(MDCChipFoundation, "cssClasses", {
  2131. get: function get() {
  2132. return constants_1.cssClasses;
  2133. },
  2134. enumerable: true,
  2135. configurable: true
  2136. });
  2137. Object.defineProperty(MDCChipFoundation, "defaultAdapter", {
  2138. get: function get() {
  2139. return {
  2140. addClass: function addClass() {
  2141. return undefined;
  2142. },
  2143. addClassToLeadingIcon: function addClassToLeadingIcon() {
  2144. return undefined;
  2145. },
  2146. eventTargetHasClass: function eventTargetHasClass() {
  2147. return false;
  2148. },
  2149. getCheckmarkBoundingClientRect: function getCheckmarkBoundingClientRect() {
  2150. return emptyClientRect;
  2151. },
  2152. getComputedStyleValue: function getComputedStyleValue() {
  2153. return "";
  2154. },
  2155. getRootBoundingClientRect: function getRootBoundingClientRect() {
  2156. return emptyClientRect;
  2157. },
  2158. hasClass: function hasClass() {
  2159. return false;
  2160. },
  2161. hasLeadingIcon: function hasLeadingIcon() {
  2162. return false;
  2163. },
  2164. notifyInteraction: function notifyInteraction() {
  2165. return undefined;
  2166. },
  2167. notifyRemoval: function notifyRemoval() {
  2168. return undefined;
  2169. },
  2170. notifySelection: function notifySelection() {
  2171. return undefined;
  2172. },
  2173. notifyTrailingIconInteraction: function notifyTrailingIconInteraction() {
  2174. return undefined;
  2175. },
  2176. removeClass: function removeClass() {
  2177. return undefined;
  2178. },
  2179. removeClassFromLeadingIcon: function removeClassFromLeadingIcon() {
  2180. return undefined;
  2181. },
  2182. setStyleProperty: function setStyleProperty() {
  2183. return undefined;
  2184. }
  2185. };
  2186. },
  2187. enumerable: true,
  2188. configurable: true
  2189. });
  2190. MDCChipFoundation.prototype.isSelected = function() {
  2191. return this.adapter_.hasClass(constants_1.cssClasses.SELECTED);
  2192. };
  2193. MDCChipFoundation.prototype.setSelected = function(selected) {
  2194. if (selected) {
  2195. this.adapter_.addClass(constants_1.cssClasses.SELECTED);
  2196. } else {
  2197. this.adapter_.removeClass(constants_1.cssClasses.SELECTED);
  2198. }
  2199. this.adapter_.notifySelection(selected);
  2200. };
  2201. MDCChipFoundation.prototype.getShouldRemoveOnTrailingIconClick = function() {
  2202. return this.shouldRemoveOnTrailingIconClick_;
  2203. };
  2204. MDCChipFoundation.prototype.setShouldRemoveOnTrailingIconClick = function(shouldRemove) {
  2205. this.shouldRemoveOnTrailingIconClick_ = shouldRemove;
  2206. };
  2207. MDCChipFoundation.prototype.getDimensions = function() {
  2208. var _this = this;
  2209. var getRootRect = function getRootRect() {
  2210. return _this.adapter_.getRootBoundingClientRect();
  2211. };
  2212. var getCheckmarkRect = function getCheckmarkRect() {
  2213. return _this.adapter_.getCheckmarkBoundingClientRect();
  2214. };
  2215. if (!this.adapter_.hasLeadingIcon()) {
  2216. var checkmarkRect = getCheckmarkRect();
  2217. if (checkmarkRect) {
  2218. var rootRect = getRootRect();
  2219. return {
  2220. bottom: rootRect.bottom,
  2221. height: rootRect.height,
  2222. left: rootRect.left,
  2223. right: rootRect.right,
  2224. top: rootRect.top,
  2225. width: rootRect.width + checkmarkRect.height
  2226. };
  2227. }
  2228. }
  2229. return getRootRect();
  2230. };
  2231. MDCChipFoundation.prototype.beginExit = function() {
  2232. this.adapter_.addClass(constants_1.cssClasses.CHIP_EXIT);
  2233. };
  2234. MDCChipFoundation.prototype.handleInteraction = function(evt) {
  2235. var isEnter = evt.key === "Enter" || evt.keyCode === 13;
  2236. if (evt.type === "click" || isEnter) {
  2237. this.adapter_.notifyInteraction();
  2238. }
  2239. };
  2240. MDCChipFoundation.prototype.handleTransitionEnd = function(evt) {
  2241. var _this = this;
  2242. if (this.adapter_.eventTargetHasClass(evt.target, constants_1.cssClasses.CHIP_EXIT)) {
  2243. if (evt.propertyName === "width") {
  2244. this.adapter_.notifyRemoval();
  2245. } else if (evt.propertyName === "opacity") {
  2246. var chipWidth_1 = this.adapter_.getComputedStyleValue("width");
  2247. requestAnimationFrame(function() {
  2248. _this.adapter_.setStyleProperty("width", chipWidth_1);
  2249. _this.adapter_.setStyleProperty("padding", "0");
  2250. _this.adapter_.setStyleProperty("margin", "0");
  2251. requestAnimationFrame(function() {
  2252. _this.adapter_.setStyleProperty("width", "0");
  2253. });
  2254. });
  2255. }
  2256. return;
  2257. }
  2258. if (evt.propertyName !== "opacity") {
  2259. return;
  2260. }
  2261. if (this.adapter_.eventTargetHasClass(evt.target, constants_1.cssClasses.LEADING_ICON) && this.adapter_.hasClass(constants_1.cssClasses.SELECTED)) {
  2262. this.adapter_.addClassToLeadingIcon(constants_1.cssClasses.HIDDEN_LEADING_ICON);
  2263. } else if (this.adapter_.eventTargetHasClass(evt.target, constants_1.cssClasses.CHECKMARK) && !this.adapter_.hasClass(constants_1.cssClasses.SELECTED)) {
  2264. this.adapter_.removeClassFromLeadingIcon(constants_1.cssClasses.HIDDEN_LEADING_ICON);
  2265. }
  2266. };
  2267. MDCChipFoundation.prototype.handleTrailingIconInteraction = function(evt) {
  2268. var isEnter = evt.key === "Enter" || evt.keyCode === 13;
  2269. evt.stopPropagation();
  2270. if (evt.type === "click" || isEnter) {
  2271. this.adapter_.notifyTrailingIconInteraction();
  2272. if (this.shouldRemoveOnTrailingIconClick_) {
  2273. this.beginExit();
  2274. }
  2275. }
  2276. };
  2277. return MDCChipFoundation;
  2278. }(foundation_1.MDCFoundation);
  2279. exports.MDCChipFoundation = MDCChipFoundation;
  2280. exports.default = MDCChipFoundation;
  2281. }, function(module, exports, __webpack_require__) {
  2282. "use strict";
  2283. var __extends = this && this.__extends || function() {
  2284. var _extendStatics = function extendStatics(d, b) {
  2285. _extendStatics = Object.setPrototypeOf || {
  2286. __proto__: []
  2287. } instanceof Array && function(d, b) {
  2288. d.__proto__ = b;
  2289. } || function(d, b) {
  2290. for (var p in b) {
  2291. if (b.hasOwnProperty(p)) d[p] = b[p];
  2292. }
  2293. };
  2294. return _extendStatics(d, b);
  2295. };
  2296. return function(d, b) {
  2297. _extendStatics(d, b);
  2298. function __() {
  2299. this.constructor = d;
  2300. }
  2301. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  2302. };
  2303. }();
  2304. Object.defineProperty(exports, "__esModule", {
  2305. value: true
  2306. });
  2307. var component_1 = __webpack_require__(1);
  2308. var ponyfill_1 = __webpack_require__(3);
  2309. var constants_1 = __webpack_require__(35);
  2310. var foundation_1 = __webpack_require__(5);
  2311. var MDCList = function(_super) {
  2312. __extends(MDCList, _super);
  2313. function MDCList() {
  2314. return _super !== null && _super.apply(this, arguments) || this;
  2315. }
  2316. Object.defineProperty(MDCList.prototype, "vertical", {
  2317. set: function set(value) {
  2318. this.foundation_.setVerticalOrientation(value);
  2319. },
  2320. enumerable: true,
  2321. configurable: true
  2322. });
  2323. Object.defineProperty(MDCList.prototype, "listElements", {
  2324. get: function get() {
  2325. return [].slice.call(this.root_.querySelectorAll("." + constants_1.cssClasses.LIST_ITEM_CLASS));
  2326. },
  2327. enumerable: true,
  2328. configurable: true
  2329. });
  2330. Object.defineProperty(MDCList.prototype, "wrapFocus", {
  2331. set: function set(value) {
  2332. this.foundation_.setWrapFocus(value);
  2333. },
  2334. enumerable: true,
  2335. configurable: true
  2336. });
  2337. Object.defineProperty(MDCList.prototype, "singleSelection", {
  2338. set: function set(isSingleSelectionList) {
  2339. this.foundation_.setSingleSelection(isSingleSelectionList);
  2340. },
  2341. enumerable: true,
  2342. configurable: true
  2343. });
  2344. Object.defineProperty(MDCList.prototype, "selectedIndex", {
  2345. get: function get() {
  2346. return this.foundation_.getSelectedIndex();
  2347. },
  2348. set: function set(index) {
  2349. this.foundation_.setSelectedIndex(index);
  2350. },
  2351. enumerable: true,
  2352. configurable: true
  2353. });
  2354. MDCList.attachTo = function(root) {
  2355. return new MDCList(root);
  2356. };
  2357. MDCList.prototype.initialSyncWithDOM = function() {
  2358. this.handleClick_ = this.handleClickEvent_.bind(this);
  2359. this.handleKeydown_ = this.handleKeydownEvent_.bind(this);
  2360. this.focusInEventListener_ = this.handleFocusInEvent_.bind(this);
  2361. this.focusOutEventListener_ = this.handleFocusOutEvent_.bind(this);
  2362. this.listen("keydown", this.handleKeydown_);
  2363. this.listen("click", this.handleClick_);
  2364. this.listen("focusin", this.focusInEventListener_);
  2365. this.listen("focusout", this.focusOutEventListener_);
  2366. this.layout();
  2367. this.initializeListType();
  2368. };
  2369. MDCList.prototype.destroy = function() {
  2370. this.unlisten("keydown", this.handleKeydown_);
  2371. this.unlisten("click", this.handleClick_);
  2372. this.unlisten("focusin", this.focusInEventListener_);
  2373. this.unlisten("focusout", this.focusOutEventListener_);
  2374. };
  2375. MDCList.prototype.layout = function() {
  2376. var direction = this.root_.getAttribute(constants_1.strings.ARIA_ORIENTATION);
  2377. this.vertical = direction !== constants_1.strings.ARIA_ORIENTATION_HORIZONTAL;
  2378. [].slice.call(this.root_.querySelectorAll(".mdc-list-item:not([tabindex])")).forEach(function(el) {
  2379. el.setAttribute("tabindex", "-1");
  2380. });
  2381. [].slice.call(this.root_.querySelectorAll(constants_1.strings.FOCUSABLE_CHILD_ELEMENTS)).forEach(function(el) {
  2382. return el.setAttribute("tabindex", "-1");
  2383. });
  2384. this.foundation_.layout();
  2385. };
  2386. MDCList.prototype.initializeListType = function() {
  2387. var _this = this;
  2388. var checkboxListItems = this.root_.querySelectorAll(constants_1.strings.ARIA_ROLE_CHECKBOX_SELECTOR);
  2389. var singleSelectedListItem = this.root_.querySelector("\n ." + constants_1.cssClasses.LIST_ITEM_ACTIVATED_CLASS + ",\n ." + constants_1.cssClasses.LIST_ITEM_SELECTED_CLASS + "\n ");
  2390. var radioSelectedListItem = this.root_.querySelector(constants_1.strings.ARIA_CHECKED_RADIO_SELECTOR);
  2391. if (checkboxListItems.length) {
  2392. var preselectedItems = this.root_.querySelectorAll(constants_1.strings.ARIA_CHECKED_CHECKBOX_SELECTOR);
  2393. this.selectedIndex = [].map.call(preselectedItems, function(listItem) {
  2394. return _this.listElements.indexOf(listItem);
  2395. });
  2396. } else if (singleSelectedListItem) {
  2397. if (singleSelectedListItem.classList.contains(constants_1.cssClasses.LIST_ITEM_ACTIVATED_CLASS)) {
  2398. this.foundation_.setUseActivatedClass(true);
  2399. }
  2400. this.singleSelection = true;
  2401. this.selectedIndex = this.listElements.indexOf(singleSelectedListItem);
  2402. } else if (radioSelectedListItem) {
  2403. this.selectedIndex = this.listElements.indexOf(radioSelectedListItem);
  2404. }
  2405. };
  2406. MDCList.prototype.getDefaultFoundation = function() {
  2407. var _this = this;
  2408. var adapter = {
  2409. addClassForElementIndex: function addClassForElementIndex(index, className) {
  2410. var element = _this.listElements[index];
  2411. if (element) {
  2412. element.classList.add(className);
  2413. }
  2414. },
  2415. focusItemAtIndex: function focusItemAtIndex(index) {
  2416. var element = _this.listElements[index];
  2417. if (element) {
  2418. element.focus();
  2419. }
  2420. },
  2421. getAttributeForElementIndex: function getAttributeForElementIndex(index, attr) {
  2422. return _this.listElements[index].getAttribute(attr);
  2423. },
  2424. getFocusedElementIndex: function getFocusedElementIndex() {
  2425. return _this.listElements.indexOf(document.activeElement);
  2426. },
  2427. getListItemCount: function getListItemCount() {
  2428. return _this.listElements.length;
  2429. },
  2430. hasCheckboxAtIndex: function hasCheckboxAtIndex(index) {
  2431. var listItem = _this.listElements[index];
  2432. return !!listItem.querySelector(constants_1.strings.CHECKBOX_SELECTOR);
  2433. },
  2434. hasRadioAtIndex: function hasRadioAtIndex(index) {
  2435. var listItem = _this.listElements[index];
  2436. return !!listItem.querySelector(constants_1.strings.RADIO_SELECTOR);
  2437. },
  2438. isCheckboxCheckedAtIndex: function isCheckboxCheckedAtIndex(index) {
  2439. var listItem = _this.listElements[index];
  2440. var toggleEl = listItem.querySelector(constants_1.strings.CHECKBOX_SELECTOR);
  2441. return toggleEl.checked;
  2442. },
  2443. isFocusInsideList: function isFocusInsideList() {
  2444. return _this.root_.contains(document.activeElement);
  2445. },
  2446. isRootFocused: function isRootFocused() {
  2447. return document.activeElement === _this.root_;
  2448. },
  2449. notifyAction: function notifyAction(index) {
  2450. _this.emit(constants_1.strings.ACTION_EVENT, {
  2451. index: index
  2452. }, true);
  2453. },
  2454. removeClassForElementIndex: function removeClassForElementIndex(index, className) {
  2455. var element = _this.listElements[index];
  2456. if (element) {
  2457. element.classList.remove(className);
  2458. }
  2459. },
  2460. setAttributeForElementIndex: function setAttributeForElementIndex(index, attr, value) {
  2461. var element = _this.listElements[index];
  2462. if (element) {
  2463. element.setAttribute(attr, value);
  2464. }
  2465. },
  2466. setCheckedCheckboxOrRadioAtIndex: function setCheckedCheckboxOrRadioAtIndex(index, isChecked) {
  2467. var listItem = _this.listElements[index];
  2468. var toggleEl = listItem.querySelector(constants_1.strings.CHECKBOX_RADIO_SELECTOR);
  2469. toggleEl.checked = isChecked;
  2470. var event = document.createEvent("Event");
  2471. event.initEvent("change", true, true);
  2472. toggleEl.dispatchEvent(event);
  2473. },
  2474. setTabIndexForListItemChildren: function setTabIndexForListItemChildren(listItemIndex, tabIndexValue) {
  2475. var element = _this.listElements[listItemIndex];
  2476. var listItemChildren = [].slice.call(element.querySelectorAll(constants_1.strings.CHILD_ELEMENTS_TO_TOGGLE_TABINDEX));
  2477. listItemChildren.forEach(function(el) {
  2478. return el.setAttribute("tabindex", tabIndexValue);
  2479. });
  2480. }
  2481. };
  2482. return new foundation_1.MDCListFoundation(adapter);
  2483. };
  2484. MDCList.prototype.getListItemIndex_ = function(evt) {
  2485. var eventTarget = evt.target;
  2486. var nearestParent = ponyfill_1.closest(eventTarget, "." + constants_1.cssClasses.LIST_ITEM_CLASS + ", ." + constants_1.cssClasses.ROOT);
  2487. if (nearestParent && ponyfill_1.matches(nearestParent, "." + constants_1.cssClasses.LIST_ITEM_CLASS)) {
  2488. return this.listElements.indexOf(nearestParent);
  2489. }
  2490. return -1;
  2491. };
  2492. MDCList.prototype.handleFocusInEvent_ = function(evt) {
  2493. var index = this.getListItemIndex_(evt);
  2494. this.foundation_.handleFocusIn(evt, index);
  2495. };
  2496. MDCList.prototype.handleFocusOutEvent_ = function(evt) {
  2497. var index = this.getListItemIndex_(evt);
  2498. this.foundation_.handleFocusOut(evt, index);
  2499. };
  2500. MDCList.prototype.handleKeydownEvent_ = function(evt) {
  2501. var index = this.getListItemIndex_(evt);
  2502. var target = evt.target;
  2503. this.foundation_.handleKeydown(evt, target.classList.contains(constants_1.cssClasses.LIST_ITEM_CLASS), index);
  2504. };
  2505. MDCList.prototype.handleClickEvent_ = function(evt) {
  2506. var index = this.getListItemIndex_(evt);
  2507. var target = evt.target;
  2508. var toggleCheckbox = !ponyfill_1.matches(target, constants_1.strings.CHECKBOX_RADIO_SELECTOR);
  2509. this.foundation_.handleClick(index, toggleCheckbox);
  2510. };
  2511. return MDCList;
  2512. }(component_1.MDCComponent);
  2513. exports.MDCList = MDCList;
  2514. }, function(module, exports, __webpack_require__) {
  2515. "use strict";
  2516. var __extends = this && this.__extends || function() {
  2517. var _extendStatics = function extendStatics(d, b) {
  2518. _extendStatics = Object.setPrototypeOf || {
  2519. __proto__: []
  2520. } instanceof Array && function(d, b) {
  2521. d.__proto__ = b;
  2522. } || function(d, b) {
  2523. for (var p in b) {
  2524. if (b.hasOwnProperty(p)) d[p] = b[p];
  2525. }
  2526. };
  2527. return _extendStatics(d, b);
  2528. };
  2529. return function(d, b) {
  2530. _extendStatics(d, b);
  2531. function __() {
  2532. this.constructor = d;
  2533. }
  2534. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  2535. };
  2536. }();
  2537. var __assign = this && this.__assign || function() {
  2538. __assign = Object.assign || function(t) {
  2539. for (var s, i = 1, n = arguments.length; i < n; i++) {
  2540. s = arguments[i];
  2541. for (var p in s) {
  2542. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  2543. }
  2544. }
  2545. return t;
  2546. };
  2547. return __assign.apply(this, arguments);
  2548. };
  2549. Object.defineProperty(exports, "__esModule", {
  2550. value: true
  2551. });
  2552. var foundation_1 = __webpack_require__(0);
  2553. var constants_1 = __webpack_require__(101);
  2554. var MDCDismissibleDrawerFoundation = function(_super) {
  2555. __extends(MDCDismissibleDrawerFoundation, _super);
  2556. function MDCDismissibleDrawerFoundation(adapter) {
  2557. var _this = _super.call(this, __assign({}, MDCDismissibleDrawerFoundation.defaultAdapter, adapter)) || this;
  2558. _this.animationFrame_ = 0;
  2559. _this.animationTimer_ = 0;
  2560. return _this;
  2561. }
  2562. Object.defineProperty(MDCDismissibleDrawerFoundation, "strings", {
  2563. get: function get() {
  2564. return constants_1.strings;
  2565. },
  2566. enumerable: true,
  2567. configurable: true
  2568. });
  2569. Object.defineProperty(MDCDismissibleDrawerFoundation, "cssClasses", {
  2570. get: function get() {
  2571. return constants_1.cssClasses;
  2572. },
  2573. enumerable: true,
  2574. configurable: true
  2575. });
  2576. Object.defineProperty(MDCDismissibleDrawerFoundation, "defaultAdapter", {
  2577. get: function get() {
  2578. return {
  2579. addClass: function addClass() {
  2580. return undefined;
  2581. },
  2582. removeClass: function removeClass() {
  2583. return undefined;
  2584. },
  2585. hasClass: function hasClass() {
  2586. return false;
  2587. },
  2588. elementHasClass: function elementHasClass() {
  2589. return false;
  2590. },
  2591. notifyClose: function notifyClose() {
  2592. return undefined;
  2593. },
  2594. notifyOpen: function notifyOpen() {
  2595. return undefined;
  2596. },
  2597. saveFocus: function saveFocus() {
  2598. return undefined;
  2599. },
  2600. restoreFocus: function restoreFocus() {
  2601. return undefined;
  2602. },
  2603. focusActiveNavigationItem: function focusActiveNavigationItem() {
  2604. return undefined;
  2605. },
  2606. trapFocus: function trapFocus() {
  2607. return undefined;
  2608. },
  2609. releaseFocus: function releaseFocus() {
  2610. return undefined;
  2611. }
  2612. };
  2613. },
  2614. enumerable: true,
  2615. configurable: true
  2616. });
  2617. MDCDismissibleDrawerFoundation.prototype.destroy = function() {
  2618. if (this.animationFrame_) {
  2619. cancelAnimationFrame(this.animationFrame_);
  2620. }
  2621. if (this.animationTimer_) {
  2622. clearTimeout(this.animationTimer_);
  2623. }
  2624. };
  2625. MDCDismissibleDrawerFoundation.prototype.open = function() {
  2626. var _this = this;
  2627. if (this.isOpen() || this.isOpening() || this.isClosing()) {
  2628. return;
  2629. }
  2630. this.adapter_.addClass(constants_1.cssClasses.OPEN);
  2631. this.adapter_.addClass(constants_1.cssClasses.ANIMATE);
  2632. this.runNextAnimationFrame_(function() {
  2633. _this.adapter_.addClass(constants_1.cssClasses.OPENING);
  2634. });
  2635. this.adapter_.saveFocus();
  2636. };
  2637. MDCDismissibleDrawerFoundation.prototype.close = function() {
  2638. if (!this.isOpen() || this.isOpening() || this.isClosing()) {
  2639. return;
  2640. }
  2641. this.adapter_.addClass(constants_1.cssClasses.CLOSING);
  2642. };
  2643. MDCDismissibleDrawerFoundation.prototype.isOpen = function() {
  2644. return this.adapter_.hasClass(constants_1.cssClasses.OPEN);
  2645. };
  2646. MDCDismissibleDrawerFoundation.prototype.isOpening = function() {
  2647. return this.adapter_.hasClass(constants_1.cssClasses.OPENING) || this.adapter_.hasClass(constants_1.cssClasses.ANIMATE);
  2648. };
  2649. MDCDismissibleDrawerFoundation.prototype.isClosing = function() {
  2650. return this.adapter_.hasClass(constants_1.cssClasses.CLOSING);
  2651. };
  2652. MDCDismissibleDrawerFoundation.prototype.handleKeydown = function(evt) {
  2653. var keyCode = evt.keyCode, key = evt.key;
  2654. var isEscape = key === "Escape" || keyCode === 27;
  2655. if (isEscape) {
  2656. this.close();
  2657. }
  2658. };
  2659. MDCDismissibleDrawerFoundation.prototype.handleTransitionEnd = function(evt) {
  2660. var OPENING = constants_1.cssClasses.OPENING, CLOSING = constants_1.cssClasses.CLOSING, OPEN = constants_1.cssClasses.OPEN, ANIMATE = constants_1.cssClasses.ANIMATE, ROOT = constants_1.cssClasses.ROOT;
  2661. var isRootElement = this.isElement_(evt.target) && this.adapter_.elementHasClass(evt.target, ROOT);
  2662. if (!isRootElement) {
  2663. return;
  2664. }
  2665. if (this.isClosing()) {
  2666. this.adapter_.removeClass(OPEN);
  2667. this.closed_();
  2668. this.adapter_.restoreFocus();
  2669. this.adapter_.notifyClose();
  2670. } else {
  2671. this.adapter_.focusActiveNavigationItem();
  2672. this.opened_();
  2673. this.adapter_.notifyOpen();
  2674. }
  2675. this.adapter_.removeClass(ANIMATE);
  2676. this.adapter_.removeClass(OPENING);
  2677. this.adapter_.removeClass(CLOSING);
  2678. };
  2679. MDCDismissibleDrawerFoundation.prototype.opened_ = function() {};
  2680. MDCDismissibleDrawerFoundation.prototype.closed_ = function() {};
  2681. MDCDismissibleDrawerFoundation.prototype.runNextAnimationFrame_ = function(callback) {
  2682. var _this = this;
  2683. cancelAnimationFrame(this.animationFrame_);
  2684. this.animationFrame_ = requestAnimationFrame(function() {
  2685. _this.animationFrame_ = 0;
  2686. clearTimeout(_this.animationTimer_);
  2687. _this.animationTimer_ = setTimeout(callback, 0);
  2688. });
  2689. };
  2690. MDCDismissibleDrawerFoundation.prototype.isElement_ = function(element) {
  2691. return Boolean(element.classList);
  2692. };
  2693. return MDCDismissibleDrawerFoundation;
  2694. }(foundation_1.MDCFoundation);
  2695. exports.MDCDismissibleDrawerFoundation = MDCDismissibleDrawerFoundation;
  2696. exports.default = MDCDismissibleDrawerFoundation;
  2697. }, function(module, exports, __webpack_require__) {
  2698. "use strict";
  2699. var __extends = this && this.__extends || function() {
  2700. var _extendStatics = function extendStatics(d, b) {
  2701. _extendStatics = Object.setPrototypeOf || {
  2702. __proto__: []
  2703. } instanceof Array && function(d, b) {
  2704. d.__proto__ = b;
  2705. } || function(d, b) {
  2706. for (var p in b) {
  2707. if (b.hasOwnProperty(p)) d[p] = b[p];
  2708. }
  2709. };
  2710. return _extendStatics(d, b);
  2711. };
  2712. return function(d, b) {
  2713. _extendStatics(d, b);
  2714. function __() {
  2715. this.constructor = d;
  2716. }
  2717. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  2718. };
  2719. }();
  2720. Object.defineProperty(exports, "__esModule", {
  2721. value: true
  2722. });
  2723. var component_1 = __webpack_require__(1);
  2724. var foundation_1 = __webpack_require__(16);
  2725. var MDCFloatingLabel = function(_super) {
  2726. __extends(MDCFloatingLabel, _super);
  2727. function MDCFloatingLabel() {
  2728. return _super !== null && _super.apply(this, arguments) || this;
  2729. }
  2730. MDCFloatingLabel.attachTo = function(root) {
  2731. return new MDCFloatingLabel(root);
  2732. };
  2733. MDCFloatingLabel.prototype.shake = function(shouldShake) {
  2734. this.foundation_.shake(shouldShake);
  2735. };
  2736. MDCFloatingLabel.prototype.float = function(shouldFloat) {
  2737. this.foundation_.float(shouldFloat);
  2738. };
  2739. MDCFloatingLabel.prototype.getWidth = function() {
  2740. return this.foundation_.getWidth();
  2741. };
  2742. MDCFloatingLabel.prototype.getDefaultFoundation = function() {
  2743. var _this = this;
  2744. var adapter = {
  2745. addClass: function addClass(className) {
  2746. return _this.root_.classList.add(className);
  2747. },
  2748. removeClass: function removeClass(className) {
  2749. return _this.root_.classList.remove(className);
  2750. },
  2751. getWidth: function getWidth() {
  2752. return _this.root_.scrollWidth;
  2753. },
  2754. registerInteractionHandler: function registerInteractionHandler(evtType, handler) {
  2755. return _this.listen(evtType, handler);
  2756. },
  2757. deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) {
  2758. return _this.unlisten(evtType, handler);
  2759. }
  2760. };
  2761. return new foundation_1.MDCFloatingLabelFoundation(adapter);
  2762. };
  2763. return MDCFloatingLabel;
  2764. }(component_1.MDCComponent);
  2765. exports.MDCFloatingLabel = MDCFloatingLabel;
  2766. }, function(module, exports, __webpack_require__) {
  2767. "use strict";
  2768. var __extends = this && this.__extends || function() {
  2769. var _extendStatics = function extendStatics(d, b) {
  2770. _extendStatics = Object.setPrototypeOf || {
  2771. __proto__: []
  2772. } instanceof Array && function(d, b) {
  2773. d.__proto__ = b;
  2774. } || function(d, b) {
  2775. for (var p in b) {
  2776. if (b.hasOwnProperty(p)) d[p] = b[p];
  2777. }
  2778. };
  2779. return _extendStatics(d, b);
  2780. };
  2781. return function(d, b) {
  2782. _extendStatics(d, b);
  2783. function __() {
  2784. this.constructor = d;
  2785. }
  2786. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  2787. };
  2788. }();
  2789. var __assign = this && this.__assign || function() {
  2790. __assign = Object.assign || function(t) {
  2791. for (var s, i = 1, n = arguments.length; i < n; i++) {
  2792. s = arguments[i];
  2793. for (var p in s) {
  2794. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  2795. }
  2796. }
  2797. return t;
  2798. };
  2799. return __assign.apply(this, arguments);
  2800. };
  2801. Object.defineProperty(exports, "__esModule", {
  2802. value: true
  2803. });
  2804. var foundation_1 = __webpack_require__(0);
  2805. var constants_1 = __webpack_require__(103);
  2806. var MDCFloatingLabelFoundation = function(_super) {
  2807. __extends(MDCFloatingLabelFoundation, _super);
  2808. function MDCFloatingLabelFoundation(adapter) {
  2809. var _this = _super.call(this, __assign({}, MDCFloatingLabelFoundation.defaultAdapter, adapter)) || this;
  2810. _this.shakeAnimationEndHandler_ = function() {
  2811. return _this.handleShakeAnimationEnd_();
  2812. };
  2813. return _this;
  2814. }
  2815. Object.defineProperty(MDCFloatingLabelFoundation, "cssClasses", {
  2816. get: function get() {
  2817. return constants_1.cssClasses;
  2818. },
  2819. enumerable: true,
  2820. configurable: true
  2821. });
  2822. Object.defineProperty(MDCFloatingLabelFoundation, "defaultAdapter", {
  2823. get: function get() {
  2824. return {
  2825. addClass: function addClass() {
  2826. return undefined;
  2827. },
  2828. removeClass: function removeClass() {
  2829. return undefined;
  2830. },
  2831. getWidth: function getWidth() {
  2832. return 0;
  2833. },
  2834. registerInteractionHandler: function registerInteractionHandler() {
  2835. return undefined;
  2836. },
  2837. deregisterInteractionHandler: function deregisterInteractionHandler() {
  2838. return undefined;
  2839. }
  2840. };
  2841. },
  2842. enumerable: true,
  2843. configurable: true
  2844. });
  2845. MDCFloatingLabelFoundation.prototype.init = function() {
  2846. this.adapter_.registerInteractionHandler("animationend", this.shakeAnimationEndHandler_);
  2847. };
  2848. MDCFloatingLabelFoundation.prototype.destroy = function() {
  2849. this.adapter_.deregisterInteractionHandler("animationend", this.shakeAnimationEndHandler_);
  2850. };
  2851. MDCFloatingLabelFoundation.prototype.getWidth = function() {
  2852. return this.adapter_.getWidth();
  2853. };
  2854. MDCFloatingLabelFoundation.prototype.shake = function(shouldShake) {
  2855. var LABEL_SHAKE = MDCFloatingLabelFoundation.cssClasses.LABEL_SHAKE;
  2856. if (shouldShake) {
  2857. this.adapter_.addClass(LABEL_SHAKE);
  2858. } else {
  2859. this.adapter_.removeClass(LABEL_SHAKE);
  2860. }
  2861. };
  2862. MDCFloatingLabelFoundation.prototype.float = function(shouldFloat) {
  2863. var _a = MDCFloatingLabelFoundation.cssClasses, LABEL_FLOAT_ABOVE = _a.LABEL_FLOAT_ABOVE, LABEL_SHAKE = _a.LABEL_SHAKE;
  2864. if (shouldFloat) {
  2865. this.adapter_.addClass(LABEL_FLOAT_ABOVE);
  2866. } else {
  2867. this.adapter_.removeClass(LABEL_FLOAT_ABOVE);
  2868. this.adapter_.removeClass(LABEL_SHAKE);
  2869. }
  2870. };
  2871. MDCFloatingLabelFoundation.prototype.handleShakeAnimationEnd_ = function() {
  2872. var LABEL_SHAKE = MDCFloatingLabelFoundation.cssClasses.LABEL_SHAKE;
  2873. this.adapter_.removeClass(LABEL_SHAKE);
  2874. };
  2875. return MDCFloatingLabelFoundation;
  2876. }(foundation_1.MDCFoundation);
  2877. exports.MDCFloatingLabelFoundation = MDCFloatingLabelFoundation;
  2878. exports.default = MDCFloatingLabelFoundation;
  2879. }, function(module, exports, __webpack_require__) {
  2880. "use strict";
  2881. var __extends = this && this.__extends || function() {
  2882. var _extendStatics = function extendStatics(d, b) {
  2883. _extendStatics = Object.setPrototypeOf || {
  2884. __proto__: []
  2885. } instanceof Array && function(d, b) {
  2886. d.__proto__ = b;
  2887. } || function(d, b) {
  2888. for (var p in b) {
  2889. if (b.hasOwnProperty(p)) d[p] = b[p];
  2890. }
  2891. };
  2892. return _extendStatics(d, b);
  2893. };
  2894. return function(d, b) {
  2895. _extendStatics(d, b);
  2896. function __() {
  2897. this.constructor = d;
  2898. }
  2899. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  2900. };
  2901. }();
  2902. Object.defineProperty(exports, "__esModule", {
  2903. value: true
  2904. });
  2905. var component_1 = __webpack_require__(1);
  2906. var foundation_1 = __webpack_require__(40);
  2907. var MDCLineRipple = function(_super) {
  2908. __extends(MDCLineRipple, _super);
  2909. function MDCLineRipple() {
  2910. return _super !== null && _super.apply(this, arguments) || this;
  2911. }
  2912. MDCLineRipple.attachTo = function(root) {
  2913. return new MDCLineRipple(root);
  2914. };
  2915. MDCLineRipple.prototype.activate = function() {
  2916. this.foundation_.activate();
  2917. };
  2918. MDCLineRipple.prototype.deactivate = function() {
  2919. this.foundation_.deactivate();
  2920. };
  2921. MDCLineRipple.prototype.setRippleCenter = function(xCoordinate) {
  2922. this.foundation_.setRippleCenter(xCoordinate);
  2923. };
  2924. MDCLineRipple.prototype.getDefaultFoundation = function() {
  2925. var _this = this;
  2926. var adapter = {
  2927. addClass: function addClass(className) {
  2928. return _this.root_.classList.add(className);
  2929. },
  2930. removeClass: function removeClass(className) {
  2931. return _this.root_.classList.remove(className);
  2932. },
  2933. hasClass: function hasClass(className) {
  2934. return _this.root_.classList.contains(className);
  2935. },
  2936. setStyle: function setStyle(propertyName, value) {
  2937. return _this.root_.style.setProperty(propertyName, value);
  2938. },
  2939. registerEventHandler: function registerEventHandler(evtType, handler) {
  2940. return _this.listen(evtType, handler);
  2941. },
  2942. deregisterEventHandler: function deregisterEventHandler(evtType, handler) {
  2943. return _this.unlisten(evtType, handler);
  2944. }
  2945. };
  2946. return new foundation_1.MDCLineRippleFoundation(adapter);
  2947. };
  2948. return MDCLineRipple;
  2949. }(component_1.MDCComponent);
  2950. exports.MDCLineRipple = MDCLineRipple;
  2951. }, function(module, exports, __webpack_require__) {
  2952. "use strict";
  2953. Object.defineProperty(exports, "__esModule", {
  2954. value: true
  2955. });
  2956. var cssClasses = {
  2957. MENU_SELECTED_LIST_ITEM: "mdc-menu-item--selected",
  2958. MENU_SELECTION_GROUP: "mdc-menu__selection-group",
  2959. ROOT: "mdc-menu"
  2960. };
  2961. exports.cssClasses = cssClasses;
  2962. var strings = {
  2963. ARIA_SELECTED_ATTR: "aria-selected",
  2964. CHECKBOX_SELECTOR: 'input[type="checkbox"]',
  2965. LIST_SELECTOR: ".mdc-list",
  2966. SELECTED_EVENT: "MDCMenu:selected"
  2967. };
  2968. exports.strings = strings;
  2969. var numbers = {
  2970. FOCUS_ROOT_INDEX: -1
  2971. };
  2972. exports.numbers = numbers;
  2973. var DefaultFocusState;
  2974. (function(DefaultFocusState) {
  2975. DefaultFocusState[DefaultFocusState["NONE"] = 0] = "NONE";
  2976. DefaultFocusState[DefaultFocusState["LIST_ROOT"] = 1] = "LIST_ROOT";
  2977. DefaultFocusState[DefaultFocusState["FIRST_ITEM"] = 2] = "FIRST_ITEM";
  2978. DefaultFocusState[DefaultFocusState["LAST_ITEM"] = 3] = "LAST_ITEM";
  2979. })(DefaultFocusState || (DefaultFocusState = {}));
  2980. exports.DefaultFocusState = DefaultFocusState;
  2981. }, function(module, exports, __webpack_require__) {
  2982. "use strict";
  2983. var __extends = this && this.__extends || function() {
  2984. var _extendStatics = function extendStatics(d, b) {
  2985. _extendStatics = Object.setPrototypeOf || {
  2986. __proto__: []
  2987. } instanceof Array && function(d, b) {
  2988. d.__proto__ = b;
  2989. } || function(d, b) {
  2990. for (var p in b) {
  2991. if (b.hasOwnProperty(p)) d[p] = b[p];
  2992. }
  2993. };
  2994. return _extendStatics(d, b);
  2995. };
  2996. return function(d, b) {
  2997. _extendStatics(d, b);
  2998. function __() {
  2999. this.constructor = d;
  3000. }
  3001. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  3002. };
  3003. }();
  3004. Object.defineProperty(exports, "__esModule", {
  3005. value: true
  3006. });
  3007. var component_1 = __webpack_require__(1);
  3008. var foundation_1 = __webpack_require__(16);
  3009. var constants_1 = __webpack_require__(46);
  3010. var foundation_2 = __webpack_require__(47);
  3011. var MDCNotchedOutline = function(_super) {
  3012. __extends(MDCNotchedOutline, _super);
  3013. function MDCNotchedOutline() {
  3014. return _super !== null && _super.apply(this, arguments) || this;
  3015. }
  3016. MDCNotchedOutline.attachTo = function(root) {
  3017. return new MDCNotchedOutline(root);
  3018. };
  3019. MDCNotchedOutline.prototype.initialSyncWithDOM = function() {
  3020. this.notchElement_ = this.root_.querySelector(constants_1.strings.NOTCH_ELEMENT_SELECTOR);
  3021. var label = this.root_.querySelector("." + foundation_1.MDCFloatingLabelFoundation.cssClasses.ROOT);
  3022. if (label) {
  3023. label.style.transitionDuration = "0s";
  3024. this.root_.classList.add(constants_1.cssClasses.OUTLINE_UPGRADED);
  3025. requestAnimationFrame(function() {
  3026. label.style.transitionDuration = "";
  3027. });
  3028. } else {
  3029. this.root_.classList.add(constants_1.cssClasses.NO_LABEL);
  3030. }
  3031. };
  3032. MDCNotchedOutline.prototype.notch = function(notchWidth) {
  3033. this.foundation_.notch(notchWidth);
  3034. };
  3035. MDCNotchedOutline.prototype.closeNotch = function() {
  3036. this.foundation_.closeNotch();
  3037. };
  3038. MDCNotchedOutline.prototype.getDefaultFoundation = function() {
  3039. var _this = this;
  3040. var adapter = {
  3041. addClass: function addClass(className) {
  3042. return _this.root_.classList.add(className);
  3043. },
  3044. removeClass: function removeClass(className) {
  3045. return _this.root_.classList.remove(className);
  3046. },
  3047. setNotchWidthProperty: function setNotchWidthProperty(width) {
  3048. return _this.notchElement_.style.setProperty("width", width + "px");
  3049. },
  3050. removeNotchWidthProperty: function removeNotchWidthProperty() {
  3051. return _this.notchElement_.style.removeProperty("width");
  3052. }
  3053. };
  3054. return new foundation_2.MDCNotchedOutlineFoundation(adapter);
  3055. };
  3056. return MDCNotchedOutline;
  3057. }(component_1.MDCComponent);
  3058. exports.MDCNotchedOutline = MDCNotchedOutline;
  3059. }, function(module, exports, __webpack_require__) {
  3060. "use strict";
  3061. Object.defineProperty(exports, "__esModule", {
  3062. value: true
  3063. });
  3064. var cssClasses = {
  3065. CLOSING: "mdc-snackbar--closing",
  3066. OPEN: "mdc-snackbar--open",
  3067. OPENING: "mdc-snackbar--opening"
  3068. };
  3069. exports.cssClasses = cssClasses;
  3070. var strings = {
  3071. ACTION_SELECTOR: ".mdc-snackbar__action",
  3072. ARIA_LIVE_LABEL_TEXT_ATTR: "data-mdc-snackbar-label-text",
  3073. CLOSED_EVENT: "MDCSnackbar:closed",
  3074. CLOSING_EVENT: "MDCSnackbar:closing",
  3075. DISMISS_SELECTOR: ".mdc-snackbar__dismiss",
  3076. LABEL_SELECTOR: ".mdc-snackbar__label",
  3077. OPENED_EVENT: "MDCSnackbar:opened",
  3078. OPENING_EVENT: "MDCSnackbar:opening",
  3079. REASON_ACTION: "action",
  3080. REASON_DISMISS: "dismiss",
  3081. SURFACE_SELECTOR: ".mdc-snackbar__surface"
  3082. };
  3083. exports.strings = strings;
  3084. var numbers = {
  3085. DEFAULT_AUTO_DISMISS_TIMEOUT_MS: 5e3,
  3086. MAX_AUTO_DISMISS_TIMEOUT_MS: 1e4,
  3087. MIN_AUTO_DISMISS_TIMEOUT_MS: 4e3,
  3088. SNACKBAR_ANIMATION_CLOSE_TIME_MS: 75,
  3089. SNACKBAR_ANIMATION_OPEN_TIME_MS: 150,
  3090. ARIA_LIVE_DELAY_MS: 1e3
  3091. };
  3092. exports.numbers = numbers;
  3093. }, function(module, exports, __webpack_require__) {
  3094. "use strict";
  3095. Object.defineProperty(exports, "__esModule", {
  3096. value: true
  3097. });
  3098. var MDCTabScrollerRTL = function() {
  3099. function MDCTabScrollerRTL(adapter) {
  3100. this.adapter_ = adapter;
  3101. }
  3102. return MDCTabScrollerRTL;
  3103. }();
  3104. exports.MDCTabScrollerRTL = MDCTabScrollerRTL;
  3105. exports.default = MDCTabScrollerRTL;
  3106. }, function(module, exports, __webpack_require__) {
  3107. "use strict";
  3108. var __extends = this && this.__extends || function() {
  3109. var _extendStatics = function extendStatics(d, b) {
  3110. _extendStatics = Object.setPrototypeOf || {
  3111. __proto__: []
  3112. } instanceof Array && function(d, b) {
  3113. d.__proto__ = b;
  3114. } || function(d, b) {
  3115. for (var p in b) {
  3116. if (b.hasOwnProperty(p)) d[p] = b[p];
  3117. }
  3118. };
  3119. return _extendStatics(d, b);
  3120. };
  3121. return function(d, b) {
  3122. _extendStatics(d, b);
  3123. function __() {
  3124. this.constructor = d;
  3125. }
  3126. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  3127. };
  3128. }();
  3129. var __assign = this && this.__assign || function() {
  3130. __assign = Object.assign || function(t) {
  3131. for (var s, i = 1, n = arguments.length; i < n; i++) {
  3132. s = arguments[i];
  3133. for (var p in s) {
  3134. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  3135. }
  3136. }
  3137. return t;
  3138. };
  3139. return __assign.apply(this, arguments);
  3140. };
  3141. Object.defineProperty(exports, "__esModule", {
  3142. value: true
  3143. });
  3144. var foundation_1 = __webpack_require__(0);
  3145. var constants_1 = __webpack_require__(145);
  3146. var MDCTabFoundation = function(_super) {
  3147. __extends(MDCTabFoundation, _super);
  3148. function MDCTabFoundation(adapter) {
  3149. var _this = _super.call(this, __assign({}, MDCTabFoundation.defaultAdapter, adapter)) || this;
  3150. _this.focusOnActivate_ = true;
  3151. return _this;
  3152. }
  3153. Object.defineProperty(MDCTabFoundation, "cssClasses", {
  3154. get: function get() {
  3155. return constants_1.cssClasses;
  3156. },
  3157. enumerable: true,
  3158. configurable: true
  3159. });
  3160. Object.defineProperty(MDCTabFoundation, "strings", {
  3161. get: function get() {
  3162. return constants_1.strings;
  3163. },
  3164. enumerable: true,
  3165. configurable: true
  3166. });
  3167. Object.defineProperty(MDCTabFoundation, "defaultAdapter", {
  3168. get: function get() {
  3169. return {
  3170. addClass: function addClass() {
  3171. return undefined;
  3172. },
  3173. removeClass: function removeClass() {
  3174. return undefined;
  3175. },
  3176. hasClass: function hasClass() {
  3177. return false;
  3178. },
  3179. setAttr: function setAttr() {
  3180. return undefined;
  3181. },
  3182. activateIndicator: function activateIndicator() {
  3183. return undefined;
  3184. },
  3185. deactivateIndicator: function deactivateIndicator() {
  3186. return undefined;
  3187. },
  3188. notifyInteracted: function notifyInteracted() {
  3189. return undefined;
  3190. },
  3191. getOffsetLeft: function getOffsetLeft() {
  3192. return 0;
  3193. },
  3194. getOffsetWidth: function getOffsetWidth() {
  3195. return 0;
  3196. },
  3197. getContentOffsetLeft: function getContentOffsetLeft() {
  3198. return 0;
  3199. },
  3200. getContentOffsetWidth: function getContentOffsetWidth() {
  3201. return 0;
  3202. },
  3203. focus: function focus() {
  3204. return undefined;
  3205. }
  3206. };
  3207. },
  3208. enumerable: true,
  3209. configurable: true
  3210. });
  3211. MDCTabFoundation.prototype.handleClick = function() {
  3212. this.adapter_.notifyInteracted();
  3213. };
  3214. MDCTabFoundation.prototype.isActive = function() {
  3215. return this.adapter_.hasClass(constants_1.cssClasses.ACTIVE);
  3216. };
  3217. MDCTabFoundation.prototype.setFocusOnActivate = function(focusOnActivate) {
  3218. this.focusOnActivate_ = focusOnActivate;
  3219. };
  3220. MDCTabFoundation.prototype.activate = function(previousIndicatorClientRect) {
  3221. this.adapter_.addClass(constants_1.cssClasses.ACTIVE);
  3222. this.adapter_.setAttr(constants_1.strings.ARIA_SELECTED, "true");
  3223. this.adapter_.setAttr(constants_1.strings.TABINDEX, "0");
  3224. this.adapter_.activateIndicator(previousIndicatorClientRect);
  3225. if (this.focusOnActivate_) {
  3226. this.adapter_.focus();
  3227. }
  3228. };
  3229. MDCTabFoundation.prototype.deactivate = function() {
  3230. if (!this.isActive()) {
  3231. return;
  3232. }
  3233. this.adapter_.removeClass(constants_1.cssClasses.ACTIVE);
  3234. this.adapter_.setAttr(constants_1.strings.ARIA_SELECTED, "false");
  3235. this.adapter_.setAttr(constants_1.strings.TABINDEX, "-1");
  3236. this.adapter_.deactivateIndicator();
  3237. };
  3238. MDCTabFoundation.prototype.computeDimensions = function() {
  3239. var rootWidth = this.adapter_.getOffsetWidth();
  3240. var rootLeft = this.adapter_.getOffsetLeft();
  3241. var contentWidth = this.adapter_.getContentOffsetWidth();
  3242. var contentLeft = this.adapter_.getContentOffsetLeft();
  3243. return {
  3244. contentLeft: rootLeft + contentLeft,
  3245. contentRight: rootLeft + contentLeft + contentWidth,
  3246. rootLeft: rootLeft,
  3247. rootRight: rootLeft + rootWidth
  3248. };
  3249. };
  3250. return MDCTabFoundation;
  3251. }(foundation_1.MDCFoundation);
  3252. exports.MDCTabFoundation = MDCTabFoundation;
  3253. exports.default = MDCTabFoundation;
  3254. }, function(module, exports, __webpack_require__) {
  3255. "use strict";
  3256. var __extends = this && this.__extends || function() {
  3257. var _extendStatics = function extendStatics(d, b) {
  3258. _extendStatics = Object.setPrototypeOf || {
  3259. __proto__: []
  3260. } instanceof Array && function(d, b) {
  3261. d.__proto__ = b;
  3262. } || function(d, b) {
  3263. for (var p in b) {
  3264. if (b.hasOwnProperty(p)) d[p] = b[p];
  3265. }
  3266. };
  3267. return _extendStatics(d, b);
  3268. };
  3269. return function(d, b) {
  3270. _extendStatics(d, b);
  3271. function __() {
  3272. this.constructor = d;
  3273. }
  3274. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  3275. };
  3276. }();
  3277. var __assign = this && this.__assign || function() {
  3278. __assign = Object.assign || function(t) {
  3279. for (var s, i = 1, n = arguments.length; i < n; i++) {
  3280. s = arguments[i];
  3281. for (var p in s) {
  3282. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  3283. }
  3284. }
  3285. return t;
  3286. };
  3287. return __assign.apply(this, arguments);
  3288. };
  3289. Object.defineProperty(exports, "__esModule", {
  3290. value: true
  3291. });
  3292. var foundation_1 = __webpack_require__(0);
  3293. var constants_1 = __webpack_require__(152);
  3294. var MDCTextFieldCharacterCounterFoundation = function(_super) {
  3295. __extends(MDCTextFieldCharacterCounterFoundation, _super);
  3296. function MDCTextFieldCharacterCounterFoundation(adapter) {
  3297. return _super.call(this, __assign({}, MDCTextFieldCharacterCounterFoundation.defaultAdapter, adapter)) || this;
  3298. }
  3299. Object.defineProperty(MDCTextFieldCharacterCounterFoundation, "cssClasses", {
  3300. get: function get() {
  3301. return constants_1.cssClasses;
  3302. },
  3303. enumerable: true,
  3304. configurable: true
  3305. });
  3306. Object.defineProperty(MDCTextFieldCharacterCounterFoundation, "strings", {
  3307. get: function get() {
  3308. return constants_1.strings;
  3309. },
  3310. enumerable: true,
  3311. configurable: true
  3312. });
  3313. Object.defineProperty(MDCTextFieldCharacterCounterFoundation, "defaultAdapter", {
  3314. get: function get() {
  3315. return {
  3316. setContent: function setContent() {
  3317. return undefined;
  3318. }
  3319. };
  3320. },
  3321. enumerable: true,
  3322. configurable: true
  3323. });
  3324. MDCTextFieldCharacterCounterFoundation.prototype.setCounterValue = function(currentLength, maxLength) {
  3325. currentLength = Math.min(currentLength, maxLength);
  3326. this.adapter_.setContent(currentLength + " / " + maxLength);
  3327. };
  3328. return MDCTextFieldCharacterCounterFoundation;
  3329. }(foundation_1.MDCFoundation);
  3330. exports.MDCTextFieldCharacterCounterFoundation = MDCTextFieldCharacterCounterFoundation;
  3331. exports.default = MDCTextFieldCharacterCounterFoundation;
  3332. }, function(module, exports, __webpack_require__) {
  3333. "use strict";
  3334. var __extends = this && this.__extends || function() {
  3335. var _extendStatics = function extendStatics(d, b) {
  3336. _extendStatics = Object.setPrototypeOf || {
  3337. __proto__: []
  3338. } instanceof Array && function(d, b) {
  3339. d.__proto__ = b;
  3340. } || function(d, b) {
  3341. for (var p in b) {
  3342. if (b.hasOwnProperty(p)) d[p] = b[p];
  3343. }
  3344. };
  3345. return _extendStatics(d, b);
  3346. };
  3347. return function(d, b) {
  3348. _extendStatics(d, b);
  3349. function __() {
  3350. this.constructor = d;
  3351. }
  3352. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  3353. };
  3354. }();
  3355. var __assign = this && this.__assign || function() {
  3356. __assign = Object.assign || function(t) {
  3357. for (var s, i = 1, n = arguments.length; i < n; i++) {
  3358. s = arguments[i];
  3359. for (var p in s) {
  3360. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  3361. }
  3362. }
  3363. return t;
  3364. };
  3365. return __assign.apply(this, arguments);
  3366. };
  3367. Object.defineProperty(exports, "__esModule", {
  3368. value: true
  3369. });
  3370. var foundation_1 = __webpack_require__(0);
  3371. var constants_1 = __webpack_require__(153);
  3372. var MDCTextFieldHelperTextFoundation = function(_super) {
  3373. __extends(MDCTextFieldHelperTextFoundation, _super);
  3374. function MDCTextFieldHelperTextFoundation(adapter) {
  3375. return _super.call(this, __assign({}, MDCTextFieldHelperTextFoundation.defaultAdapter, adapter)) || this;
  3376. }
  3377. Object.defineProperty(MDCTextFieldHelperTextFoundation, "cssClasses", {
  3378. get: function get() {
  3379. return constants_1.cssClasses;
  3380. },
  3381. enumerable: true,
  3382. configurable: true
  3383. });
  3384. Object.defineProperty(MDCTextFieldHelperTextFoundation, "strings", {
  3385. get: function get() {
  3386. return constants_1.strings;
  3387. },
  3388. enumerable: true,
  3389. configurable: true
  3390. });
  3391. Object.defineProperty(MDCTextFieldHelperTextFoundation, "defaultAdapter", {
  3392. get: function get() {
  3393. return {
  3394. addClass: function addClass() {
  3395. return undefined;
  3396. },
  3397. removeClass: function removeClass() {
  3398. return undefined;
  3399. },
  3400. hasClass: function hasClass() {
  3401. return false;
  3402. },
  3403. setAttr: function setAttr() {
  3404. return undefined;
  3405. },
  3406. removeAttr: function removeAttr() {
  3407. return undefined;
  3408. },
  3409. setContent: function setContent() {
  3410. return undefined;
  3411. }
  3412. };
  3413. },
  3414. enumerable: true,
  3415. configurable: true
  3416. });
  3417. MDCTextFieldHelperTextFoundation.prototype.setContent = function(content) {
  3418. this.adapter_.setContent(content);
  3419. };
  3420. MDCTextFieldHelperTextFoundation.prototype.setPersistent = function(isPersistent) {
  3421. if (isPersistent) {
  3422. this.adapter_.addClass(constants_1.cssClasses.HELPER_TEXT_PERSISTENT);
  3423. } else {
  3424. this.adapter_.removeClass(constants_1.cssClasses.HELPER_TEXT_PERSISTENT);
  3425. }
  3426. };
  3427. MDCTextFieldHelperTextFoundation.prototype.setValidation = function(isValidation) {
  3428. if (isValidation) {
  3429. this.adapter_.addClass(constants_1.cssClasses.HELPER_TEXT_VALIDATION_MSG);
  3430. } else {
  3431. this.adapter_.removeClass(constants_1.cssClasses.HELPER_TEXT_VALIDATION_MSG);
  3432. }
  3433. };
  3434. MDCTextFieldHelperTextFoundation.prototype.showToScreenReader = function() {
  3435. this.adapter_.removeAttr(constants_1.strings.ARIA_HIDDEN);
  3436. };
  3437. MDCTextFieldHelperTextFoundation.prototype.setValidity = function(inputIsValid) {
  3438. var helperTextIsPersistent = this.adapter_.hasClass(constants_1.cssClasses.HELPER_TEXT_PERSISTENT);
  3439. var helperTextIsValidationMsg = this.adapter_.hasClass(constants_1.cssClasses.HELPER_TEXT_VALIDATION_MSG);
  3440. var validationMsgNeedsDisplay = helperTextIsValidationMsg && !inputIsValid;
  3441. if (validationMsgNeedsDisplay) {
  3442. this.adapter_.setAttr(constants_1.strings.ROLE, "alert");
  3443. } else {
  3444. this.adapter_.removeAttr(constants_1.strings.ROLE);
  3445. }
  3446. if (!helperTextIsPersistent && !validationMsgNeedsDisplay) {
  3447. this.hide_();
  3448. }
  3449. };
  3450. MDCTextFieldHelperTextFoundation.prototype.hide_ = function() {
  3451. this.adapter_.setAttr(constants_1.strings.ARIA_HIDDEN, "true");
  3452. };
  3453. return MDCTextFieldHelperTextFoundation;
  3454. }(foundation_1.MDCFoundation);
  3455. exports.MDCTextFieldHelperTextFoundation = MDCTextFieldHelperTextFoundation;
  3456. exports.default = MDCTextFieldHelperTextFoundation;
  3457. }, function(module, exports, __webpack_require__) {
  3458. "use strict";
  3459. var __extends = this && this.__extends || function() {
  3460. var _extendStatics = function extendStatics(d, b) {
  3461. _extendStatics = Object.setPrototypeOf || {
  3462. __proto__: []
  3463. } instanceof Array && function(d, b) {
  3464. d.__proto__ = b;
  3465. } || function(d, b) {
  3466. for (var p in b) {
  3467. if (b.hasOwnProperty(p)) d[p] = b[p];
  3468. }
  3469. };
  3470. return _extendStatics(d, b);
  3471. };
  3472. return function(d, b) {
  3473. _extendStatics(d, b);
  3474. function __() {
  3475. this.constructor = d;
  3476. }
  3477. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  3478. };
  3479. }();
  3480. Object.defineProperty(exports, "__esModule", {
  3481. value: true
  3482. });
  3483. var constants_1 = __webpack_require__(7);
  3484. var foundation_1 = __webpack_require__(26);
  3485. var INITIAL_VALUE = 0;
  3486. var MDCTopAppBarFoundation = function(_super) {
  3487. __extends(MDCTopAppBarFoundation, _super);
  3488. function MDCTopAppBarFoundation(adapter) {
  3489. var _this = _super.call(this, adapter) || this;
  3490. _this.wasDocked_ = true;
  3491. _this.isDockedShowing_ = true;
  3492. _this.currentAppBarOffsetTop_ = 0;
  3493. _this.isCurrentlyBeingResized_ = false;
  3494. _this.resizeThrottleId_ = INITIAL_VALUE;
  3495. _this.resizeDebounceId_ = INITIAL_VALUE;
  3496. _this.lastScrollPosition_ = _this.adapter_.getViewportScrollY();
  3497. _this.topAppBarHeight_ = _this.adapter_.getTopAppBarHeight();
  3498. _this.scrollHandler_ = function() {
  3499. return _this.topAppBarScrollHandler_();
  3500. };
  3501. _this.resizeHandler_ = function() {
  3502. return _this.topAppBarResizeHandler_();
  3503. };
  3504. return _this;
  3505. }
  3506. MDCTopAppBarFoundation.prototype.destroy = function() {
  3507. _super.prototype.destroy.call(this);
  3508. this.adapter_.setStyle("top", "");
  3509. };
  3510. MDCTopAppBarFoundation.prototype.checkForUpdate_ = function() {
  3511. var offscreenBoundaryTop = -this.topAppBarHeight_;
  3512. var hasAnyPixelsOffscreen = this.currentAppBarOffsetTop_ < 0;
  3513. var hasAnyPixelsOnscreen = this.currentAppBarOffsetTop_ > offscreenBoundaryTop;
  3514. var partiallyShowing = hasAnyPixelsOffscreen && hasAnyPixelsOnscreen;
  3515. if (partiallyShowing) {
  3516. this.wasDocked_ = false;
  3517. } else {
  3518. if (!this.wasDocked_) {
  3519. this.wasDocked_ = true;
  3520. return true;
  3521. } else if (this.isDockedShowing_ !== hasAnyPixelsOnscreen) {
  3522. this.isDockedShowing_ = hasAnyPixelsOnscreen;
  3523. return true;
  3524. }
  3525. }
  3526. return partiallyShowing;
  3527. };
  3528. MDCTopAppBarFoundation.prototype.moveTopAppBar_ = function() {
  3529. if (this.checkForUpdate_()) {
  3530. var offset = this.currentAppBarOffsetTop_;
  3531. if (Math.abs(offset) >= this.topAppBarHeight_) {
  3532. offset = -constants_1.numbers.MAX_TOP_APP_BAR_HEIGHT;
  3533. }
  3534. this.adapter_.setStyle("top", offset + "px");
  3535. }
  3536. };
  3537. MDCTopAppBarFoundation.prototype.topAppBarScrollHandler_ = function() {
  3538. var currentScrollPosition = Math.max(this.adapter_.getViewportScrollY(), 0);
  3539. var diff = currentScrollPosition - this.lastScrollPosition_;
  3540. this.lastScrollPosition_ = currentScrollPosition;
  3541. if (!this.isCurrentlyBeingResized_) {
  3542. this.currentAppBarOffsetTop_ -= diff;
  3543. if (this.currentAppBarOffsetTop_ > 0) {
  3544. this.currentAppBarOffsetTop_ = 0;
  3545. } else if (Math.abs(this.currentAppBarOffsetTop_) > this.topAppBarHeight_) {
  3546. this.currentAppBarOffsetTop_ = -this.topAppBarHeight_;
  3547. }
  3548. this.moveTopAppBar_();
  3549. }
  3550. };
  3551. MDCTopAppBarFoundation.prototype.topAppBarResizeHandler_ = function() {
  3552. var _this = this;
  3553. if (!this.resizeThrottleId_) {
  3554. this.resizeThrottleId_ = setTimeout(function() {
  3555. _this.resizeThrottleId_ = INITIAL_VALUE;
  3556. _this.throttledResizeHandler_();
  3557. }, constants_1.numbers.DEBOUNCE_THROTTLE_RESIZE_TIME_MS);
  3558. }
  3559. this.isCurrentlyBeingResized_ = true;
  3560. if (this.resizeDebounceId_) {
  3561. clearTimeout(this.resizeDebounceId_);
  3562. }
  3563. this.resizeDebounceId_ = setTimeout(function() {
  3564. _this.topAppBarScrollHandler_();
  3565. _this.isCurrentlyBeingResized_ = false;
  3566. _this.resizeDebounceId_ = INITIAL_VALUE;
  3567. }, constants_1.numbers.DEBOUNCE_THROTTLE_RESIZE_TIME_MS);
  3568. };
  3569. MDCTopAppBarFoundation.prototype.throttledResizeHandler_ = function() {
  3570. var currentHeight = this.adapter_.getTopAppBarHeight();
  3571. if (this.topAppBarHeight_ !== currentHeight) {
  3572. this.wasDocked_ = false;
  3573. this.currentAppBarOffsetTop_ -= this.topAppBarHeight_ - currentHeight;
  3574. this.topAppBarHeight_ = currentHeight;
  3575. }
  3576. this.topAppBarScrollHandler_();
  3577. };
  3578. return MDCTopAppBarFoundation;
  3579. }(foundation_1.MDCTopAppBarBaseFoundation);
  3580. exports.MDCTopAppBarFoundation = MDCTopAppBarFoundation;
  3581. exports.default = MDCTopAppBarFoundation;
  3582. }, function(module, exports, __webpack_require__) {
  3583. "use strict";
  3584. var __extends = this && this.__extends || function() {
  3585. var _extendStatics = function extendStatics(d, b) {
  3586. _extendStatics = Object.setPrototypeOf || {
  3587. __proto__: []
  3588. } instanceof Array && function(d, b) {
  3589. d.__proto__ = b;
  3590. } || function(d, b) {
  3591. for (var p in b) {
  3592. if (b.hasOwnProperty(p)) d[p] = b[p];
  3593. }
  3594. };
  3595. return _extendStatics(d, b);
  3596. };
  3597. return function(d, b) {
  3598. _extendStatics(d, b);
  3599. function __() {
  3600. this.constructor = d;
  3601. }
  3602. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  3603. };
  3604. }();
  3605. var __assign = this && this.__assign || function() {
  3606. __assign = Object.assign || function(t) {
  3607. for (var s, i = 1, n = arguments.length; i < n; i++) {
  3608. s = arguments[i];
  3609. for (var p in s) {
  3610. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  3611. }
  3612. }
  3613. return t;
  3614. };
  3615. return __assign.apply(this, arguments);
  3616. };
  3617. Object.defineProperty(exports, "__esModule", {
  3618. value: true
  3619. });
  3620. var foundation_1 = __webpack_require__(0);
  3621. var constants_1 = __webpack_require__(7);
  3622. var MDCTopAppBarBaseFoundation = function(_super) {
  3623. __extends(MDCTopAppBarBaseFoundation, _super);
  3624. function MDCTopAppBarBaseFoundation(adapter) {
  3625. var _this = _super.call(this, __assign({}, MDCTopAppBarBaseFoundation.defaultAdapter, adapter)) || this;
  3626. _this.navClickHandler_ = function() {
  3627. return _this.adapter_.notifyNavigationIconClicked();
  3628. };
  3629. return _this;
  3630. }
  3631. Object.defineProperty(MDCTopAppBarBaseFoundation, "strings", {
  3632. get: function get() {
  3633. return constants_1.strings;
  3634. },
  3635. enumerable: true,
  3636. configurable: true
  3637. });
  3638. Object.defineProperty(MDCTopAppBarBaseFoundation, "cssClasses", {
  3639. get: function get() {
  3640. return constants_1.cssClasses;
  3641. },
  3642. enumerable: true,
  3643. configurable: true
  3644. });
  3645. Object.defineProperty(MDCTopAppBarBaseFoundation, "numbers", {
  3646. get: function get() {
  3647. return constants_1.numbers;
  3648. },
  3649. enumerable: true,
  3650. configurable: true
  3651. });
  3652. Object.defineProperty(MDCTopAppBarBaseFoundation, "defaultAdapter", {
  3653. get: function get() {
  3654. return {
  3655. addClass: function addClass() {
  3656. return undefined;
  3657. },
  3658. removeClass: function removeClass() {
  3659. return undefined;
  3660. },
  3661. hasClass: function hasClass() {
  3662. return false;
  3663. },
  3664. setStyle: function setStyle() {
  3665. return undefined;
  3666. },
  3667. getTopAppBarHeight: function getTopAppBarHeight() {
  3668. return 0;
  3669. },
  3670. registerNavigationIconInteractionHandler: function registerNavigationIconInteractionHandler() {
  3671. return undefined;
  3672. },
  3673. deregisterNavigationIconInteractionHandler: function deregisterNavigationIconInteractionHandler() {
  3674. return undefined;
  3675. },
  3676. notifyNavigationIconClicked: function notifyNavigationIconClicked() {
  3677. return undefined;
  3678. },
  3679. registerScrollHandler: function registerScrollHandler() {
  3680. return undefined;
  3681. },
  3682. deregisterScrollHandler: function deregisterScrollHandler() {
  3683. return undefined;
  3684. },
  3685. registerResizeHandler: function registerResizeHandler() {
  3686. return undefined;
  3687. },
  3688. deregisterResizeHandler: function deregisterResizeHandler() {
  3689. return undefined;
  3690. },
  3691. getViewportScrollY: function getViewportScrollY() {
  3692. return 0;
  3693. },
  3694. getTotalActionItems: function getTotalActionItems() {
  3695. return 0;
  3696. }
  3697. };
  3698. },
  3699. enumerable: true,
  3700. configurable: true
  3701. });
  3702. MDCTopAppBarBaseFoundation.prototype.init = function() {
  3703. this.initScrollHandler();
  3704. this.initResizeHandler_();
  3705. this.adapter_.registerNavigationIconInteractionHandler("click", this.navClickHandler_);
  3706. };
  3707. MDCTopAppBarBaseFoundation.prototype.destroy = function() {
  3708. this.destroyScrollHandler();
  3709. this.destroyResizeHandler_();
  3710. this.adapter_.deregisterNavigationIconInteractionHandler("click", this.navClickHandler_);
  3711. };
  3712. MDCTopAppBarBaseFoundation.prototype.initScrollHandler = function() {
  3713. if (this.scrollHandler_) {
  3714. this.adapter_.registerScrollHandler(this.scrollHandler_);
  3715. }
  3716. };
  3717. MDCTopAppBarBaseFoundation.prototype.destroyScrollHandler = function() {
  3718. if (this.scrollHandler_) {
  3719. this.adapter_.deregisterScrollHandler(this.scrollHandler_);
  3720. }
  3721. };
  3722. MDCTopAppBarBaseFoundation.prototype.initResizeHandler_ = function() {
  3723. if (this.resizeHandler_) {
  3724. this.adapter_.registerResizeHandler(this.resizeHandler_);
  3725. }
  3726. };
  3727. MDCTopAppBarBaseFoundation.prototype.destroyResizeHandler_ = function() {
  3728. if (this.resizeHandler_) {
  3729. this.adapter_.deregisterResizeHandler(this.resizeHandler_);
  3730. }
  3731. };
  3732. return MDCTopAppBarBaseFoundation;
  3733. }(foundation_1.MDCFoundation);
  3734. exports.MDCTopAppBarBaseFoundation = MDCTopAppBarBaseFoundation;
  3735. exports.default = MDCTopAppBarBaseFoundation;
  3736. }, function(module, exports, __webpack_require__) {
  3737. "use strict";
  3738. var __extends = this && this.__extends || function() {
  3739. var _extendStatics = function extendStatics(d, b) {
  3740. _extendStatics = Object.setPrototypeOf || {
  3741. __proto__: []
  3742. } instanceof Array && function(d, b) {
  3743. d.__proto__ = b;
  3744. } || function(d, b) {
  3745. for (var p in b) {
  3746. if (b.hasOwnProperty(p)) d[p] = b[p];
  3747. }
  3748. };
  3749. return _extendStatics(d, b);
  3750. };
  3751. return function(d, b) {
  3752. _extendStatics(d, b);
  3753. function __() {
  3754. this.constructor = d;
  3755. }
  3756. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  3757. };
  3758. }();
  3759. var __assign = this && this.__assign || function() {
  3760. __assign = Object.assign || function(t) {
  3761. for (var s, i = 1, n = arguments.length; i < n; i++) {
  3762. s = arguments[i];
  3763. for (var p in s) {
  3764. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  3765. }
  3766. }
  3767. return t;
  3768. };
  3769. return __assign.apply(this, arguments);
  3770. };
  3771. Object.defineProperty(exports, "__esModule", {
  3772. value: true
  3773. });
  3774. var foundation_1 = __webpack_require__(0);
  3775. var constants_1 = __webpack_require__(84);
  3776. var MDCCheckboxFoundation = function(_super) {
  3777. __extends(MDCCheckboxFoundation, _super);
  3778. function MDCCheckboxFoundation(adapter) {
  3779. var _this = _super.call(this, __assign({}, MDCCheckboxFoundation.defaultAdapter, adapter)) || this;
  3780. _this.currentCheckState_ = constants_1.strings.TRANSITION_STATE_INIT;
  3781. _this.currentAnimationClass_ = "";
  3782. _this.animEndLatchTimer_ = 0;
  3783. _this.enableAnimationEndHandler_ = false;
  3784. return _this;
  3785. }
  3786. Object.defineProperty(MDCCheckboxFoundation, "cssClasses", {
  3787. get: function get() {
  3788. return constants_1.cssClasses;
  3789. },
  3790. enumerable: true,
  3791. configurable: true
  3792. });
  3793. Object.defineProperty(MDCCheckboxFoundation, "strings", {
  3794. get: function get() {
  3795. return constants_1.strings;
  3796. },
  3797. enumerable: true,
  3798. configurable: true
  3799. });
  3800. Object.defineProperty(MDCCheckboxFoundation, "numbers", {
  3801. get: function get() {
  3802. return constants_1.numbers;
  3803. },
  3804. enumerable: true,
  3805. configurable: true
  3806. });
  3807. Object.defineProperty(MDCCheckboxFoundation, "defaultAdapter", {
  3808. get: function get() {
  3809. return {
  3810. addClass: function addClass() {
  3811. return undefined;
  3812. },
  3813. forceLayout: function forceLayout() {
  3814. return undefined;
  3815. },
  3816. hasNativeControl: function hasNativeControl() {
  3817. return false;
  3818. },
  3819. isAttachedToDOM: function isAttachedToDOM() {
  3820. return false;
  3821. },
  3822. isChecked: function isChecked() {
  3823. return false;
  3824. },
  3825. isIndeterminate: function isIndeterminate() {
  3826. return false;
  3827. },
  3828. removeClass: function removeClass() {
  3829. return undefined;
  3830. },
  3831. removeNativeControlAttr: function removeNativeControlAttr() {
  3832. return undefined;
  3833. },
  3834. setNativeControlAttr: function setNativeControlAttr() {
  3835. return undefined;
  3836. },
  3837. setNativeControlDisabled: function setNativeControlDisabled() {
  3838. return undefined;
  3839. }
  3840. };
  3841. },
  3842. enumerable: true,
  3843. configurable: true
  3844. });
  3845. MDCCheckboxFoundation.prototype.init = function() {
  3846. this.currentCheckState_ = this.determineCheckState_();
  3847. this.updateAriaChecked_();
  3848. this.adapter_.addClass(constants_1.cssClasses.UPGRADED);
  3849. };
  3850. MDCCheckboxFoundation.prototype.destroy = function() {
  3851. clearTimeout(this.animEndLatchTimer_);
  3852. };
  3853. MDCCheckboxFoundation.prototype.setDisabled = function(disabled) {
  3854. this.adapter_.setNativeControlDisabled(disabled);
  3855. if (disabled) {
  3856. this.adapter_.addClass(constants_1.cssClasses.DISABLED);
  3857. } else {
  3858. this.adapter_.removeClass(constants_1.cssClasses.DISABLED);
  3859. }
  3860. };
  3861. MDCCheckboxFoundation.prototype.handleAnimationEnd = function() {
  3862. var _this = this;
  3863. if (!this.enableAnimationEndHandler_) {
  3864. return;
  3865. }
  3866. clearTimeout(this.animEndLatchTimer_);
  3867. this.animEndLatchTimer_ = setTimeout(function() {
  3868. _this.adapter_.removeClass(_this.currentAnimationClass_);
  3869. _this.enableAnimationEndHandler_ = false;
  3870. }, constants_1.numbers.ANIM_END_LATCH_MS);
  3871. };
  3872. MDCCheckboxFoundation.prototype.handleChange = function() {
  3873. this.transitionCheckState_();
  3874. };
  3875. MDCCheckboxFoundation.prototype.transitionCheckState_ = function() {
  3876. if (!this.adapter_.hasNativeControl()) {
  3877. return;
  3878. }
  3879. var oldState = this.currentCheckState_;
  3880. var newState = this.determineCheckState_();
  3881. if (oldState === newState) {
  3882. return;
  3883. }
  3884. this.updateAriaChecked_();
  3885. var TRANSITION_STATE_UNCHECKED = constants_1.strings.TRANSITION_STATE_UNCHECKED;
  3886. var SELECTED = constants_1.cssClasses.SELECTED;
  3887. if (newState === TRANSITION_STATE_UNCHECKED) {
  3888. this.adapter_.removeClass(SELECTED);
  3889. } else {
  3890. this.adapter_.addClass(SELECTED);
  3891. }
  3892. if (this.currentAnimationClass_.length > 0) {
  3893. clearTimeout(this.animEndLatchTimer_);
  3894. this.adapter_.forceLayout();
  3895. this.adapter_.removeClass(this.currentAnimationClass_);
  3896. }
  3897. this.currentAnimationClass_ = this.getTransitionAnimationClass_(oldState, newState);
  3898. this.currentCheckState_ = newState;
  3899. if (this.adapter_.isAttachedToDOM() && this.currentAnimationClass_.length > 0) {
  3900. this.adapter_.addClass(this.currentAnimationClass_);
  3901. this.enableAnimationEndHandler_ = true;
  3902. }
  3903. };
  3904. MDCCheckboxFoundation.prototype.determineCheckState_ = function() {
  3905. var TRANSITION_STATE_INDETERMINATE = constants_1.strings.TRANSITION_STATE_INDETERMINATE, TRANSITION_STATE_CHECKED = constants_1.strings.TRANSITION_STATE_CHECKED, TRANSITION_STATE_UNCHECKED = constants_1.strings.TRANSITION_STATE_UNCHECKED;
  3906. if (this.adapter_.isIndeterminate()) {
  3907. return TRANSITION_STATE_INDETERMINATE;
  3908. }
  3909. return this.adapter_.isChecked() ? TRANSITION_STATE_CHECKED : TRANSITION_STATE_UNCHECKED;
  3910. };
  3911. MDCCheckboxFoundation.prototype.getTransitionAnimationClass_ = function(oldState, newState) {
  3912. var TRANSITION_STATE_INIT = constants_1.strings.TRANSITION_STATE_INIT, TRANSITION_STATE_CHECKED = constants_1.strings.TRANSITION_STATE_CHECKED, TRANSITION_STATE_UNCHECKED = constants_1.strings.TRANSITION_STATE_UNCHECKED;
  3913. var _a = MDCCheckboxFoundation.cssClasses, ANIM_UNCHECKED_CHECKED = _a.ANIM_UNCHECKED_CHECKED, ANIM_UNCHECKED_INDETERMINATE = _a.ANIM_UNCHECKED_INDETERMINATE, ANIM_CHECKED_UNCHECKED = _a.ANIM_CHECKED_UNCHECKED, ANIM_CHECKED_INDETERMINATE = _a.ANIM_CHECKED_INDETERMINATE, ANIM_INDETERMINATE_CHECKED = _a.ANIM_INDETERMINATE_CHECKED, ANIM_INDETERMINATE_UNCHECKED = _a.ANIM_INDETERMINATE_UNCHECKED;
  3914. switch (oldState) {
  3915. case TRANSITION_STATE_INIT:
  3916. if (newState === TRANSITION_STATE_UNCHECKED) {
  3917. return "";
  3918. }
  3919. return newState === TRANSITION_STATE_CHECKED ? ANIM_INDETERMINATE_CHECKED : ANIM_INDETERMINATE_UNCHECKED;
  3920. case TRANSITION_STATE_UNCHECKED:
  3921. return newState === TRANSITION_STATE_CHECKED ? ANIM_UNCHECKED_CHECKED : ANIM_UNCHECKED_INDETERMINATE;
  3922. case TRANSITION_STATE_CHECKED:
  3923. return newState === TRANSITION_STATE_UNCHECKED ? ANIM_CHECKED_UNCHECKED : ANIM_CHECKED_INDETERMINATE;
  3924. default:
  3925. return newState === TRANSITION_STATE_CHECKED ? ANIM_INDETERMINATE_CHECKED : ANIM_INDETERMINATE_UNCHECKED;
  3926. }
  3927. };
  3928. MDCCheckboxFoundation.prototype.updateAriaChecked_ = function() {
  3929. if (this.adapter_.isIndeterminate()) {
  3930. this.adapter_.setNativeControlAttr(constants_1.strings.ARIA_CHECKED_ATTR, constants_1.strings.ARIA_CHECKED_INDETERMINATE_VALUE);
  3931. } else {
  3932. this.adapter_.removeNativeControlAttr(constants_1.strings.ARIA_CHECKED_ATTR);
  3933. }
  3934. };
  3935. return MDCCheckboxFoundation;
  3936. }(foundation_1.MDCFoundation);
  3937. exports.MDCCheckboxFoundation = MDCCheckboxFoundation;
  3938. exports.default = MDCCheckboxFoundation;
  3939. }, function(module, exports, __webpack_require__) {
  3940. "use strict";
  3941. var __extends = this && this.__extends || function() {
  3942. var _extendStatics = function extendStatics(d, b) {
  3943. _extendStatics = Object.setPrototypeOf || {
  3944. __proto__: []
  3945. } instanceof Array && function(d, b) {
  3946. d.__proto__ = b;
  3947. } || function(d, b) {
  3948. for (var p in b) {
  3949. if (b.hasOwnProperty(p)) d[p] = b[p];
  3950. }
  3951. };
  3952. return _extendStatics(d, b);
  3953. };
  3954. return function(d, b) {
  3955. _extendStatics(d, b);
  3956. function __() {
  3957. this.constructor = d;
  3958. }
  3959. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  3960. };
  3961. }();
  3962. var __assign = this && this.__assign || function() {
  3963. __assign = Object.assign || function(t) {
  3964. for (var s, i = 1, n = arguments.length; i < n; i++) {
  3965. s = arguments[i];
  3966. for (var p in s) {
  3967. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  3968. }
  3969. }
  3970. return t;
  3971. };
  3972. return __assign.apply(this, arguments);
  3973. };
  3974. Object.defineProperty(exports, "__esModule", {
  3975. value: true
  3976. });
  3977. var component_1 = __webpack_require__(1);
  3978. var component_2 = __webpack_require__(2);
  3979. var foundation_1 = __webpack_require__(4);
  3980. var constants_1 = __webpack_require__(29);
  3981. var foundation_2 = __webpack_require__(12);
  3982. var INTERACTION_EVENTS = [ "click", "keydown" ];
  3983. var MDCChip = function(_super) {
  3984. __extends(MDCChip, _super);
  3985. function MDCChip() {
  3986. return _super !== null && _super.apply(this, arguments) || this;
  3987. }
  3988. Object.defineProperty(MDCChip.prototype, "selected", {
  3989. get: function get() {
  3990. return this.foundation_.isSelected();
  3991. },
  3992. set: function set(selected) {
  3993. this.foundation_.setSelected(selected);
  3994. },
  3995. enumerable: true,
  3996. configurable: true
  3997. });
  3998. Object.defineProperty(MDCChip.prototype, "shouldRemoveOnTrailingIconClick", {
  3999. get: function get() {
  4000. return this.foundation_.getShouldRemoveOnTrailingIconClick();
  4001. },
  4002. set: function set(shouldRemove) {
  4003. this.foundation_.setShouldRemoveOnTrailingIconClick(shouldRemove);
  4004. },
  4005. enumerable: true,
  4006. configurable: true
  4007. });
  4008. Object.defineProperty(MDCChip.prototype, "ripple", {
  4009. get: function get() {
  4010. return this.ripple_;
  4011. },
  4012. enumerable: true,
  4013. configurable: true
  4014. });
  4015. Object.defineProperty(MDCChip.prototype, "id", {
  4016. get: function get() {
  4017. return this.root_.id;
  4018. },
  4019. enumerable: true,
  4020. configurable: true
  4021. });
  4022. MDCChip.attachTo = function(root) {
  4023. return new MDCChip(root);
  4024. };
  4025. MDCChip.prototype.initialize = function(rippleFactory) {
  4026. var _this = this;
  4027. if (rippleFactory === void 0) {
  4028. rippleFactory = function rippleFactory(el, foundation) {
  4029. return new component_2.MDCRipple(el, foundation);
  4030. };
  4031. }
  4032. this.leadingIcon_ = this.root_.querySelector(constants_1.strings.LEADING_ICON_SELECTOR);
  4033. this.trailingIcon_ = this.root_.querySelector(constants_1.strings.TRAILING_ICON_SELECTOR);
  4034. this.checkmark_ = this.root_.querySelector(constants_1.strings.CHECKMARK_SELECTOR);
  4035. var rippleAdapter = __assign({}, component_2.MDCRipple.createAdapter(this), {
  4036. computeBoundingRect: function computeBoundingRect() {
  4037. return _this.foundation_.getDimensions();
  4038. }
  4039. });
  4040. this.ripple_ = rippleFactory(this.root_, new foundation_1.MDCRippleFoundation(rippleAdapter));
  4041. };
  4042. MDCChip.prototype.initialSyncWithDOM = function() {
  4043. var _this = this;
  4044. this.handleInteraction_ = function(evt) {
  4045. return _this.foundation_.handleInteraction(evt);
  4046. };
  4047. this.handleTransitionEnd_ = function(evt) {
  4048. return _this.foundation_.handleTransitionEnd(evt);
  4049. };
  4050. this.handleTrailingIconInteraction_ = function(evt) {
  4051. return _this.foundation_.handleTrailingIconInteraction(evt);
  4052. };
  4053. INTERACTION_EVENTS.forEach(function(evtType) {
  4054. _this.listen(evtType, _this.handleInteraction_);
  4055. });
  4056. this.listen("transitionend", this.handleTransitionEnd_);
  4057. if (this.trailingIcon_) {
  4058. INTERACTION_EVENTS.forEach(function(evtType) {
  4059. _this.trailingIcon_.addEventListener(evtType, _this.handleTrailingIconInteraction_);
  4060. });
  4061. }
  4062. };
  4063. MDCChip.prototype.destroy = function() {
  4064. var _this = this;
  4065. this.ripple_.destroy();
  4066. INTERACTION_EVENTS.forEach(function(evtType) {
  4067. _this.unlisten(evtType, _this.handleInteraction_);
  4068. });
  4069. this.unlisten("transitionend", this.handleTransitionEnd_);
  4070. if (this.trailingIcon_) {
  4071. INTERACTION_EVENTS.forEach(function(evtType) {
  4072. _this.trailingIcon_.removeEventListener(evtType, _this.handleTrailingIconInteraction_);
  4073. });
  4074. }
  4075. _super.prototype.destroy.call(this);
  4076. };
  4077. MDCChip.prototype.beginExit = function() {
  4078. this.foundation_.beginExit();
  4079. };
  4080. MDCChip.prototype.getDefaultFoundation = function() {
  4081. var _this = this;
  4082. var adapter = {
  4083. addClass: function addClass(className) {
  4084. return _this.root_.classList.add(className);
  4085. },
  4086. addClassToLeadingIcon: function addClassToLeadingIcon(className) {
  4087. if (_this.leadingIcon_) {
  4088. _this.leadingIcon_.classList.add(className);
  4089. }
  4090. },
  4091. eventTargetHasClass: function eventTargetHasClass(target, className) {
  4092. return target ? target.classList.contains(className) : false;
  4093. },
  4094. getCheckmarkBoundingClientRect: function getCheckmarkBoundingClientRect() {
  4095. return _this.checkmark_ ? _this.checkmark_.getBoundingClientRect() : null;
  4096. },
  4097. getComputedStyleValue: function getComputedStyleValue(propertyName) {
  4098. return window.getComputedStyle(_this.root_).getPropertyValue(propertyName);
  4099. },
  4100. getRootBoundingClientRect: function getRootBoundingClientRect() {
  4101. return _this.root_.getBoundingClientRect();
  4102. },
  4103. hasClass: function hasClass(className) {
  4104. return _this.root_.classList.contains(className);
  4105. },
  4106. hasLeadingIcon: function hasLeadingIcon() {
  4107. return !!_this.leadingIcon_;
  4108. },
  4109. notifyInteraction: function notifyInteraction() {
  4110. return _this.emit(constants_1.strings.INTERACTION_EVENT, {
  4111. chipId: _this.id
  4112. }, true);
  4113. },
  4114. notifyRemoval: function notifyRemoval() {
  4115. return _this.emit(constants_1.strings.REMOVAL_EVENT, {
  4116. chipId: _this.id,
  4117. root: _this.root_
  4118. }, true);
  4119. },
  4120. notifySelection: function notifySelection(selected) {
  4121. return _this.emit(constants_1.strings.SELECTION_EVENT, {
  4122. chipId: _this.id,
  4123. selected: selected
  4124. }, true);
  4125. },
  4126. notifyTrailingIconInteraction: function notifyTrailingIconInteraction() {
  4127. return _this.emit(constants_1.strings.TRAILING_ICON_INTERACTION_EVENT, {
  4128. chipId: _this.id
  4129. }, true);
  4130. },
  4131. removeClass: function removeClass(className) {
  4132. return _this.root_.classList.remove(className);
  4133. },
  4134. removeClassFromLeadingIcon: function removeClassFromLeadingIcon(className) {
  4135. if (_this.leadingIcon_) {
  4136. _this.leadingIcon_.classList.remove(className);
  4137. }
  4138. },
  4139. setStyleProperty: function setStyleProperty(propertyName, value) {
  4140. return _this.root_.style.setProperty(propertyName, value);
  4141. }
  4142. };
  4143. return new foundation_2.MDCChipFoundation(adapter);
  4144. };
  4145. return MDCChip;
  4146. }(component_1.MDCComponent);
  4147. exports.MDCChip = MDCChip;
  4148. }, function(module, exports, __webpack_require__) {
  4149. "use strict";
  4150. Object.defineProperty(exports, "__esModule", {
  4151. value: true
  4152. });
  4153. exports.strings = {
  4154. CHECKMARK_SELECTOR: ".mdc-chip__checkmark",
  4155. ENTRY_ANIMATION_NAME: "mdc-chip-entry",
  4156. INTERACTION_EVENT: "MDCChip:interaction",
  4157. LEADING_ICON_SELECTOR: ".mdc-chip__icon--leading",
  4158. REMOVAL_EVENT: "MDCChip:removal",
  4159. SELECTION_EVENT: "MDCChip:selection",
  4160. TRAILING_ICON_INTERACTION_EVENT: "MDCChip:trailingIconInteraction",
  4161. TRAILING_ICON_SELECTOR: ".mdc-chip__icon--trailing"
  4162. };
  4163. exports.cssClasses = {
  4164. CHECKMARK: "mdc-chip__checkmark",
  4165. CHIP_EXIT: "mdc-chip--exit",
  4166. HIDDEN_LEADING_ICON: "mdc-chip__icon--leading-hidden",
  4167. LEADING_ICON: "mdc-chip__icon--leading",
  4168. SELECTED: "mdc-chip--selected",
  4169. TRAILING_ICON: "mdc-chip__icon--trailing"
  4170. };
  4171. }, function(module, exports, __webpack_require__) {
  4172. "use strict";
  4173. var __extends = this && this.__extends || function() {
  4174. var _extendStatics = function extendStatics(d, b) {
  4175. _extendStatics = Object.setPrototypeOf || {
  4176. __proto__: []
  4177. } instanceof Array && function(d, b) {
  4178. d.__proto__ = b;
  4179. } || function(d, b) {
  4180. for (var p in b) {
  4181. if (b.hasOwnProperty(p)) d[p] = b[p];
  4182. }
  4183. };
  4184. return _extendStatics(d, b);
  4185. };
  4186. return function(d, b) {
  4187. _extendStatics(d, b);
  4188. function __() {
  4189. this.constructor = d;
  4190. }
  4191. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  4192. };
  4193. }();
  4194. var __assign = this && this.__assign || function() {
  4195. __assign = Object.assign || function(t) {
  4196. for (var s, i = 1, n = arguments.length; i < n; i++) {
  4197. s = arguments[i];
  4198. for (var p in s) {
  4199. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  4200. }
  4201. }
  4202. return t;
  4203. };
  4204. return __assign.apply(this, arguments);
  4205. };
  4206. Object.defineProperty(exports, "__esModule", {
  4207. value: true
  4208. });
  4209. var foundation_1 = __webpack_require__(0);
  4210. var constants_1 = __webpack_require__(89);
  4211. var MDCChipSetFoundation = function(_super) {
  4212. __extends(MDCChipSetFoundation, _super);
  4213. function MDCChipSetFoundation(adapter) {
  4214. var _this = _super.call(this, __assign({}, MDCChipSetFoundation.defaultAdapter, adapter)) || this;
  4215. _this.selectedChipIds_ = [];
  4216. return _this;
  4217. }
  4218. Object.defineProperty(MDCChipSetFoundation, "strings", {
  4219. get: function get() {
  4220. return constants_1.strings;
  4221. },
  4222. enumerable: true,
  4223. configurable: true
  4224. });
  4225. Object.defineProperty(MDCChipSetFoundation, "cssClasses", {
  4226. get: function get() {
  4227. return constants_1.cssClasses;
  4228. },
  4229. enumerable: true,
  4230. configurable: true
  4231. });
  4232. Object.defineProperty(MDCChipSetFoundation, "defaultAdapter", {
  4233. get: function get() {
  4234. return {
  4235. hasClass: function hasClass() {
  4236. return false;
  4237. },
  4238. removeChip: function removeChip() {
  4239. return undefined;
  4240. },
  4241. setSelected: function setSelected() {
  4242. return undefined;
  4243. }
  4244. };
  4245. },
  4246. enumerable: true,
  4247. configurable: true
  4248. });
  4249. MDCChipSetFoundation.prototype.getSelectedChipIds = function() {
  4250. return this.selectedChipIds_.slice();
  4251. };
  4252. MDCChipSetFoundation.prototype.select = function(chipId) {
  4253. if (this.selectedChipIds_.indexOf(chipId) >= 0) {
  4254. return;
  4255. }
  4256. if (this.adapter_.hasClass(constants_1.cssClasses.CHOICE) && this.selectedChipIds_.length > 0) {
  4257. var previouslySelectedChip = this.selectedChipIds_[0];
  4258. this.selectedChipIds_.length = 0;
  4259. this.adapter_.setSelected(previouslySelectedChip, false);
  4260. }
  4261. this.selectedChipIds_.push(chipId);
  4262. this.adapter_.setSelected(chipId, true);
  4263. };
  4264. MDCChipSetFoundation.prototype.handleChipInteraction = function(chipId) {
  4265. if (this.adapter_.hasClass(constants_1.cssClasses.CHOICE) || this.adapter_.hasClass(constants_1.cssClasses.FILTER)) {
  4266. this.toggleSelect_(chipId);
  4267. }
  4268. };
  4269. MDCChipSetFoundation.prototype.handleChipSelection = function(chipId, selected) {
  4270. var chipIsSelected = this.selectedChipIds_.indexOf(chipId) >= 0;
  4271. if (selected && !chipIsSelected) {
  4272. this.select(chipId);
  4273. } else if (!selected && chipIsSelected) {
  4274. this.deselect_(chipId);
  4275. }
  4276. };
  4277. MDCChipSetFoundation.prototype.handleChipRemoval = function(chipId) {
  4278. this.deselect_(chipId);
  4279. this.adapter_.removeChip(chipId);
  4280. };
  4281. MDCChipSetFoundation.prototype.deselect_ = function(chipId) {
  4282. var index = this.selectedChipIds_.indexOf(chipId);
  4283. if (index >= 0) {
  4284. this.selectedChipIds_.splice(index, 1);
  4285. this.adapter_.setSelected(chipId, false);
  4286. }
  4287. };
  4288. MDCChipSetFoundation.prototype.toggleSelect_ = function(chipId) {
  4289. if (this.selectedChipIds_.indexOf(chipId) >= 0) {
  4290. this.deselect_(chipId);
  4291. } else {
  4292. this.select(chipId);
  4293. }
  4294. };
  4295. return MDCChipSetFoundation;
  4296. }(foundation_1.MDCFoundation);
  4297. exports.MDCChipSetFoundation = MDCChipSetFoundation;
  4298. exports.default = MDCChipSetFoundation;
  4299. }, function(module, exports, __webpack_require__) {
  4300. "use strict";
  4301. var __importDefault = this && this.__importDefault || function(mod) {
  4302. return mod && mod.__esModule ? mod : {
  4303. default: mod
  4304. };
  4305. };
  4306. Object.defineProperty(exports, "__esModule", {
  4307. value: true
  4308. });
  4309. var focus_trap_1 = __importDefault(__webpack_require__(91));
  4310. function createFocusTrapInstance(surfaceEl, focusTrapFactory, initialFocusEl) {
  4311. if (focusTrapFactory === void 0) {
  4312. focusTrapFactory = focus_trap_1.default;
  4313. }
  4314. return focusTrapFactory(surfaceEl, {
  4315. clickOutsideDeactivates: true,
  4316. escapeDeactivates: false,
  4317. initialFocus: initialFocusEl
  4318. });
  4319. }
  4320. exports.createFocusTrapInstance = createFocusTrapInstance;
  4321. function isScrollable(el) {
  4322. return el ? el.scrollHeight > el.offsetHeight : false;
  4323. }
  4324. exports.isScrollable = isScrollable;
  4325. function areTopsMisaligned(els) {
  4326. var tops = new Set();
  4327. [].forEach.call(els, function(el) {
  4328. return tops.add(el.offsetTop);
  4329. });
  4330. return tops.size > 1;
  4331. }
  4332. exports.areTopsMisaligned = areTopsMisaligned;
  4333. }, function(module, exports, __webpack_require__) {
  4334. "use strict";
  4335. var __extends = this && this.__extends || function() {
  4336. var _extendStatics = function extendStatics(d, b) {
  4337. _extendStatics = Object.setPrototypeOf || {
  4338. __proto__: []
  4339. } instanceof Array && function(d, b) {
  4340. d.__proto__ = b;
  4341. } || function(d, b) {
  4342. for (var p in b) {
  4343. if (b.hasOwnProperty(p)) d[p] = b[p];
  4344. }
  4345. };
  4346. return _extendStatics(d, b);
  4347. };
  4348. return function(d, b) {
  4349. _extendStatics(d, b);
  4350. function __() {
  4351. this.constructor = d;
  4352. }
  4353. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  4354. };
  4355. }();
  4356. var __assign = this && this.__assign || function() {
  4357. __assign = Object.assign || function(t) {
  4358. for (var s, i = 1, n = arguments.length; i < n; i++) {
  4359. s = arguments[i];
  4360. for (var p in s) {
  4361. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  4362. }
  4363. }
  4364. return t;
  4365. };
  4366. return __assign.apply(this, arguments);
  4367. };
  4368. Object.defineProperty(exports, "__esModule", {
  4369. value: true
  4370. });
  4371. var foundation_1 = __webpack_require__(0);
  4372. var constants_1 = __webpack_require__(95);
  4373. var MDCDialogFoundation = function(_super) {
  4374. __extends(MDCDialogFoundation, _super);
  4375. function MDCDialogFoundation(adapter) {
  4376. var _this = _super.call(this, __assign({}, MDCDialogFoundation.defaultAdapter, adapter)) || this;
  4377. _this.isOpen_ = false;
  4378. _this.animationFrame_ = 0;
  4379. _this.animationTimer_ = 0;
  4380. _this.layoutFrame_ = 0;
  4381. _this.escapeKeyAction_ = constants_1.strings.CLOSE_ACTION;
  4382. _this.scrimClickAction_ = constants_1.strings.CLOSE_ACTION;
  4383. _this.autoStackButtons_ = true;
  4384. _this.areButtonsStacked_ = false;
  4385. return _this;
  4386. }
  4387. Object.defineProperty(MDCDialogFoundation, "cssClasses", {
  4388. get: function get() {
  4389. return constants_1.cssClasses;
  4390. },
  4391. enumerable: true,
  4392. configurable: true
  4393. });
  4394. Object.defineProperty(MDCDialogFoundation, "strings", {
  4395. get: function get() {
  4396. return constants_1.strings;
  4397. },
  4398. enumerable: true,
  4399. configurable: true
  4400. });
  4401. Object.defineProperty(MDCDialogFoundation, "numbers", {
  4402. get: function get() {
  4403. return constants_1.numbers;
  4404. },
  4405. enumerable: true,
  4406. configurable: true
  4407. });
  4408. Object.defineProperty(MDCDialogFoundation, "defaultAdapter", {
  4409. get: function get() {
  4410. return {
  4411. addBodyClass: function addBodyClass() {
  4412. return undefined;
  4413. },
  4414. addClass: function addClass() {
  4415. return undefined;
  4416. },
  4417. areButtonsStacked: function areButtonsStacked() {
  4418. return false;
  4419. },
  4420. clickDefaultButton: function clickDefaultButton() {
  4421. return undefined;
  4422. },
  4423. eventTargetMatches: function eventTargetMatches() {
  4424. return false;
  4425. },
  4426. getActionFromEvent: function getActionFromEvent() {
  4427. return "";
  4428. },
  4429. hasClass: function hasClass() {
  4430. return false;
  4431. },
  4432. isContentScrollable: function isContentScrollable() {
  4433. return false;
  4434. },
  4435. notifyClosed: function notifyClosed() {
  4436. return undefined;
  4437. },
  4438. notifyClosing: function notifyClosing() {
  4439. return undefined;
  4440. },
  4441. notifyOpened: function notifyOpened() {
  4442. return undefined;
  4443. },
  4444. notifyOpening: function notifyOpening() {
  4445. return undefined;
  4446. },
  4447. releaseFocus: function releaseFocus() {
  4448. return undefined;
  4449. },
  4450. removeBodyClass: function removeBodyClass() {
  4451. return undefined;
  4452. },
  4453. removeClass: function removeClass() {
  4454. return undefined;
  4455. },
  4456. reverseButtons: function reverseButtons() {
  4457. return undefined;
  4458. },
  4459. trapFocus: function trapFocus() {
  4460. return undefined;
  4461. }
  4462. };
  4463. },
  4464. enumerable: true,
  4465. configurable: true
  4466. });
  4467. MDCDialogFoundation.prototype.init = function() {
  4468. if (this.adapter_.hasClass(constants_1.cssClasses.STACKED)) {
  4469. this.setAutoStackButtons(false);
  4470. }
  4471. };
  4472. MDCDialogFoundation.prototype.destroy = function() {
  4473. if (this.isOpen_) {
  4474. this.close(constants_1.strings.DESTROY_ACTION);
  4475. }
  4476. if (this.animationTimer_) {
  4477. clearTimeout(this.animationTimer_);
  4478. this.handleAnimationTimerEnd_();
  4479. }
  4480. if (this.layoutFrame_) {
  4481. cancelAnimationFrame(this.layoutFrame_);
  4482. this.layoutFrame_ = 0;
  4483. }
  4484. };
  4485. MDCDialogFoundation.prototype.open = function() {
  4486. var _this = this;
  4487. this.isOpen_ = true;
  4488. this.adapter_.notifyOpening();
  4489. this.adapter_.addClass(constants_1.cssClasses.OPENING);
  4490. this.runNextAnimationFrame_(function() {
  4491. _this.adapter_.addClass(constants_1.cssClasses.OPEN);
  4492. _this.adapter_.addBodyClass(constants_1.cssClasses.SCROLL_LOCK);
  4493. _this.layout();
  4494. _this.animationTimer_ = setTimeout(function() {
  4495. _this.handleAnimationTimerEnd_();
  4496. _this.adapter_.trapFocus();
  4497. _this.adapter_.notifyOpened();
  4498. }, constants_1.numbers.DIALOG_ANIMATION_OPEN_TIME_MS);
  4499. });
  4500. };
  4501. MDCDialogFoundation.prototype.close = function(action) {
  4502. var _this = this;
  4503. if (action === void 0) {
  4504. action = "";
  4505. }
  4506. if (!this.isOpen_) {
  4507. return;
  4508. }
  4509. this.isOpen_ = false;
  4510. this.adapter_.notifyClosing(action);
  4511. this.adapter_.addClass(constants_1.cssClasses.CLOSING);
  4512. this.adapter_.removeClass(constants_1.cssClasses.OPEN);
  4513. this.adapter_.removeBodyClass(constants_1.cssClasses.SCROLL_LOCK);
  4514. cancelAnimationFrame(this.animationFrame_);
  4515. this.animationFrame_ = 0;
  4516. clearTimeout(this.animationTimer_);
  4517. this.animationTimer_ = setTimeout(function() {
  4518. _this.adapter_.releaseFocus();
  4519. _this.handleAnimationTimerEnd_();
  4520. _this.adapter_.notifyClosed(action);
  4521. }, constants_1.numbers.DIALOG_ANIMATION_CLOSE_TIME_MS);
  4522. };
  4523. MDCDialogFoundation.prototype.isOpen = function() {
  4524. return this.isOpen_;
  4525. };
  4526. MDCDialogFoundation.prototype.getEscapeKeyAction = function() {
  4527. return this.escapeKeyAction_;
  4528. };
  4529. MDCDialogFoundation.prototype.setEscapeKeyAction = function(action) {
  4530. this.escapeKeyAction_ = action;
  4531. };
  4532. MDCDialogFoundation.prototype.getScrimClickAction = function() {
  4533. return this.scrimClickAction_;
  4534. };
  4535. MDCDialogFoundation.prototype.setScrimClickAction = function(action) {
  4536. this.scrimClickAction_ = action;
  4537. };
  4538. MDCDialogFoundation.prototype.getAutoStackButtons = function() {
  4539. return this.autoStackButtons_;
  4540. };
  4541. MDCDialogFoundation.prototype.setAutoStackButtons = function(autoStack) {
  4542. this.autoStackButtons_ = autoStack;
  4543. };
  4544. MDCDialogFoundation.prototype.layout = function() {
  4545. var _this = this;
  4546. if (this.layoutFrame_) {
  4547. cancelAnimationFrame(this.layoutFrame_);
  4548. }
  4549. this.layoutFrame_ = requestAnimationFrame(function() {
  4550. _this.layoutInternal_();
  4551. _this.layoutFrame_ = 0;
  4552. });
  4553. };
  4554. MDCDialogFoundation.prototype.handleInteraction = function(evt) {
  4555. var isClick = evt.type === "click";
  4556. var isEnter = evt.key === "Enter" || evt.keyCode === 13;
  4557. var isSpace = evt.key === "Space" || evt.keyCode === 32;
  4558. var isScrim = this.adapter_.eventTargetMatches(evt.target, constants_1.strings.SCRIM_SELECTOR);
  4559. var isDefault = !this.adapter_.eventTargetMatches(evt.target, constants_1.strings.SUPPRESS_DEFAULT_PRESS_SELECTOR);
  4560. if (isClick && isScrim && this.scrimClickAction_ !== "") {
  4561. this.close(this.scrimClickAction_);
  4562. } else if (isClick || isSpace || isEnter) {
  4563. var action = this.adapter_.getActionFromEvent(evt);
  4564. if (action) {
  4565. this.close(action);
  4566. } else if (isEnter && isDefault) {
  4567. this.adapter_.clickDefaultButton();
  4568. }
  4569. }
  4570. };
  4571. MDCDialogFoundation.prototype.handleDocumentKeydown = function(evt) {
  4572. var isEscape = evt.key === "Escape" || evt.keyCode === 27;
  4573. if (isEscape && this.escapeKeyAction_ !== "") {
  4574. this.close(this.escapeKeyAction_);
  4575. }
  4576. };
  4577. MDCDialogFoundation.prototype.layoutInternal_ = function() {
  4578. if (this.autoStackButtons_) {
  4579. this.detectStackedButtons_();
  4580. }
  4581. this.detectScrollableContent_();
  4582. };
  4583. MDCDialogFoundation.prototype.handleAnimationTimerEnd_ = function() {
  4584. this.animationTimer_ = 0;
  4585. this.adapter_.removeClass(constants_1.cssClasses.OPENING);
  4586. this.adapter_.removeClass(constants_1.cssClasses.CLOSING);
  4587. };
  4588. MDCDialogFoundation.prototype.runNextAnimationFrame_ = function(callback) {
  4589. var _this = this;
  4590. cancelAnimationFrame(this.animationFrame_);
  4591. this.animationFrame_ = requestAnimationFrame(function() {
  4592. _this.animationFrame_ = 0;
  4593. clearTimeout(_this.animationTimer_);
  4594. _this.animationTimer_ = setTimeout(callback, 0);
  4595. });
  4596. };
  4597. MDCDialogFoundation.prototype.detectStackedButtons_ = function() {
  4598. this.adapter_.removeClass(constants_1.cssClasses.STACKED);
  4599. var areButtonsStacked = this.adapter_.areButtonsStacked();
  4600. if (areButtonsStacked) {
  4601. this.adapter_.addClass(constants_1.cssClasses.STACKED);
  4602. }
  4603. if (areButtonsStacked !== this.areButtonsStacked_) {
  4604. this.adapter_.reverseButtons();
  4605. this.areButtonsStacked_ = areButtonsStacked;
  4606. }
  4607. };
  4608. MDCDialogFoundation.prototype.detectScrollableContent_ = function() {
  4609. this.adapter_.removeClass(constants_1.cssClasses.SCROLLABLE);
  4610. if (this.adapter_.isContentScrollable()) {
  4611. this.adapter_.addClass(constants_1.cssClasses.SCROLLABLE);
  4612. }
  4613. };
  4614. return MDCDialogFoundation;
  4615. }(foundation_1.MDCFoundation);
  4616. exports.MDCDialogFoundation = MDCDialogFoundation;
  4617. exports.default = MDCDialogFoundation;
  4618. }, function(module, exports, __webpack_require__) {
  4619. "use strict";
  4620. var __importDefault = this && this.__importDefault || function(mod) {
  4621. return mod && mod.__esModule ? mod : {
  4622. default: mod
  4623. };
  4624. };
  4625. Object.defineProperty(exports, "__esModule", {
  4626. value: true
  4627. });
  4628. var focus_trap_1 = __importDefault(__webpack_require__(34));
  4629. function createFocusTrapInstance(surfaceEl, focusTrapFactory) {
  4630. if (focusTrapFactory === void 0) {
  4631. focusTrapFactory = focus_trap_1.default;
  4632. }
  4633. return focusTrapFactory(surfaceEl, {
  4634. clickOutsideDeactivates: true,
  4635. escapeDeactivates: false,
  4636. initialFocus: undefined,
  4637. returnFocusOnDeactivate: false
  4638. });
  4639. }
  4640. exports.createFocusTrapInstance = createFocusTrapInstance;
  4641. }, function(module, exports, __webpack_require__) {
  4642. var tabbable = __webpack_require__(98);
  4643. var xtend = __webpack_require__(99);
  4644. var activeFocusTraps = function() {
  4645. var trapQueue = [];
  4646. return {
  4647. activateTrap: function(trap) {
  4648. if (trapQueue.length > 0) {
  4649. var activeTrap = trapQueue[trapQueue.length - 1];
  4650. if (activeTrap !== trap) {
  4651. activeTrap.pause();
  4652. }
  4653. }
  4654. var trapIndex = trapQueue.indexOf(trap);
  4655. if (trapIndex === -1) {
  4656. trapQueue.push(trap);
  4657. } else {
  4658. trapQueue.splice(trapIndex, 1);
  4659. trapQueue.push(trap);
  4660. }
  4661. },
  4662. deactivateTrap: function(trap) {
  4663. var trapIndex = trapQueue.indexOf(trap);
  4664. if (trapIndex !== -1) {
  4665. trapQueue.splice(trapIndex, 1);
  4666. }
  4667. if (trapQueue.length > 0) {
  4668. trapQueue[trapQueue.length - 1].unpause();
  4669. }
  4670. }
  4671. };
  4672. }();
  4673. function focusTrap(element, userOptions) {
  4674. var doc = document;
  4675. var container = typeof element === "string" ? doc.querySelector(element) : element;
  4676. var config = xtend({
  4677. returnFocusOnDeactivate: true,
  4678. escapeDeactivates: true
  4679. }, userOptions);
  4680. var state = {
  4681. firstTabbableNode: null,
  4682. lastTabbableNode: null,
  4683. nodeFocusedBeforeActivation: null,
  4684. mostRecentlyFocusedNode: null,
  4685. active: false,
  4686. paused: false
  4687. };
  4688. var trap = {
  4689. activate: activate,
  4690. deactivate: deactivate,
  4691. pause: pause,
  4692. unpause: unpause
  4693. };
  4694. return trap;
  4695. function activate(activateOptions) {
  4696. if (state.active) return;
  4697. updateTabbableNodes();
  4698. state.active = true;
  4699. state.paused = false;
  4700. state.nodeFocusedBeforeActivation = doc.activeElement;
  4701. var onActivate = activateOptions && activateOptions.onActivate ? activateOptions.onActivate : config.onActivate;
  4702. if (onActivate) {
  4703. onActivate();
  4704. }
  4705. addListeners();
  4706. return trap;
  4707. }
  4708. function deactivate(deactivateOptions) {
  4709. if (!state.active) return;
  4710. removeListeners();
  4711. state.active = false;
  4712. state.paused = false;
  4713. activeFocusTraps.deactivateTrap(trap);
  4714. var onDeactivate = deactivateOptions && deactivateOptions.onDeactivate !== undefined ? deactivateOptions.onDeactivate : config.onDeactivate;
  4715. if (onDeactivate) {
  4716. onDeactivate();
  4717. }
  4718. var returnFocus = deactivateOptions && deactivateOptions.returnFocus !== undefined ? deactivateOptions.returnFocus : config.returnFocusOnDeactivate;
  4719. if (returnFocus) {
  4720. delay(function() {
  4721. tryFocus(state.nodeFocusedBeforeActivation);
  4722. });
  4723. }
  4724. return trap;
  4725. }
  4726. function pause() {
  4727. if (state.paused || !state.active) return;
  4728. state.paused = true;
  4729. removeListeners();
  4730. }
  4731. function unpause() {
  4732. if (!state.paused || !state.active) return;
  4733. state.paused = false;
  4734. updateTabbableNodes();
  4735. addListeners();
  4736. }
  4737. function addListeners() {
  4738. if (!state.active) return;
  4739. activeFocusTraps.activateTrap(trap);
  4740. delay(function() {
  4741. tryFocus(getInitialFocusNode());
  4742. });
  4743. doc.addEventListener("focusin", checkFocusIn, true);
  4744. doc.addEventListener("mousedown", checkPointerDown, {
  4745. capture: true,
  4746. passive: false
  4747. });
  4748. doc.addEventListener("touchstart", checkPointerDown, {
  4749. capture: true,
  4750. passive: false
  4751. });
  4752. doc.addEventListener("click", checkClick, {
  4753. capture: true,
  4754. passive: false
  4755. });
  4756. doc.addEventListener("keydown", checkKey, {
  4757. capture: true,
  4758. passive: false
  4759. });
  4760. return trap;
  4761. }
  4762. function removeListeners() {
  4763. if (!state.active) return;
  4764. doc.removeEventListener("focusin", checkFocusIn, true);
  4765. doc.removeEventListener("mousedown", checkPointerDown, true);
  4766. doc.removeEventListener("touchstart", checkPointerDown, true);
  4767. doc.removeEventListener("click", checkClick, true);
  4768. doc.removeEventListener("keydown", checkKey, true);
  4769. return trap;
  4770. }
  4771. function getNodeForOption(optionName) {
  4772. var optionValue = config[optionName];
  4773. var node = optionValue;
  4774. if (!optionValue) {
  4775. return null;
  4776. }
  4777. if (typeof optionValue === "string") {
  4778. node = doc.querySelector(optionValue);
  4779. if (!node) {
  4780. throw new Error("`" + optionName + "` refers to no known node");
  4781. }
  4782. }
  4783. if (typeof optionValue === "function") {
  4784. node = optionValue();
  4785. if (!node) {
  4786. throw new Error("`" + optionName + "` did not return a node");
  4787. }
  4788. }
  4789. return node;
  4790. }
  4791. function getInitialFocusNode() {
  4792. var node;
  4793. if (getNodeForOption("initialFocus") !== null) {
  4794. node = getNodeForOption("initialFocus");
  4795. } else if (container.contains(doc.activeElement)) {
  4796. node = doc.activeElement;
  4797. } else {
  4798. node = state.firstTabbableNode || getNodeForOption("fallbackFocus");
  4799. }
  4800. if (!node) {
  4801. throw new Error("You can't have a focus-trap without at least one focusable element");
  4802. }
  4803. return node;
  4804. }
  4805. function checkPointerDown(e) {
  4806. if (container.contains(e.target)) return;
  4807. if (config.clickOutsideDeactivates) {
  4808. deactivate({
  4809. returnFocus: !tabbable.isFocusable(e.target)
  4810. });
  4811. } else {
  4812. e.preventDefault();
  4813. }
  4814. }
  4815. function checkFocusIn(e) {
  4816. if (container.contains(e.target) || e.target instanceof Document) {
  4817. return;
  4818. }
  4819. e.stopImmediatePropagation();
  4820. tryFocus(state.mostRecentlyFocusedNode || getInitialFocusNode());
  4821. }
  4822. function checkKey(e) {
  4823. if (config.escapeDeactivates !== false && isEscapeEvent(e)) {
  4824. e.preventDefault();
  4825. deactivate();
  4826. return;
  4827. }
  4828. if (isTabEvent(e)) {
  4829. checkTab(e);
  4830. return;
  4831. }
  4832. }
  4833. function checkTab(e) {
  4834. updateTabbableNodes();
  4835. if (e.shiftKey && e.target === state.firstTabbableNode) {
  4836. e.preventDefault();
  4837. tryFocus(state.lastTabbableNode);
  4838. return;
  4839. }
  4840. if (!e.shiftKey && e.target === state.lastTabbableNode) {
  4841. e.preventDefault();
  4842. tryFocus(state.firstTabbableNode);
  4843. return;
  4844. }
  4845. }
  4846. function checkClick(e) {
  4847. if (config.clickOutsideDeactivates) return;
  4848. if (container.contains(e.target)) return;
  4849. e.preventDefault();
  4850. e.stopImmediatePropagation();
  4851. }
  4852. function updateTabbableNodes() {
  4853. var tabbableNodes = tabbable(container);
  4854. state.firstTabbableNode = tabbableNodes[0] || getInitialFocusNode();
  4855. state.lastTabbableNode = tabbableNodes[tabbableNodes.length - 1] || getInitialFocusNode();
  4856. }
  4857. function tryFocus(node) {
  4858. if (node === doc.activeElement) return;
  4859. if (!node || !node.focus) {
  4860. tryFocus(getInitialFocusNode());
  4861. return;
  4862. }
  4863. node.focus();
  4864. state.mostRecentlyFocusedNode = node;
  4865. if (isSelectableInput(node)) {
  4866. node.select();
  4867. }
  4868. }
  4869. }
  4870. function isSelectableInput(node) {
  4871. return node.tagName && node.tagName.toLowerCase() === "input" && typeof node.select === "function";
  4872. }
  4873. function isEscapeEvent(e) {
  4874. return e.key === "Escape" || e.key === "Esc" || e.keyCode === 27;
  4875. }
  4876. function isTabEvent(e) {
  4877. return e.key === "Tab" || e.keyCode === 9;
  4878. }
  4879. function delay(fn) {
  4880. return setTimeout(fn, 0);
  4881. }
  4882. module.exports = focusTrap;
  4883. }, function(module, exports, __webpack_require__) {
  4884. "use strict";
  4885. Object.defineProperty(exports, "__esModule", {
  4886. value: true
  4887. });
  4888. var cssClasses = {
  4889. LIST_ITEM_ACTIVATED_CLASS: "mdc-list-item--activated",
  4890. LIST_ITEM_CLASS: "mdc-list-item",
  4891. LIST_ITEM_DISABLED_CLASS: "mdc-list-item--disabled",
  4892. LIST_ITEM_SELECTED_CLASS: "mdc-list-item--selected",
  4893. ROOT: "mdc-list"
  4894. };
  4895. exports.cssClasses = cssClasses;
  4896. var strings = {
  4897. ACTION_EVENT: "MDCList:action",
  4898. ARIA_CHECKED: "aria-checked",
  4899. ARIA_CHECKED_CHECKBOX_SELECTOR: '[role="checkbox"][aria-checked="true"]',
  4900. ARIA_CHECKED_RADIO_SELECTOR: '[role="radio"][aria-checked="true"]',
  4901. ARIA_CURRENT: "aria-current",
  4902. ARIA_ORIENTATION: "aria-orientation",
  4903. ARIA_ORIENTATION_HORIZONTAL: "horizontal",
  4904. ARIA_ROLE_CHECKBOX_SELECTOR: '[role="checkbox"]',
  4905. ARIA_SELECTED: "aria-selected",
  4906. CHECKBOX_RADIO_SELECTOR: 'input[type="checkbox"]:not(:disabled), input[type="radio"]:not(:disabled)',
  4907. CHECKBOX_SELECTOR: 'input[type="checkbox"]:not(:disabled)',
  4908. CHILD_ELEMENTS_TO_TOGGLE_TABINDEX: "\n ." + cssClasses.LIST_ITEM_CLASS + " button:not(:disabled),\n ." + cssClasses.LIST_ITEM_CLASS + " a\n ",
  4909. FOCUSABLE_CHILD_ELEMENTS: "\n ." + cssClasses.LIST_ITEM_CLASS + " button:not(:disabled),\n ." + cssClasses.LIST_ITEM_CLASS + " a,\n ." + cssClasses.LIST_ITEM_CLASS + ' input[type="radio"]:not(:disabled),\n .' + cssClasses.LIST_ITEM_CLASS + ' input[type="checkbox"]:not(:disabled)\n ',
  4910. RADIO_SELECTOR: 'input[type="radio"]:not(:disabled)'
  4911. };
  4912. exports.strings = strings;
  4913. var numbers = {
  4914. UNSET_INDEX: -1
  4915. };
  4916. exports.numbers = numbers;
  4917. }, function(module, exports, __webpack_require__) {
  4918. "use strict";
  4919. var __extends = this && this.__extends || function() {
  4920. var _extendStatics = function extendStatics(d, b) {
  4921. _extendStatics = Object.setPrototypeOf || {
  4922. __proto__: []
  4923. } instanceof Array && function(d, b) {
  4924. d.__proto__ = b;
  4925. } || function(d, b) {
  4926. for (var p in b) {
  4927. if (b.hasOwnProperty(p)) d[p] = b[p];
  4928. }
  4929. };
  4930. return _extendStatics(d, b);
  4931. };
  4932. return function(d, b) {
  4933. _extendStatics(d, b);
  4934. function __() {
  4935. this.constructor = d;
  4936. }
  4937. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  4938. };
  4939. }();
  4940. Object.defineProperty(exports, "__esModule", {
  4941. value: true
  4942. });
  4943. var foundation_1 = __webpack_require__(14);
  4944. var MDCModalDrawerFoundation = function(_super) {
  4945. __extends(MDCModalDrawerFoundation, _super);
  4946. function MDCModalDrawerFoundation() {
  4947. return _super !== null && _super.apply(this, arguments) || this;
  4948. }
  4949. MDCModalDrawerFoundation.prototype.handleScrimClick = function() {
  4950. this.close();
  4951. };
  4952. MDCModalDrawerFoundation.prototype.opened_ = function() {
  4953. this.adapter_.trapFocus();
  4954. };
  4955. MDCModalDrawerFoundation.prototype.closed_ = function() {
  4956. this.adapter_.releaseFocus();
  4957. };
  4958. return MDCModalDrawerFoundation;
  4959. }(foundation_1.MDCDismissibleDrawerFoundation);
  4960. exports.MDCModalDrawerFoundation = MDCModalDrawerFoundation;
  4961. exports.default = MDCModalDrawerFoundation;
  4962. }, function(module, exports, __webpack_require__) {
  4963. "use strict";
  4964. var __extends = this && this.__extends || function() {
  4965. var _extendStatics = function extendStatics(d, b) {
  4966. _extendStatics = Object.setPrototypeOf || {
  4967. __proto__: []
  4968. } instanceof Array && function(d, b) {
  4969. d.__proto__ = b;
  4970. } || function(d, b) {
  4971. for (var p in b) {
  4972. if (b.hasOwnProperty(p)) d[p] = b[p];
  4973. }
  4974. };
  4975. return _extendStatics(d, b);
  4976. };
  4977. return function(d, b) {
  4978. _extendStatics(d, b);
  4979. function __() {
  4980. this.constructor = d;
  4981. }
  4982. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  4983. };
  4984. }();
  4985. var __assign = this && this.__assign || function() {
  4986. __assign = Object.assign || function(t) {
  4987. for (var s, i = 1, n = arguments.length; i < n; i++) {
  4988. s = arguments[i];
  4989. for (var p in s) {
  4990. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  4991. }
  4992. }
  4993. return t;
  4994. };
  4995. return __assign.apply(this, arguments);
  4996. };
  4997. Object.defineProperty(exports, "__esModule", {
  4998. value: true
  4999. });
  5000. var foundation_1 = __webpack_require__(0);
  5001. var constants_1 = __webpack_require__(106);
  5002. var MDCFormFieldFoundation = function(_super) {
  5003. __extends(MDCFormFieldFoundation, _super);
  5004. function MDCFormFieldFoundation(adapter) {
  5005. var _this = _super.call(this, __assign({}, MDCFormFieldFoundation.defaultAdapter, adapter)) || this;
  5006. _this.clickHandler_ = function() {
  5007. return _this.handleClick_();
  5008. };
  5009. return _this;
  5010. }
  5011. Object.defineProperty(MDCFormFieldFoundation, "cssClasses", {
  5012. get: function get() {
  5013. return constants_1.cssClasses;
  5014. },
  5015. enumerable: true,
  5016. configurable: true
  5017. });
  5018. Object.defineProperty(MDCFormFieldFoundation, "strings", {
  5019. get: function get() {
  5020. return constants_1.strings;
  5021. },
  5022. enumerable: true,
  5023. configurable: true
  5024. });
  5025. Object.defineProperty(MDCFormFieldFoundation, "defaultAdapter", {
  5026. get: function get() {
  5027. return {
  5028. activateInputRipple: function activateInputRipple() {
  5029. return undefined;
  5030. },
  5031. deactivateInputRipple: function deactivateInputRipple() {
  5032. return undefined;
  5033. },
  5034. deregisterInteractionHandler: function deregisterInteractionHandler() {
  5035. return undefined;
  5036. },
  5037. registerInteractionHandler: function registerInteractionHandler() {
  5038. return undefined;
  5039. }
  5040. };
  5041. },
  5042. enumerable: true,
  5043. configurable: true
  5044. });
  5045. MDCFormFieldFoundation.prototype.init = function() {
  5046. this.adapter_.registerInteractionHandler("click", this.clickHandler_);
  5047. };
  5048. MDCFormFieldFoundation.prototype.destroy = function() {
  5049. this.adapter_.deregisterInteractionHandler("click", this.clickHandler_);
  5050. };
  5051. MDCFormFieldFoundation.prototype.handleClick_ = function() {
  5052. var _this = this;
  5053. this.adapter_.activateInputRipple();
  5054. requestAnimationFrame(function() {
  5055. return _this.adapter_.deactivateInputRipple();
  5056. });
  5057. };
  5058. return MDCFormFieldFoundation;
  5059. }(foundation_1.MDCFoundation);
  5060. exports.MDCFormFieldFoundation = MDCFormFieldFoundation;
  5061. exports.default = MDCFormFieldFoundation;
  5062. }, function(module, exports, __webpack_require__) {
  5063. "use strict";
  5064. var __extends = this && this.__extends || function() {
  5065. var _extendStatics = function extendStatics(d, b) {
  5066. _extendStatics = Object.setPrototypeOf || {
  5067. __proto__: []
  5068. } instanceof Array && function(d, b) {
  5069. d.__proto__ = b;
  5070. } || function(d, b) {
  5071. for (var p in b) {
  5072. if (b.hasOwnProperty(p)) d[p] = b[p];
  5073. }
  5074. };
  5075. return _extendStatics(d, b);
  5076. };
  5077. return function(d, b) {
  5078. _extendStatics(d, b);
  5079. function __() {
  5080. this.constructor = d;
  5081. }
  5082. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  5083. };
  5084. }();
  5085. var __assign = this && this.__assign || function() {
  5086. __assign = Object.assign || function(t) {
  5087. for (var s, i = 1, n = arguments.length; i < n; i++) {
  5088. s = arguments[i];
  5089. for (var p in s) {
  5090. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  5091. }
  5092. }
  5093. return t;
  5094. };
  5095. return __assign.apply(this, arguments);
  5096. };
  5097. Object.defineProperty(exports, "__esModule", {
  5098. value: true
  5099. });
  5100. var foundation_1 = __webpack_require__(0);
  5101. var constants_1 = __webpack_require__(109);
  5102. var MDCGridListFoundation = function(_super) {
  5103. __extends(MDCGridListFoundation, _super);
  5104. function MDCGridListFoundation(adapter) {
  5105. var _this = _super.call(this, __assign({}, MDCGridListFoundation.defaultAdapter, adapter)) || this;
  5106. _this.resizeFrame_ = 0;
  5107. _this.resizeHandler_ = _this.alignCenter.bind(_this);
  5108. return _this;
  5109. }
  5110. Object.defineProperty(MDCGridListFoundation, "strings", {
  5111. get: function get() {
  5112. return constants_1.strings;
  5113. },
  5114. enumerable: true,
  5115. configurable: true
  5116. });
  5117. Object.defineProperty(MDCGridListFoundation, "defaultAdapter", {
  5118. get: function get() {
  5119. return {
  5120. deregisterResizeHandler: function deregisterResizeHandler() {
  5121. return undefined;
  5122. },
  5123. getNumberOfTiles: function getNumberOfTiles() {
  5124. return 0;
  5125. },
  5126. getOffsetWidth: function getOffsetWidth() {
  5127. return 0;
  5128. },
  5129. getOffsetWidthForTileAtIndex: function getOffsetWidthForTileAtIndex() {
  5130. return 0;
  5131. },
  5132. registerResizeHandler: function registerResizeHandler() {
  5133. return undefined;
  5134. },
  5135. setStyleForTilesElement: function setStyleForTilesElement() {
  5136. return undefined;
  5137. }
  5138. };
  5139. },
  5140. enumerable: true,
  5141. configurable: true
  5142. });
  5143. MDCGridListFoundation.prototype.init = function() {
  5144. this.alignCenter();
  5145. this.adapter_.registerResizeHandler(this.resizeHandler_);
  5146. };
  5147. MDCGridListFoundation.prototype.destroy = function() {
  5148. this.adapter_.deregisterResizeHandler(this.resizeHandler_);
  5149. };
  5150. MDCGridListFoundation.prototype.alignCenter = function() {
  5151. var _this = this;
  5152. cancelAnimationFrame(this.resizeFrame_);
  5153. this.resizeFrame_ = requestAnimationFrame(function() {
  5154. _this.alignCenter_();
  5155. _this.resizeFrame_ = 0;
  5156. });
  5157. };
  5158. MDCGridListFoundation.prototype.alignCenter_ = function() {
  5159. if (this.adapter_.getNumberOfTiles() === 0) {
  5160. return;
  5161. }
  5162. var gridWidth = this.adapter_.getOffsetWidth();
  5163. var itemWidth = this.adapter_.getOffsetWidthForTileAtIndex(0);
  5164. var tilesWidth = itemWidth * Math.floor(gridWidth / itemWidth);
  5165. this.adapter_.setStyleForTilesElement("width", tilesWidth + "px");
  5166. };
  5167. return MDCGridListFoundation;
  5168. }(foundation_1.MDCFoundation);
  5169. exports.MDCGridListFoundation = MDCGridListFoundation;
  5170. exports.default = MDCGridListFoundation;
  5171. }, function(module, exports, __webpack_require__) {
  5172. "use strict";
  5173. var __extends = this && this.__extends || function() {
  5174. var _extendStatics = function extendStatics(d, b) {
  5175. _extendStatics = Object.setPrototypeOf || {
  5176. __proto__: []
  5177. } instanceof Array && function(d, b) {
  5178. d.__proto__ = b;
  5179. } || function(d, b) {
  5180. for (var p in b) {
  5181. if (b.hasOwnProperty(p)) d[p] = b[p];
  5182. }
  5183. };
  5184. return _extendStatics(d, b);
  5185. };
  5186. return function(d, b) {
  5187. _extendStatics(d, b);
  5188. function __() {
  5189. this.constructor = d;
  5190. }
  5191. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  5192. };
  5193. }();
  5194. var __assign = this && this.__assign || function() {
  5195. __assign = Object.assign || function(t) {
  5196. for (var s, i = 1, n = arguments.length; i < n; i++) {
  5197. s = arguments[i];
  5198. for (var p in s) {
  5199. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  5200. }
  5201. }
  5202. return t;
  5203. };
  5204. return __assign.apply(this, arguments);
  5205. };
  5206. Object.defineProperty(exports, "__esModule", {
  5207. value: true
  5208. });
  5209. var foundation_1 = __webpack_require__(0);
  5210. var constants_1 = __webpack_require__(112);
  5211. var MDCIconButtonToggleFoundation = function(_super) {
  5212. __extends(MDCIconButtonToggleFoundation, _super);
  5213. function MDCIconButtonToggleFoundation(adapter) {
  5214. return _super.call(this, __assign({}, MDCIconButtonToggleFoundation.defaultAdapter, adapter)) || this;
  5215. }
  5216. Object.defineProperty(MDCIconButtonToggleFoundation, "cssClasses", {
  5217. get: function get() {
  5218. return constants_1.cssClasses;
  5219. },
  5220. enumerable: true,
  5221. configurable: true
  5222. });
  5223. Object.defineProperty(MDCIconButtonToggleFoundation, "strings", {
  5224. get: function get() {
  5225. return constants_1.strings;
  5226. },
  5227. enumerable: true,
  5228. configurable: true
  5229. });
  5230. Object.defineProperty(MDCIconButtonToggleFoundation, "defaultAdapter", {
  5231. get: function get() {
  5232. return {
  5233. addClass: function addClass() {
  5234. return undefined;
  5235. },
  5236. hasClass: function hasClass() {
  5237. return false;
  5238. },
  5239. notifyChange: function notifyChange() {
  5240. return undefined;
  5241. },
  5242. removeClass: function removeClass() {
  5243. return undefined;
  5244. },
  5245. setAttr: function setAttr() {
  5246. return undefined;
  5247. }
  5248. };
  5249. },
  5250. enumerable: true,
  5251. configurable: true
  5252. });
  5253. MDCIconButtonToggleFoundation.prototype.init = function() {
  5254. this.adapter_.setAttr(constants_1.strings.ARIA_PRESSED, "" + this.isOn());
  5255. };
  5256. MDCIconButtonToggleFoundation.prototype.handleClick = function() {
  5257. this.toggle();
  5258. this.adapter_.notifyChange({
  5259. isOn: this.isOn()
  5260. });
  5261. };
  5262. MDCIconButtonToggleFoundation.prototype.isOn = function() {
  5263. return this.adapter_.hasClass(constants_1.cssClasses.ICON_BUTTON_ON);
  5264. };
  5265. MDCIconButtonToggleFoundation.prototype.toggle = function(isOn) {
  5266. if (isOn === void 0) {
  5267. isOn = !this.isOn();
  5268. }
  5269. if (isOn) {
  5270. this.adapter_.addClass(constants_1.cssClasses.ICON_BUTTON_ON);
  5271. } else {
  5272. this.adapter_.removeClass(constants_1.cssClasses.ICON_BUTTON_ON);
  5273. }
  5274. this.adapter_.setAttr(constants_1.strings.ARIA_PRESSED, "" + isOn);
  5275. };
  5276. return MDCIconButtonToggleFoundation;
  5277. }(foundation_1.MDCFoundation);
  5278. exports.MDCIconButtonToggleFoundation = MDCIconButtonToggleFoundation;
  5279. exports.default = MDCIconButtonToggleFoundation;
  5280. }, function(module, exports, __webpack_require__) {
  5281. "use strict";
  5282. var __extends = this && this.__extends || function() {
  5283. var _extendStatics = function extendStatics(d, b) {
  5284. _extendStatics = Object.setPrototypeOf || {
  5285. __proto__: []
  5286. } instanceof Array && function(d, b) {
  5287. d.__proto__ = b;
  5288. } || function(d, b) {
  5289. for (var p in b) {
  5290. if (b.hasOwnProperty(p)) d[p] = b[p];
  5291. }
  5292. };
  5293. return _extendStatics(d, b);
  5294. };
  5295. return function(d, b) {
  5296. _extendStatics(d, b);
  5297. function __() {
  5298. this.constructor = d;
  5299. }
  5300. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  5301. };
  5302. }();
  5303. var __assign = this && this.__assign || function() {
  5304. __assign = Object.assign || function(t) {
  5305. for (var s, i = 1, n = arguments.length; i < n; i++) {
  5306. s = arguments[i];
  5307. for (var p in s) {
  5308. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  5309. }
  5310. }
  5311. return t;
  5312. };
  5313. return __assign.apply(this, arguments);
  5314. };
  5315. Object.defineProperty(exports, "__esModule", {
  5316. value: true
  5317. });
  5318. var foundation_1 = __webpack_require__(0);
  5319. var constants_1 = __webpack_require__(114);
  5320. var MDCLineRippleFoundation = function(_super) {
  5321. __extends(MDCLineRippleFoundation, _super);
  5322. function MDCLineRippleFoundation(adapter) {
  5323. var _this = _super.call(this, __assign({}, MDCLineRippleFoundation.defaultAdapter, adapter)) || this;
  5324. _this.transitionEndHandler_ = function(evt) {
  5325. return _this.handleTransitionEnd(evt);
  5326. };
  5327. return _this;
  5328. }
  5329. Object.defineProperty(MDCLineRippleFoundation, "cssClasses", {
  5330. get: function get() {
  5331. return constants_1.cssClasses;
  5332. },
  5333. enumerable: true,
  5334. configurable: true
  5335. });
  5336. Object.defineProperty(MDCLineRippleFoundation, "defaultAdapter", {
  5337. get: function get() {
  5338. return {
  5339. addClass: function addClass() {
  5340. return undefined;
  5341. },
  5342. removeClass: function removeClass() {
  5343. return undefined;
  5344. },
  5345. hasClass: function hasClass() {
  5346. return false;
  5347. },
  5348. setStyle: function setStyle() {
  5349. return undefined;
  5350. },
  5351. registerEventHandler: function registerEventHandler() {
  5352. return undefined;
  5353. },
  5354. deregisterEventHandler: function deregisterEventHandler() {
  5355. return undefined;
  5356. }
  5357. };
  5358. },
  5359. enumerable: true,
  5360. configurable: true
  5361. });
  5362. MDCLineRippleFoundation.prototype.init = function() {
  5363. this.adapter_.registerEventHandler("transitionend", this.transitionEndHandler_);
  5364. };
  5365. MDCLineRippleFoundation.prototype.destroy = function() {
  5366. this.adapter_.deregisterEventHandler("transitionend", this.transitionEndHandler_);
  5367. };
  5368. MDCLineRippleFoundation.prototype.activate = function() {
  5369. this.adapter_.removeClass(constants_1.cssClasses.LINE_RIPPLE_DEACTIVATING);
  5370. this.adapter_.addClass(constants_1.cssClasses.LINE_RIPPLE_ACTIVE);
  5371. };
  5372. MDCLineRippleFoundation.prototype.setRippleCenter = function(xCoordinate) {
  5373. this.adapter_.setStyle("transform-origin", xCoordinate + "px center");
  5374. };
  5375. MDCLineRippleFoundation.prototype.deactivate = function() {
  5376. this.adapter_.addClass(constants_1.cssClasses.LINE_RIPPLE_DEACTIVATING);
  5377. };
  5378. MDCLineRippleFoundation.prototype.handleTransitionEnd = function(evt) {
  5379. var isDeactivating = this.adapter_.hasClass(constants_1.cssClasses.LINE_RIPPLE_DEACTIVATING);
  5380. if (evt.propertyName === "opacity") {
  5381. if (isDeactivating) {
  5382. this.adapter_.removeClass(constants_1.cssClasses.LINE_RIPPLE_ACTIVE);
  5383. this.adapter_.removeClass(constants_1.cssClasses.LINE_RIPPLE_DEACTIVATING);
  5384. }
  5385. }
  5386. };
  5387. return MDCLineRippleFoundation;
  5388. }(foundation_1.MDCFoundation);
  5389. exports.MDCLineRippleFoundation = MDCLineRippleFoundation;
  5390. exports.default = MDCLineRippleFoundation;
  5391. }, function(module, exports, __webpack_require__) {
  5392. "use strict";
  5393. var __extends = this && this.__extends || function() {
  5394. var _extendStatics = function extendStatics(d, b) {
  5395. _extendStatics = Object.setPrototypeOf || {
  5396. __proto__: []
  5397. } instanceof Array && function(d, b) {
  5398. d.__proto__ = b;
  5399. } || function(d, b) {
  5400. for (var p in b) {
  5401. if (b.hasOwnProperty(p)) d[p] = b[p];
  5402. }
  5403. };
  5404. return _extendStatics(d, b);
  5405. };
  5406. return function(d, b) {
  5407. _extendStatics(d, b);
  5408. function __() {
  5409. this.constructor = d;
  5410. }
  5411. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  5412. };
  5413. }();
  5414. var __assign = this && this.__assign || function() {
  5415. __assign = Object.assign || function(t) {
  5416. for (var s, i = 1, n = arguments.length; i < n; i++) {
  5417. s = arguments[i];
  5418. for (var p in s) {
  5419. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  5420. }
  5421. }
  5422. return t;
  5423. };
  5424. return __assign.apply(this, arguments);
  5425. };
  5426. Object.defineProperty(exports, "__esModule", {
  5427. value: true
  5428. });
  5429. var util_1 = __webpack_require__(10);
  5430. var foundation_1 = __webpack_require__(0);
  5431. var constants_1 = __webpack_require__(117);
  5432. var MDCLinearProgressFoundation = function(_super) {
  5433. __extends(MDCLinearProgressFoundation, _super);
  5434. function MDCLinearProgressFoundation(adapter) {
  5435. return _super.call(this, __assign({}, MDCLinearProgressFoundation.defaultAdapter, adapter)) || this;
  5436. }
  5437. Object.defineProperty(MDCLinearProgressFoundation, "cssClasses", {
  5438. get: function get() {
  5439. return constants_1.cssClasses;
  5440. },
  5441. enumerable: true,
  5442. configurable: true
  5443. });
  5444. Object.defineProperty(MDCLinearProgressFoundation, "strings", {
  5445. get: function get() {
  5446. return constants_1.strings;
  5447. },
  5448. enumerable: true,
  5449. configurable: true
  5450. });
  5451. Object.defineProperty(MDCLinearProgressFoundation, "defaultAdapter", {
  5452. get: function get() {
  5453. return {
  5454. addClass: function addClass() {
  5455. return undefined;
  5456. },
  5457. getBuffer: function getBuffer() {
  5458. return null;
  5459. },
  5460. getPrimaryBar: function getPrimaryBar() {
  5461. return null;
  5462. },
  5463. hasClass: function hasClass() {
  5464. return false;
  5465. },
  5466. removeClass: function removeClass() {
  5467. return undefined;
  5468. },
  5469. setStyle: function setStyle() {
  5470. return undefined;
  5471. }
  5472. };
  5473. },
  5474. enumerable: true,
  5475. configurable: true
  5476. });
  5477. MDCLinearProgressFoundation.prototype.init = function() {
  5478. this.isDeterminate_ = !this.adapter_.hasClass(constants_1.cssClasses.INDETERMINATE_CLASS);
  5479. this.isReversed_ = this.adapter_.hasClass(constants_1.cssClasses.REVERSED_CLASS);
  5480. this.progress_ = 0;
  5481. };
  5482. MDCLinearProgressFoundation.prototype.setDeterminate = function(isDeterminate) {
  5483. this.isDeterminate_ = isDeterminate;
  5484. if (this.isDeterminate_) {
  5485. this.adapter_.removeClass(constants_1.cssClasses.INDETERMINATE_CLASS);
  5486. this.setScale_(this.adapter_.getPrimaryBar(), this.progress_);
  5487. } else {
  5488. this.adapter_.addClass(constants_1.cssClasses.INDETERMINATE_CLASS);
  5489. this.setScale_(this.adapter_.getPrimaryBar(), 1);
  5490. this.setScale_(this.adapter_.getBuffer(), 1);
  5491. }
  5492. };
  5493. MDCLinearProgressFoundation.prototype.setProgress = function(value) {
  5494. this.progress_ = value;
  5495. if (this.isDeterminate_) {
  5496. this.setScale_(this.adapter_.getPrimaryBar(), value);
  5497. }
  5498. };
  5499. MDCLinearProgressFoundation.prototype.setBuffer = function(value) {
  5500. if (this.isDeterminate_) {
  5501. this.setScale_(this.adapter_.getBuffer(), value);
  5502. }
  5503. };
  5504. MDCLinearProgressFoundation.prototype.setReverse = function(isReversed) {
  5505. this.isReversed_ = isReversed;
  5506. if (this.isReversed_) {
  5507. this.adapter_.addClass(constants_1.cssClasses.REVERSED_CLASS);
  5508. } else {
  5509. this.adapter_.removeClass(constants_1.cssClasses.REVERSED_CLASS);
  5510. }
  5511. };
  5512. MDCLinearProgressFoundation.prototype.open = function() {
  5513. this.adapter_.removeClass(constants_1.cssClasses.CLOSED_CLASS);
  5514. };
  5515. MDCLinearProgressFoundation.prototype.close = function() {
  5516. this.adapter_.addClass(constants_1.cssClasses.CLOSED_CLASS);
  5517. };
  5518. MDCLinearProgressFoundation.prototype.setScale_ = function(el, scaleValue) {
  5519. if (!el) {
  5520. return;
  5521. }
  5522. var value = "scaleX(" + scaleValue + ")";
  5523. this.adapter_.setStyle(el, util_1.getCorrectPropertyName(window, "transform"), value);
  5524. };
  5525. return MDCLinearProgressFoundation;
  5526. }(foundation_1.MDCFoundation);
  5527. exports.MDCLinearProgressFoundation = MDCLinearProgressFoundation;
  5528. exports.default = MDCLinearProgressFoundation;
  5529. }, function(module, exports, __webpack_require__) {
  5530. "use strict";
  5531. Object.defineProperty(exports, "__esModule", {
  5532. value: true
  5533. });
  5534. var cachedCssTransformPropertyName_;
  5535. function getTransformPropertyName(globalObj, forceRefresh) {
  5536. if (forceRefresh === void 0) {
  5537. forceRefresh = false;
  5538. }
  5539. if (cachedCssTransformPropertyName_ === undefined || forceRefresh) {
  5540. var el = globalObj.document.createElement("div");
  5541. cachedCssTransformPropertyName_ = "transform" in el.style ? "transform" : "webkitTransform";
  5542. }
  5543. return cachedCssTransformPropertyName_;
  5544. }
  5545. exports.getTransformPropertyName = getTransformPropertyName;
  5546. }, function(module, exports, __webpack_require__) {
  5547. "use strict";
  5548. var __extends = this && this.__extends || function() {
  5549. var _extendStatics = function extendStatics(d, b) {
  5550. _extendStatics = Object.setPrototypeOf || {
  5551. __proto__: []
  5552. } instanceof Array && function(d, b) {
  5553. d.__proto__ = b;
  5554. } || function(d, b) {
  5555. for (var p in b) {
  5556. if (b.hasOwnProperty(p)) d[p] = b[p];
  5557. }
  5558. };
  5559. return _extendStatics(d, b);
  5560. };
  5561. return function(d, b) {
  5562. _extendStatics(d, b);
  5563. function __() {
  5564. this.constructor = d;
  5565. }
  5566. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  5567. };
  5568. }();
  5569. var __importStar = this && this.__importStar || function(mod) {
  5570. if (mod && mod.__esModule) return mod;
  5571. var result = {};
  5572. if (mod != null) for (var k in mod) {
  5573. if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  5574. }
  5575. result["default"] = mod;
  5576. return result;
  5577. };
  5578. Object.defineProperty(exports, "__esModule", {
  5579. value: true
  5580. });
  5581. var component_1 = __webpack_require__(1);
  5582. var constants_1 = __webpack_require__(6);
  5583. var foundation_1 = __webpack_require__(8);
  5584. var util = __importStar(__webpack_require__(42));
  5585. var MDCMenuSurface = function(_super) {
  5586. __extends(MDCMenuSurface, _super);
  5587. function MDCMenuSurface() {
  5588. return _super !== null && _super.apply(this, arguments) || this;
  5589. }
  5590. MDCMenuSurface.attachTo = function(root) {
  5591. return new MDCMenuSurface(root);
  5592. };
  5593. MDCMenuSurface.prototype.initialSyncWithDOM = function() {
  5594. var _this = this;
  5595. var parentEl = this.root_.parentElement;
  5596. this.anchorElement = parentEl && parentEl.classList.contains(constants_1.cssClasses.ANCHOR) ? parentEl : null;
  5597. if (this.root_.classList.contains(constants_1.cssClasses.FIXED)) {
  5598. this.setFixedPosition(true);
  5599. }
  5600. this.handleKeydown_ = function(evt) {
  5601. return _this.foundation_.handleKeydown(evt);
  5602. };
  5603. this.handleBodyClick_ = function(evt) {
  5604. return _this.foundation_.handleBodyClick(evt);
  5605. };
  5606. this.registerBodyClickListener_ = function() {
  5607. return document.body.addEventListener("click", _this.handleBodyClick_);
  5608. };
  5609. this.deregisterBodyClickListener_ = function() {
  5610. return document.body.removeEventListener("click", _this.handleBodyClick_);
  5611. };
  5612. this.listen("keydown", this.handleKeydown_);
  5613. this.listen(constants_1.strings.OPENED_EVENT, this.registerBodyClickListener_);
  5614. this.listen(constants_1.strings.CLOSED_EVENT, this.deregisterBodyClickListener_);
  5615. };
  5616. MDCMenuSurface.prototype.destroy = function() {
  5617. this.unlisten("keydown", this.handleKeydown_);
  5618. this.unlisten(constants_1.strings.OPENED_EVENT, this.registerBodyClickListener_);
  5619. this.unlisten(constants_1.strings.CLOSED_EVENT, this.deregisterBodyClickListener_);
  5620. _super.prototype.destroy.call(this);
  5621. };
  5622. Object.defineProperty(MDCMenuSurface.prototype, "open", {
  5623. get: function get() {
  5624. return this.foundation_.isOpen();
  5625. },
  5626. set: function set(value) {
  5627. if (value) {
  5628. var focusableElements = this.root_.querySelectorAll(constants_1.strings.FOCUSABLE_ELEMENTS);
  5629. this.firstFocusableElement_ = focusableElements[0];
  5630. this.lastFocusableElement_ = focusableElements[focusableElements.length - 1];
  5631. this.foundation_.open();
  5632. } else {
  5633. this.foundation_.close();
  5634. }
  5635. },
  5636. enumerable: true,
  5637. configurable: true
  5638. });
  5639. Object.defineProperty(MDCMenuSurface.prototype, "quickOpen", {
  5640. set: function set(quickOpen) {
  5641. this.foundation_.setQuickOpen(quickOpen);
  5642. },
  5643. enumerable: true,
  5644. configurable: true
  5645. });
  5646. MDCMenuSurface.prototype.hoistMenuToBody = function() {
  5647. document.body.appendChild(this.root_);
  5648. this.setIsHoisted(true);
  5649. };
  5650. MDCMenuSurface.prototype.setIsHoisted = function(isHoisted) {
  5651. this.foundation_.setIsHoisted(isHoisted);
  5652. };
  5653. MDCMenuSurface.prototype.setMenuSurfaceAnchorElement = function(element) {
  5654. this.anchorElement = element;
  5655. };
  5656. MDCMenuSurface.prototype.setFixedPosition = function(isFixed) {
  5657. if (isFixed) {
  5658. this.root_.classList.add(constants_1.cssClasses.FIXED);
  5659. } else {
  5660. this.root_.classList.remove(constants_1.cssClasses.FIXED);
  5661. }
  5662. this.foundation_.setFixedPosition(isFixed);
  5663. };
  5664. MDCMenuSurface.prototype.setAbsolutePosition = function(x, y) {
  5665. this.foundation_.setAbsolutePosition(x, y);
  5666. this.setIsHoisted(true);
  5667. };
  5668. MDCMenuSurface.prototype.setAnchorCorner = function(corner) {
  5669. this.foundation_.setAnchorCorner(corner);
  5670. };
  5671. MDCMenuSurface.prototype.setAnchorMargin = function(margin) {
  5672. this.foundation_.setAnchorMargin(margin);
  5673. };
  5674. MDCMenuSurface.prototype.getDefaultFoundation = function() {
  5675. var _this = this;
  5676. var adapter = {
  5677. addClass: function addClass(className) {
  5678. return _this.root_.classList.add(className);
  5679. },
  5680. removeClass: function removeClass(className) {
  5681. return _this.root_.classList.remove(className);
  5682. },
  5683. hasClass: function hasClass(className) {
  5684. return _this.root_.classList.contains(className);
  5685. },
  5686. hasAnchor: function hasAnchor() {
  5687. return !!_this.anchorElement;
  5688. },
  5689. notifyClose: function notifyClose() {
  5690. return _this.emit(foundation_1.MDCMenuSurfaceFoundation.strings.CLOSED_EVENT, {});
  5691. },
  5692. notifyOpen: function notifyOpen() {
  5693. return _this.emit(foundation_1.MDCMenuSurfaceFoundation.strings.OPENED_EVENT, {});
  5694. },
  5695. isElementInContainer: function isElementInContainer(el) {
  5696. return _this.root_.contains(el);
  5697. },
  5698. isRtl: function isRtl() {
  5699. return getComputedStyle(_this.root_).getPropertyValue("direction") === "rtl";
  5700. },
  5701. setTransformOrigin: function setTransformOrigin(origin) {
  5702. var propertyName = util.getTransformPropertyName(window) + "-origin";
  5703. _this.root_.style.setProperty(propertyName, origin);
  5704. },
  5705. isFocused: function isFocused() {
  5706. return document.activeElement === _this.root_;
  5707. },
  5708. saveFocus: function saveFocus() {
  5709. _this.previousFocus_ = document.activeElement;
  5710. },
  5711. restoreFocus: function restoreFocus() {
  5712. if (_this.root_.contains(document.activeElement)) {
  5713. if (_this.previousFocus_ && _this.previousFocus_.focus) {
  5714. _this.previousFocus_.focus();
  5715. }
  5716. }
  5717. },
  5718. isFirstElementFocused: function isFirstElementFocused() {
  5719. return _this.firstFocusableElement_ ? _this.firstFocusableElement_ === document.activeElement : false;
  5720. },
  5721. isLastElementFocused: function isLastElementFocused() {
  5722. return _this.lastFocusableElement_ ? _this.lastFocusableElement_ === document.activeElement : false;
  5723. },
  5724. focusFirstElement: function focusFirstElement() {
  5725. return _this.firstFocusableElement_ && _this.firstFocusableElement_.focus && _this.firstFocusableElement_.focus();
  5726. },
  5727. focusLastElement: function focusLastElement() {
  5728. return _this.lastFocusableElement_ && _this.lastFocusableElement_.focus && _this.lastFocusableElement_.focus();
  5729. },
  5730. getInnerDimensions: function getInnerDimensions() {
  5731. return {
  5732. width: _this.root_.offsetWidth,
  5733. height: _this.root_.offsetHeight
  5734. };
  5735. },
  5736. getAnchorDimensions: function getAnchorDimensions() {
  5737. return _this.anchorElement ? _this.anchorElement.getBoundingClientRect() : null;
  5738. },
  5739. getWindowDimensions: function getWindowDimensions() {
  5740. return {
  5741. width: window.innerWidth,
  5742. height: window.innerHeight
  5743. };
  5744. },
  5745. getBodyDimensions: function getBodyDimensions() {
  5746. return {
  5747. width: document.body.clientWidth,
  5748. height: document.body.clientHeight
  5749. };
  5750. },
  5751. getWindowScroll: function getWindowScroll() {
  5752. return {
  5753. x: window.pageXOffset,
  5754. y: window.pageYOffset
  5755. };
  5756. },
  5757. setPosition: function setPosition(position) {
  5758. _this.root_.style.left = "left" in position ? position.left + "px" : "";
  5759. _this.root_.style.right = "right" in position ? position.right + "px" : "";
  5760. _this.root_.style.top = "top" in position ? position.top + "px" : "";
  5761. _this.root_.style.bottom = "bottom" in position ? position.bottom + "px" : "";
  5762. },
  5763. setMaxHeight: function setMaxHeight(height) {
  5764. _this.root_.style.maxHeight = height;
  5765. }
  5766. };
  5767. return new foundation_1.MDCMenuSurfaceFoundation(adapter);
  5768. };
  5769. return MDCMenuSurface;
  5770. }(component_1.MDCComponent);
  5771. exports.MDCMenuSurface = MDCMenuSurface;
  5772. }, function(module, exports, __webpack_require__) {
  5773. "use strict";
  5774. var __extends = this && this.__extends || function() {
  5775. var _extendStatics = function extendStatics(d, b) {
  5776. _extendStatics = Object.setPrototypeOf || {
  5777. __proto__: []
  5778. } instanceof Array && function(d, b) {
  5779. d.__proto__ = b;
  5780. } || function(d, b) {
  5781. for (var p in b) {
  5782. if (b.hasOwnProperty(p)) d[p] = b[p];
  5783. }
  5784. };
  5785. return _extendStatics(d, b);
  5786. };
  5787. return function(d, b) {
  5788. _extendStatics(d, b);
  5789. function __() {
  5790. this.constructor = d;
  5791. }
  5792. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  5793. };
  5794. }();
  5795. Object.defineProperty(exports, "__esModule", {
  5796. value: true
  5797. });
  5798. var component_1 = __webpack_require__(1);
  5799. var component_2 = __webpack_require__(13);
  5800. var foundation_1 = __webpack_require__(5);
  5801. var component_3 = __webpack_require__(43);
  5802. var foundation_2 = __webpack_require__(8);
  5803. var constants_1 = __webpack_require__(18);
  5804. var foundation_3 = __webpack_require__(45);
  5805. var MDCMenu = function(_super) {
  5806. __extends(MDCMenu, _super);
  5807. function MDCMenu() {
  5808. return _super !== null && _super.apply(this, arguments) || this;
  5809. }
  5810. MDCMenu.attachTo = function(root) {
  5811. return new MDCMenu(root);
  5812. };
  5813. MDCMenu.prototype.initialize = function(menuSurfaceFactory, listFactory) {
  5814. if (menuSurfaceFactory === void 0) {
  5815. menuSurfaceFactory = function menuSurfaceFactory(el) {
  5816. return new component_3.MDCMenuSurface(el);
  5817. };
  5818. }
  5819. if (listFactory === void 0) {
  5820. listFactory = function listFactory(el) {
  5821. return new component_2.MDCList(el);
  5822. };
  5823. }
  5824. this.menuSurfaceFactory_ = menuSurfaceFactory;
  5825. this.listFactory_ = listFactory;
  5826. };
  5827. MDCMenu.prototype.initialSyncWithDOM = function() {
  5828. var _this = this;
  5829. this.menuSurface_ = this.menuSurfaceFactory_(this.root_);
  5830. var list = this.root_.querySelector(constants_1.strings.LIST_SELECTOR);
  5831. if (list) {
  5832. this.list_ = this.listFactory_(list);
  5833. this.list_.wrapFocus = true;
  5834. } else {
  5835. this.list_ = null;
  5836. }
  5837. this.handleKeydown_ = function(evt) {
  5838. return _this.foundation_.handleKeydown(evt);
  5839. };
  5840. this.handleItemAction_ = function(evt) {
  5841. return _this.foundation_.handleItemAction(_this.items[evt.detail.index]);
  5842. };
  5843. this.handleMenuSurfaceOpened_ = function() {
  5844. return _this.foundation_.handleMenuSurfaceOpened();
  5845. };
  5846. this.menuSurface_.listen(foundation_2.MDCMenuSurfaceFoundation.strings.OPENED_EVENT, this.handleMenuSurfaceOpened_);
  5847. this.listen("keydown", this.handleKeydown_);
  5848. this.listen(foundation_1.MDCListFoundation.strings.ACTION_EVENT, this.handleItemAction_);
  5849. };
  5850. MDCMenu.prototype.destroy = function() {
  5851. if (this.list_) {
  5852. this.list_.destroy();
  5853. }
  5854. this.menuSurface_.destroy();
  5855. this.menuSurface_.unlisten(foundation_2.MDCMenuSurfaceFoundation.strings.OPENED_EVENT, this.handleMenuSurfaceOpened_);
  5856. this.unlisten("keydown", this.handleKeydown_);
  5857. this.unlisten(foundation_1.MDCListFoundation.strings.ACTION_EVENT, this.handleItemAction_);
  5858. _super.prototype.destroy.call(this);
  5859. };
  5860. Object.defineProperty(MDCMenu.prototype, "open", {
  5861. get: function get() {
  5862. return this.menuSurface_.open;
  5863. },
  5864. set: function set(value) {
  5865. this.menuSurface_.open = value;
  5866. },
  5867. enumerable: true,
  5868. configurable: true
  5869. });
  5870. Object.defineProperty(MDCMenu.prototype, "wrapFocus", {
  5871. get: function get() {
  5872. return this.list_ ? this.list_.wrapFocus : false;
  5873. },
  5874. set: function set(value) {
  5875. if (this.list_) {
  5876. this.list_.wrapFocus = value;
  5877. }
  5878. },
  5879. enumerable: true,
  5880. configurable: true
  5881. });
  5882. Object.defineProperty(MDCMenu.prototype, "items", {
  5883. get: function get() {
  5884. return this.list_ ? this.list_.listElements : [];
  5885. },
  5886. enumerable: true,
  5887. configurable: true
  5888. });
  5889. Object.defineProperty(MDCMenu.prototype, "quickOpen", {
  5890. set: function set(quickOpen) {
  5891. this.menuSurface_.quickOpen = quickOpen;
  5892. },
  5893. enumerable: true,
  5894. configurable: true
  5895. });
  5896. MDCMenu.prototype.setDefaultFocusState = function(focusState) {
  5897. this.foundation_.setDefaultFocusState(focusState);
  5898. };
  5899. MDCMenu.prototype.setAnchorCorner = function(corner) {
  5900. this.menuSurface_.setAnchorCorner(corner);
  5901. };
  5902. MDCMenu.prototype.setAnchorMargin = function(margin) {
  5903. this.menuSurface_.setAnchorMargin(margin);
  5904. };
  5905. MDCMenu.prototype.getOptionByIndex = function(index) {
  5906. var items = this.items;
  5907. if (index < items.length) {
  5908. return this.items[index];
  5909. } else {
  5910. return null;
  5911. }
  5912. };
  5913. MDCMenu.prototype.setFixedPosition = function(isFixed) {
  5914. this.menuSurface_.setFixedPosition(isFixed);
  5915. };
  5916. MDCMenu.prototype.hoistMenuToBody = function() {
  5917. this.menuSurface_.hoistMenuToBody();
  5918. };
  5919. MDCMenu.prototype.setIsHoisted = function(isHoisted) {
  5920. this.menuSurface_.setIsHoisted(isHoisted);
  5921. };
  5922. MDCMenu.prototype.setAbsolutePosition = function(x, y) {
  5923. this.menuSurface_.setAbsolutePosition(x, y);
  5924. };
  5925. MDCMenu.prototype.setAnchorElement = function(element) {
  5926. this.menuSurface_.anchorElement = element;
  5927. };
  5928. MDCMenu.prototype.getDefaultFoundation = function() {
  5929. var _this = this;
  5930. var adapter = {
  5931. addClassToElementAtIndex: function addClassToElementAtIndex(index, className) {
  5932. var list = _this.items;
  5933. list[index].classList.add(className);
  5934. },
  5935. removeClassFromElementAtIndex: function removeClassFromElementAtIndex(index, className) {
  5936. var list = _this.items;
  5937. list[index].classList.remove(className);
  5938. },
  5939. addAttributeToElementAtIndex: function addAttributeToElementAtIndex(index, attr, value) {
  5940. var list = _this.items;
  5941. list[index].setAttribute(attr, value);
  5942. },
  5943. removeAttributeFromElementAtIndex: function removeAttributeFromElementAtIndex(index, attr) {
  5944. var list = _this.items;
  5945. list[index].removeAttribute(attr);
  5946. },
  5947. elementContainsClass: function elementContainsClass(element, className) {
  5948. return element.classList.contains(className);
  5949. },
  5950. closeSurface: function closeSurface() {
  5951. return _this.open = false;
  5952. },
  5953. getElementIndex: function getElementIndex(element) {
  5954. return _this.items.indexOf(element);
  5955. },
  5956. getParentElement: function getParentElement(element) {
  5957. return element.parentElement;
  5958. },
  5959. getSelectedElementIndex: function getSelectedElementIndex(selectionGroup) {
  5960. var selectedListItem = selectionGroup.querySelector("." + constants_1.cssClasses.MENU_SELECTED_LIST_ITEM);
  5961. return selectedListItem ? _this.items.indexOf(selectedListItem) : -1;
  5962. },
  5963. notifySelected: function notifySelected(evtData) {
  5964. return _this.emit(constants_1.strings.SELECTED_EVENT, {
  5965. index: evtData.index,
  5966. item: _this.items[evtData.index]
  5967. });
  5968. },
  5969. getMenuItemCount: function getMenuItemCount() {
  5970. return _this.items.length;
  5971. },
  5972. focusItemAtIndex: function focusItemAtIndex(index) {
  5973. return _this.items[index].focus();
  5974. },
  5975. focusListRoot: function focusListRoot() {
  5976. return _this.root_.querySelector(constants_1.strings.LIST_SELECTOR).focus();
  5977. }
  5978. };
  5979. return new foundation_3.MDCMenuFoundation(adapter);
  5980. };
  5981. return MDCMenu;
  5982. }(component_1.MDCComponent);
  5983. exports.MDCMenu = MDCMenu;
  5984. }, function(module, exports, __webpack_require__) {
  5985. "use strict";
  5986. var __extends = this && this.__extends || function() {
  5987. var _extendStatics = function extendStatics(d, b) {
  5988. _extendStatics = Object.setPrototypeOf || {
  5989. __proto__: []
  5990. } instanceof Array && function(d, b) {
  5991. d.__proto__ = b;
  5992. } || function(d, b) {
  5993. for (var p in b) {
  5994. if (b.hasOwnProperty(p)) d[p] = b[p];
  5995. }
  5996. };
  5997. return _extendStatics(d, b);
  5998. };
  5999. return function(d, b) {
  6000. _extendStatics(d, b);
  6001. function __() {
  6002. this.constructor = d;
  6003. }
  6004. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  6005. };
  6006. }();
  6007. var __assign = this && this.__assign || function() {
  6008. __assign = Object.assign || function(t) {
  6009. for (var s, i = 1, n = arguments.length; i < n; i++) {
  6010. s = arguments[i];
  6011. for (var p in s) {
  6012. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  6013. }
  6014. }
  6015. return t;
  6016. };
  6017. return __assign.apply(this, arguments);
  6018. };
  6019. Object.defineProperty(exports, "__esModule", {
  6020. value: true
  6021. });
  6022. var foundation_1 = __webpack_require__(0);
  6023. var foundation_2 = __webpack_require__(5);
  6024. var foundation_3 = __webpack_require__(8);
  6025. var constants_1 = __webpack_require__(18);
  6026. var MDCMenuFoundation = function(_super) {
  6027. __extends(MDCMenuFoundation, _super);
  6028. function MDCMenuFoundation(adapter) {
  6029. var _this = _super.call(this, __assign({}, MDCMenuFoundation.defaultAdapter, adapter)) || this;
  6030. _this.closeAnimationEndTimerId_ = 0;
  6031. _this.defaultFocusState_ = constants_1.DefaultFocusState.LIST_ROOT;
  6032. return _this;
  6033. }
  6034. Object.defineProperty(MDCMenuFoundation, "cssClasses", {
  6035. get: function get() {
  6036. return constants_1.cssClasses;
  6037. },
  6038. enumerable: true,
  6039. configurable: true
  6040. });
  6041. Object.defineProperty(MDCMenuFoundation, "strings", {
  6042. get: function get() {
  6043. return constants_1.strings;
  6044. },
  6045. enumerable: true,
  6046. configurable: true
  6047. });
  6048. Object.defineProperty(MDCMenuFoundation, "numbers", {
  6049. get: function get() {
  6050. return constants_1.numbers;
  6051. },
  6052. enumerable: true,
  6053. configurable: true
  6054. });
  6055. Object.defineProperty(MDCMenuFoundation, "defaultAdapter", {
  6056. get: function get() {
  6057. return {
  6058. addClassToElementAtIndex: function addClassToElementAtIndex() {
  6059. return undefined;
  6060. },
  6061. removeClassFromElementAtIndex: function removeClassFromElementAtIndex() {
  6062. return undefined;
  6063. },
  6064. addAttributeToElementAtIndex: function addAttributeToElementAtIndex() {
  6065. return undefined;
  6066. },
  6067. removeAttributeFromElementAtIndex: function removeAttributeFromElementAtIndex() {
  6068. return undefined;
  6069. },
  6070. elementContainsClass: function elementContainsClass() {
  6071. return false;
  6072. },
  6073. closeSurface: function closeSurface() {
  6074. return undefined;
  6075. },
  6076. getElementIndex: function getElementIndex() {
  6077. return -1;
  6078. },
  6079. getParentElement: function getParentElement() {
  6080. return null;
  6081. },
  6082. getSelectedElementIndex: function getSelectedElementIndex() {
  6083. return -1;
  6084. },
  6085. notifySelected: function notifySelected() {
  6086. return undefined;
  6087. },
  6088. getMenuItemCount: function getMenuItemCount() {
  6089. return 0;
  6090. },
  6091. focusItemAtIndex: function focusItemAtIndex() {
  6092. return undefined;
  6093. },
  6094. focusListRoot: function focusListRoot() {
  6095. return undefined;
  6096. }
  6097. };
  6098. },
  6099. enumerable: true,
  6100. configurable: true
  6101. });
  6102. MDCMenuFoundation.prototype.destroy = function() {
  6103. if (this.closeAnimationEndTimerId_) {
  6104. clearTimeout(this.closeAnimationEndTimerId_);
  6105. }
  6106. this.adapter_.closeSurface();
  6107. };
  6108. MDCMenuFoundation.prototype.handleKeydown = function(evt) {
  6109. var key = evt.key, keyCode = evt.keyCode;
  6110. var isTab = key === "Tab" || keyCode === 9;
  6111. if (isTab) {
  6112. this.adapter_.closeSurface();
  6113. }
  6114. };
  6115. MDCMenuFoundation.prototype.handleItemAction = function(listItem) {
  6116. var _this = this;
  6117. var index = this.adapter_.getElementIndex(listItem);
  6118. if (index < 0) {
  6119. return;
  6120. }
  6121. this.adapter_.notifySelected({
  6122. index: index
  6123. });
  6124. this.adapter_.closeSurface();
  6125. this.closeAnimationEndTimerId_ = setTimeout(function() {
  6126. var selectionGroup = _this.getSelectionGroup_(listItem);
  6127. if (selectionGroup) {
  6128. _this.handleSelectionGroup_(selectionGroup, index);
  6129. }
  6130. }, foundation_3.MDCMenuSurfaceFoundation.numbers.TRANSITION_CLOSE_DURATION);
  6131. };
  6132. MDCMenuFoundation.prototype.handleMenuSurfaceOpened = function() {
  6133. switch (this.defaultFocusState_) {
  6134. case constants_1.DefaultFocusState.FIRST_ITEM:
  6135. this.adapter_.focusItemAtIndex(0);
  6136. break;
  6137. case constants_1.DefaultFocusState.LAST_ITEM:
  6138. this.adapter_.focusItemAtIndex(this.adapter_.getMenuItemCount() - 1);
  6139. break;
  6140. case constants_1.DefaultFocusState.NONE:
  6141. break;
  6142. default:
  6143. this.adapter_.focusListRoot();
  6144. break;
  6145. }
  6146. };
  6147. MDCMenuFoundation.prototype.setDefaultFocusState = function(focusState) {
  6148. this.defaultFocusState_ = focusState;
  6149. };
  6150. MDCMenuFoundation.prototype.handleSelectionGroup_ = function(selectionGroup, index) {
  6151. var selectedIndex = this.adapter_.getSelectedElementIndex(selectionGroup);
  6152. if (selectedIndex >= 0) {
  6153. this.adapter_.removeAttributeFromElementAtIndex(selectedIndex, constants_1.strings.ARIA_SELECTED_ATTR);
  6154. this.adapter_.removeClassFromElementAtIndex(selectedIndex, constants_1.cssClasses.MENU_SELECTED_LIST_ITEM);
  6155. }
  6156. this.adapter_.addClassToElementAtIndex(index, constants_1.cssClasses.MENU_SELECTED_LIST_ITEM);
  6157. this.adapter_.addAttributeToElementAtIndex(index, constants_1.strings.ARIA_SELECTED_ATTR, "true");
  6158. };
  6159. MDCMenuFoundation.prototype.getSelectionGroup_ = function(listItem) {
  6160. var parent = this.adapter_.getParentElement(listItem);
  6161. if (!parent) {
  6162. return null;
  6163. }
  6164. var isGroup = this.adapter_.elementContainsClass(parent, constants_1.cssClasses.MENU_SELECTION_GROUP);
  6165. while (!isGroup && parent && !this.adapter_.elementContainsClass(parent, foundation_2.MDCListFoundation.cssClasses.ROOT)) {
  6166. parent = this.adapter_.getParentElement(parent);
  6167. isGroup = parent ? this.adapter_.elementContainsClass(parent, constants_1.cssClasses.MENU_SELECTION_GROUP) : false;
  6168. }
  6169. if (isGroup) {
  6170. return parent;
  6171. } else {
  6172. return null;
  6173. }
  6174. };
  6175. return MDCMenuFoundation;
  6176. }(foundation_1.MDCFoundation);
  6177. exports.MDCMenuFoundation = MDCMenuFoundation;
  6178. exports.default = MDCMenuFoundation;
  6179. }, function(module, exports, __webpack_require__) {
  6180. "use strict";
  6181. Object.defineProperty(exports, "__esModule", {
  6182. value: true
  6183. });
  6184. var strings = {
  6185. NOTCH_ELEMENT_SELECTOR: ".mdc-notched-outline__notch"
  6186. };
  6187. exports.strings = strings;
  6188. var numbers = {
  6189. NOTCH_ELEMENT_PADDING: 8
  6190. };
  6191. exports.numbers = numbers;
  6192. var cssClasses = {
  6193. NO_LABEL: "mdc-notched-outline--no-label",
  6194. OUTLINE_NOTCHED: "mdc-notched-outline--notched",
  6195. OUTLINE_UPGRADED: "mdc-notched-outline--upgraded"
  6196. };
  6197. exports.cssClasses = cssClasses;
  6198. }, function(module, exports, __webpack_require__) {
  6199. "use strict";
  6200. var __extends = this && this.__extends || function() {
  6201. var _extendStatics = function extendStatics(d, b) {
  6202. _extendStatics = Object.setPrototypeOf || {
  6203. __proto__: []
  6204. } instanceof Array && function(d, b) {
  6205. d.__proto__ = b;
  6206. } || function(d, b) {
  6207. for (var p in b) {
  6208. if (b.hasOwnProperty(p)) d[p] = b[p];
  6209. }
  6210. };
  6211. return _extendStatics(d, b);
  6212. };
  6213. return function(d, b) {
  6214. _extendStatics(d, b);
  6215. function __() {
  6216. this.constructor = d;
  6217. }
  6218. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  6219. };
  6220. }();
  6221. var __assign = this && this.__assign || function() {
  6222. __assign = Object.assign || function(t) {
  6223. for (var s, i = 1, n = arguments.length; i < n; i++) {
  6224. s = arguments[i];
  6225. for (var p in s) {
  6226. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  6227. }
  6228. }
  6229. return t;
  6230. };
  6231. return __assign.apply(this, arguments);
  6232. };
  6233. Object.defineProperty(exports, "__esModule", {
  6234. value: true
  6235. });
  6236. var foundation_1 = __webpack_require__(0);
  6237. var constants_1 = __webpack_require__(46);
  6238. var MDCNotchedOutlineFoundation = function(_super) {
  6239. __extends(MDCNotchedOutlineFoundation, _super);
  6240. function MDCNotchedOutlineFoundation(adapter) {
  6241. return _super.call(this, __assign({}, MDCNotchedOutlineFoundation.defaultAdapter, adapter)) || this;
  6242. }
  6243. Object.defineProperty(MDCNotchedOutlineFoundation, "strings", {
  6244. get: function get() {
  6245. return constants_1.strings;
  6246. },
  6247. enumerable: true,
  6248. configurable: true
  6249. });
  6250. Object.defineProperty(MDCNotchedOutlineFoundation, "cssClasses", {
  6251. get: function get() {
  6252. return constants_1.cssClasses;
  6253. },
  6254. enumerable: true,
  6255. configurable: true
  6256. });
  6257. Object.defineProperty(MDCNotchedOutlineFoundation, "numbers", {
  6258. get: function get() {
  6259. return constants_1.numbers;
  6260. },
  6261. enumerable: true,
  6262. configurable: true
  6263. });
  6264. Object.defineProperty(MDCNotchedOutlineFoundation, "defaultAdapter", {
  6265. get: function get() {
  6266. return {
  6267. addClass: function addClass() {
  6268. return undefined;
  6269. },
  6270. removeClass: function removeClass() {
  6271. return undefined;
  6272. },
  6273. setNotchWidthProperty: function setNotchWidthProperty() {
  6274. return undefined;
  6275. },
  6276. removeNotchWidthProperty: function removeNotchWidthProperty() {
  6277. return undefined;
  6278. }
  6279. };
  6280. },
  6281. enumerable: true,
  6282. configurable: true
  6283. });
  6284. MDCNotchedOutlineFoundation.prototype.notch = function(notchWidth) {
  6285. var OUTLINE_NOTCHED = MDCNotchedOutlineFoundation.cssClasses.OUTLINE_NOTCHED;
  6286. if (notchWidth > 0) {
  6287. notchWidth += constants_1.numbers.NOTCH_ELEMENT_PADDING;
  6288. }
  6289. this.adapter_.setNotchWidthProperty(notchWidth);
  6290. this.adapter_.addClass(OUTLINE_NOTCHED);
  6291. };
  6292. MDCNotchedOutlineFoundation.prototype.closeNotch = function() {
  6293. var OUTLINE_NOTCHED = MDCNotchedOutlineFoundation.cssClasses.OUTLINE_NOTCHED;
  6294. this.adapter_.removeClass(OUTLINE_NOTCHED);
  6295. this.adapter_.removeNotchWidthProperty();
  6296. };
  6297. return MDCNotchedOutlineFoundation;
  6298. }(foundation_1.MDCFoundation);
  6299. exports.MDCNotchedOutlineFoundation = MDCNotchedOutlineFoundation;
  6300. exports.default = MDCNotchedOutlineFoundation;
  6301. }, function(module, exports, __webpack_require__) {
  6302. "use strict";
  6303. var __extends = this && this.__extends || function() {
  6304. var _extendStatics = function extendStatics(d, b) {
  6305. _extendStatics = Object.setPrototypeOf || {
  6306. __proto__: []
  6307. } instanceof Array && function(d, b) {
  6308. d.__proto__ = b;
  6309. } || function(d, b) {
  6310. for (var p in b) {
  6311. if (b.hasOwnProperty(p)) d[p] = b[p];
  6312. }
  6313. };
  6314. return _extendStatics(d, b);
  6315. };
  6316. return function(d, b) {
  6317. _extendStatics(d, b);
  6318. function __() {
  6319. this.constructor = d;
  6320. }
  6321. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  6322. };
  6323. }();
  6324. var __assign = this && this.__assign || function() {
  6325. __assign = Object.assign || function(t) {
  6326. for (var s, i = 1, n = arguments.length; i < n; i++) {
  6327. s = arguments[i];
  6328. for (var p in s) {
  6329. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  6330. }
  6331. }
  6332. return t;
  6333. };
  6334. return __assign.apply(this, arguments);
  6335. };
  6336. Object.defineProperty(exports, "__esModule", {
  6337. value: true
  6338. });
  6339. var foundation_1 = __webpack_require__(0);
  6340. var constants_1 = __webpack_require__(124);
  6341. var MDCRadioFoundation = function(_super) {
  6342. __extends(MDCRadioFoundation, _super);
  6343. function MDCRadioFoundation(adapter) {
  6344. return _super.call(this, __assign({}, MDCRadioFoundation.defaultAdapter, adapter)) || this;
  6345. }
  6346. Object.defineProperty(MDCRadioFoundation, "cssClasses", {
  6347. get: function get() {
  6348. return constants_1.cssClasses;
  6349. },
  6350. enumerable: true,
  6351. configurable: true
  6352. });
  6353. Object.defineProperty(MDCRadioFoundation, "strings", {
  6354. get: function get() {
  6355. return constants_1.strings;
  6356. },
  6357. enumerable: true,
  6358. configurable: true
  6359. });
  6360. Object.defineProperty(MDCRadioFoundation, "defaultAdapter", {
  6361. get: function get() {
  6362. return {
  6363. addClass: function addClass() {
  6364. return undefined;
  6365. },
  6366. removeClass: function removeClass() {
  6367. return undefined;
  6368. },
  6369. setNativeControlDisabled: function setNativeControlDisabled() {
  6370. return undefined;
  6371. }
  6372. };
  6373. },
  6374. enumerable: true,
  6375. configurable: true
  6376. });
  6377. MDCRadioFoundation.prototype.setDisabled = function(disabled) {
  6378. var DISABLED = MDCRadioFoundation.cssClasses.DISABLED;
  6379. this.adapter_.setNativeControlDisabled(disabled);
  6380. if (disabled) {
  6381. this.adapter_.addClass(DISABLED);
  6382. } else {
  6383. this.adapter_.removeClass(DISABLED);
  6384. }
  6385. };
  6386. return MDCRadioFoundation;
  6387. }(foundation_1.MDCFoundation);
  6388. exports.MDCRadioFoundation = MDCRadioFoundation;
  6389. exports.default = MDCRadioFoundation;
  6390. }, function(module, exports, __webpack_require__) {
  6391. "use strict";
  6392. Object.defineProperty(exports, "__esModule", {
  6393. value: true
  6394. });
  6395. var cssClasses = {
  6396. DISABLED: "mdc-select--disabled",
  6397. FOCUSED: "mdc-select--focused",
  6398. INVALID: "mdc-select--invalid",
  6399. OUTLINED: "mdc-select--outlined",
  6400. REQUIRED: "mdc-select--required",
  6401. ROOT: "mdc-select",
  6402. SELECTED_ITEM_CLASS: "mdc-list-item--selected",
  6403. WITH_LEADING_ICON: "mdc-select--with-leading-icon"
  6404. };
  6405. exports.cssClasses = cssClasses;
  6406. var strings = {
  6407. ARIA_CONTROLS: "aria-controls",
  6408. ARIA_SELECTED_ATTR: "aria-selected",
  6409. CHANGE_EVENT: "MDCSelect:change",
  6410. ENHANCED_VALUE_ATTR: "data-value",
  6411. HIDDEN_INPUT_SELECTOR: 'input[type="hidden"]',
  6412. LABEL_SELECTOR: ".mdc-floating-label",
  6413. LEADING_ICON_SELECTOR: ".mdc-select__icon",
  6414. LINE_RIPPLE_SELECTOR: ".mdc-line-ripple",
  6415. MENU_SELECTOR: ".mdc-select__menu",
  6416. NATIVE_CONTROL_SELECTOR: ".mdc-select__native-control",
  6417. OUTLINE_SELECTOR: ".mdc-notched-outline",
  6418. SELECTED_ITEM_SELECTOR: "." + cssClasses.SELECTED_ITEM_CLASS,
  6419. SELECTED_TEXT_SELECTOR: ".mdc-select__selected-text"
  6420. };
  6421. exports.strings = strings;
  6422. var numbers = {
  6423. LABEL_SCALE: .75
  6424. };
  6425. exports.numbers = numbers;
  6426. }, function(module, exports, __webpack_require__) {
  6427. "use strict";
  6428. var __extends = this && this.__extends || function() {
  6429. var _extendStatics = function extendStatics(d, b) {
  6430. _extendStatics = Object.setPrototypeOf || {
  6431. __proto__: []
  6432. } instanceof Array && function(d, b) {
  6433. d.__proto__ = b;
  6434. } || function(d, b) {
  6435. for (var p in b) {
  6436. if (b.hasOwnProperty(p)) d[p] = b[p];
  6437. }
  6438. };
  6439. return _extendStatics(d, b);
  6440. };
  6441. return function(d, b) {
  6442. _extendStatics(d, b);
  6443. function __() {
  6444. this.constructor = d;
  6445. }
  6446. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  6447. };
  6448. }();
  6449. var __assign = this && this.__assign || function() {
  6450. __assign = Object.assign || function(t) {
  6451. for (var s, i = 1, n = arguments.length; i < n; i++) {
  6452. s = arguments[i];
  6453. for (var p in s) {
  6454. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  6455. }
  6456. }
  6457. return t;
  6458. };
  6459. return __assign.apply(this, arguments);
  6460. };
  6461. Object.defineProperty(exports, "__esModule", {
  6462. value: true
  6463. });
  6464. var foundation_1 = __webpack_require__(0);
  6465. var constants_1 = __webpack_require__(49);
  6466. var MDCSelectFoundation = function(_super) {
  6467. __extends(MDCSelectFoundation, _super);
  6468. function MDCSelectFoundation(adapter, foundationMap) {
  6469. if (foundationMap === void 0) {
  6470. foundationMap = {};
  6471. }
  6472. var _this = _super.call(this, __assign({}, MDCSelectFoundation.defaultAdapter, adapter)) || this;
  6473. _this.leadingIcon_ = foundationMap.leadingIcon;
  6474. _this.helperText_ = foundationMap.helperText;
  6475. return _this;
  6476. }
  6477. Object.defineProperty(MDCSelectFoundation, "cssClasses", {
  6478. get: function get() {
  6479. return constants_1.cssClasses;
  6480. },
  6481. enumerable: true,
  6482. configurable: true
  6483. });
  6484. Object.defineProperty(MDCSelectFoundation, "numbers", {
  6485. get: function get() {
  6486. return constants_1.numbers;
  6487. },
  6488. enumerable: true,
  6489. configurable: true
  6490. });
  6491. Object.defineProperty(MDCSelectFoundation, "strings", {
  6492. get: function get() {
  6493. return constants_1.strings;
  6494. },
  6495. enumerable: true,
  6496. configurable: true
  6497. });
  6498. Object.defineProperty(MDCSelectFoundation, "defaultAdapter", {
  6499. get: function get() {
  6500. return {
  6501. addClass: function addClass() {
  6502. return undefined;
  6503. },
  6504. removeClass: function removeClass() {
  6505. return undefined;
  6506. },
  6507. hasClass: function hasClass() {
  6508. return false;
  6509. },
  6510. activateBottomLine: function activateBottomLine() {
  6511. return undefined;
  6512. },
  6513. deactivateBottomLine: function deactivateBottomLine() {
  6514. return undefined;
  6515. },
  6516. setValue: function setValue() {
  6517. return undefined;
  6518. },
  6519. getValue: function getValue() {
  6520. return "";
  6521. },
  6522. floatLabel: function floatLabel() {
  6523. return undefined;
  6524. },
  6525. getLabelWidth: function getLabelWidth() {
  6526. return 0;
  6527. },
  6528. hasOutline: function hasOutline() {
  6529. return false;
  6530. },
  6531. notchOutline: function notchOutline() {
  6532. return undefined;
  6533. },
  6534. closeOutline: function closeOutline() {
  6535. return undefined;
  6536. },
  6537. openMenu: function openMenu() {
  6538. return undefined;
  6539. },
  6540. closeMenu: function closeMenu() {
  6541. return undefined;
  6542. },
  6543. isMenuOpen: function isMenuOpen() {
  6544. return false;
  6545. },
  6546. setSelectedIndex: function setSelectedIndex() {
  6547. return undefined;
  6548. },
  6549. setDisabled: function setDisabled() {
  6550. return undefined;
  6551. },
  6552. setRippleCenter: function setRippleCenter() {
  6553. return undefined;
  6554. },
  6555. notifyChange: function notifyChange() {
  6556. return undefined;
  6557. },
  6558. checkValidity: function checkValidity() {
  6559. return false;
  6560. },
  6561. setValid: function setValid() {
  6562. return undefined;
  6563. }
  6564. };
  6565. },
  6566. enumerable: true,
  6567. configurable: true
  6568. });
  6569. MDCSelectFoundation.prototype.setSelectedIndex = function(index) {
  6570. this.adapter_.setSelectedIndex(index);
  6571. this.adapter_.closeMenu();
  6572. var didChange = true;
  6573. this.handleChange(didChange);
  6574. };
  6575. MDCSelectFoundation.prototype.setValue = function(value) {
  6576. this.adapter_.setValue(value);
  6577. var didChange = true;
  6578. this.handleChange(didChange);
  6579. };
  6580. MDCSelectFoundation.prototype.getValue = function() {
  6581. return this.adapter_.getValue();
  6582. };
  6583. MDCSelectFoundation.prototype.setDisabled = function(isDisabled) {
  6584. if (isDisabled) {
  6585. this.adapter_.addClass(constants_1.cssClasses.DISABLED);
  6586. } else {
  6587. this.adapter_.removeClass(constants_1.cssClasses.DISABLED);
  6588. }
  6589. this.adapter_.setDisabled(isDisabled);
  6590. this.adapter_.closeMenu();
  6591. if (this.leadingIcon_) {
  6592. this.leadingIcon_.setDisabled(isDisabled);
  6593. }
  6594. };
  6595. MDCSelectFoundation.prototype.setHelperTextContent = function(content) {
  6596. if (this.helperText_) {
  6597. this.helperText_.setContent(content);
  6598. }
  6599. };
  6600. MDCSelectFoundation.prototype.layout = function() {
  6601. var openNotch = this.getValue().length > 0;
  6602. this.notchOutline(openNotch);
  6603. };
  6604. MDCSelectFoundation.prototype.handleChange = function(didChange) {
  6605. if (didChange === void 0) {
  6606. didChange = true;
  6607. }
  6608. var value = this.getValue();
  6609. var optionHasValue = value.length > 0;
  6610. var isRequired = this.adapter_.hasClass(constants_1.cssClasses.REQUIRED);
  6611. this.notchOutline(optionHasValue);
  6612. if (!this.adapter_.hasClass(constants_1.cssClasses.FOCUSED)) {
  6613. this.adapter_.floatLabel(optionHasValue);
  6614. }
  6615. if (didChange) {
  6616. this.adapter_.notifyChange(value);
  6617. if (isRequired) {
  6618. this.setValid(this.isValid());
  6619. if (this.helperText_) {
  6620. this.helperText_.setValidity(this.isValid());
  6621. }
  6622. }
  6623. }
  6624. };
  6625. MDCSelectFoundation.prototype.handleFocus = function() {
  6626. this.adapter_.addClass(constants_1.cssClasses.FOCUSED);
  6627. this.adapter_.floatLabel(true);
  6628. this.notchOutline(true);
  6629. this.adapter_.activateBottomLine();
  6630. if (this.helperText_) {
  6631. this.helperText_.showToScreenReader();
  6632. }
  6633. };
  6634. MDCSelectFoundation.prototype.handleBlur = function() {
  6635. if (this.adapter_.isMenuOpen()) {
  6636. return;
  6637. }
  6638. this.adapter_.removeClass(constants_1.cssClasses.FOCUSED);
  6639. this.handleChange(false);
  6640. this.adapter_.deactivateBottomLine();
  6641. var isRequired = this.adapter_.hasClass(constants_1.cssClasses.REQUIRED);
  6642. if (isRequired) {
  6643. this.setValid(this.isValid());
  6644. if (this.helperText_) {
  6645. this.helperText_.setValidity(this.isValid());
  6646. }
  6647. }
  6648. };
  6649. MDCSelectFoundation.prototype.handleClick = function(normalizedX) {
  6650. if (this.adapter_.isMenuOpen()) {
  6651. return;
  6652. }
  6653. this.adapter_.setRippleCenter(normalizedX);
  6654. this.adapter_.openMenu();
  6655. };
  6656. MDCSelectFoundation.prototype.handleKeydown = function(event) {
  6657. if (this.adapter_.isMenuOpen()) {
  6658. return;
  6659. }
  6660. var isEnter = event.key === "Enter" || event.keyCode === 13;
  6661. var isSpace = event.key === "Space" || event.keyCode === 32;
  6662. var arrowUp = event.key === "ArrowUp" || event.keyCode === 38;
  6663. var arrowDown = event.key === "ArrowDown" || event.keyCode === 40;
  6664. if (this.adapter_.hasClass(constants_1.cssClasses.FOCUSED) && (isEnter || isSpace || arrowUp || arrowDown)) {
  6665. this.adapter_.openMenu();
  6666. event.preventDefault();
  6667. }
  6668. };
  6669. MDCSelectFoundation.prototype.notchOutline = function(openNotch) {
  6670. if (!this.adapter_.hasOutline()) {
  6671. return;
  6672. }
  6673. var isFocused = this.adapter_.hasClass(constants_1.cssClasses.FOCUSED);
  6674. if (openNotch) {
  6675. var labelScale = constants_1.numbers.LABEL_SCALE;
  6676. var labelWidth = this.adapter_.getLabelWidth() * labelScale;
  6677. this.adapter_.notchOutline(labelWidth);
  6678. } else if (!isFocused) {
  6679. this.adapter_.closeOutline();
  6680. }
  6681. };
  6682. MDCSelectFoundation.prototype.setLeadingIconAriaLabel = function(label) {
  6683. if (this.leadingIcon_) {
  6684. this.leadingIcon_.setAriaLabel(label);
  6685. }
  6686. };
  6687. MDCSelectFoundation.prototype.setLeadingIconContent = function(content) {
  6688. if (this.leadingIcon_) {
  6689. this.leadingIcon_.setContent(content);
  6690. }
  6691. };
  6692. MDCSelectFoundation.prototype.setValid = function(isValid) {
  6693. this.adapter_.setValid(isValid);
  6694. };
  6695. MDCSelectFoundation.prototype.isValid = function() {
  6696. return this.adapter_.checkValidity();
  6697. };
  6698. return MDCSelectFoundation;
  6699. }(foundation_1.MDCFoundation);
  6700. exports.MDCSelectFoundation = MDCSelectFoundation;
  6701. exports.default = MDCSelectFoundation;
  6702. }, function(module, exports, __webpack_require__) {
  6703. "use strict";
  6704. var __extends = this && this.__extends || function() {
  6705. var _extendStatics = function extendStatics(d, b) {
  6706. _extendStatics = Object.setPrototypeOf || {
  6707. __proto__: []
  6708. } instanceof Array && function(d, b) {
  6709. d.__proto__ = b;
  6710. } || function(d, b) {
  6711. for (var p in b) {
  6712. if (b.hasOwnProperty(p)) d[p] = b[p];
  6713. }
  6714. };
  6715. return _extendStatics(d, b);
  6716. };
  6717. return function(d, b) {
  6718. _extendStatics(d, b);
  6719. function __() {
  6720. this.constructor = d;
  6721. }
  6722. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  6723. };
  6724. }();
  6725. Object.defineProperty(exports, "__esModule", {
  6726. value: true
  6727. });
  6728. var component_1 = __webpack_require__(1);
  6729. var foundation_1 = __webpack_require__(52);
  6730. var MDCSelectHelperText = function(_super) {
  6731. __extends(MDCSelectHelperText, _super);
  6732. function MDCSelectHelperText() {
  6733. return _super !== null && _super.apply(this, arguments) || this;
  6734. }
  6735. MDCSelectHelperText.attachTo = function(root) {
  6736. return new MDCSelectHelperText(root);
  6737. };
  6738. Object.defineProperty(MDCSelectHelperText.prototype, "foundation", {
  6739. get: function get() {
  6740. return this.foundation_;
  6741. },
  6742. enumerable: true,
  6743. configurable: true
  6744. });
  6745. MDCSelectHelperText.prototype.getDefaultFoundation = function() {
  6746. var _this = this;
  6747. var adapter = {
  6748. addClass: function addClass(className) {
  6749. return _this.root_.classList.add(className);
  6750. },
  6751. removeClass: function removeClass(className) {
  6752. return _this.root_.classList.remove(className);
  6753. },
  6754. hasClass: function hasClass(className) {
  6755. return _this.root_.classList.contains(className);
  6756. },
  6757. setAttr: function setAttr(attr, value) {
  6758. return _this.root_.setAttribute(attr, value);
  6759. },
  6760. removeAttr: function removeAttr(attr) {
  6761. return _this.root_.removeAttribute(attr);
  6762. },
  6763. setContent: function setContent(content) {
  6764. _this.root_.textContent = content;
  6765. }
  6766. };
  6767. return new foundation_1.MDCSelectHelperTextFoundation(adapter);
  6768. };
  6769. return MDCSelectHelperText;
  6770. }(component_1.MDCComponent);
  6771. exports.MDCSelectHelperText = MDCSelectHelperText;
  6772. }, function(module, exports, __webpack_require__) {
  6773. "use strict";
  6774. var __extends = this && this.__extends || function() {
  6775. var _extendStatics = function extendStatics(d, b) {
  6776. _extendStatics = Object.setPrototypeOf || {
  6777. __proto__: []
  6778. } instanceof Array && function(d, b) {
  6779. d.__proto__ = b;
  6780. } || function(d, b) {
  6781. for (var p in b) {
  6782. if (b.hasOwnProperty(p)) d[p] = b[p];
  6783. }
  6784. };
  6785. return _extendStatics(d, b);
  6786. };
  6787. return function(d, b) {
  6788. _extendStatics(d, b);
  6789. function __() {
  6790. this.constructor = d;
  6791. }
  6792. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  6793. };
  6794. }();
  6795. var __assign = this && this.__assign || function() {
  6796. __assign = Object.assign || function(t) {
  6797. for (var s, i = 1, n = arguments.length; i < n; i++) {
  6798. s = arguments[i];
  6799. for (var p in s) {
  6800. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  6801. }
  6802. }
  6803. return t;
  6804. };
  6805. return __assign.apply(this, arguments);
  6806. };
  6807. Object.defineProperty(exports, "__esModule", {
  6808. value: true
  6809. });
  6810. var foundation_1 = __webpack_require__(0);
  6811. var constants_1 = __webpack_require__(128);
  6812. var MDCSelectHelperTextFoundation = function(_super) {
  6813. __extends(MDCSelectHelperTextFoundation, _super);
  6814. function MDCSelectHelperTextFoundation(adapter) {
  6815. return _super.call(this, __assign({}, MDCSelectHelperTextFoundation.defaultAdapter, adapter)) || this;
  6816. }
  6817. Object.defineProperty(MDCSelectHelperTextFoundation, "cssClasses", {
  6818. get: function get() {
  6819. return constants_1.cssClasses;
  6820. },
  6821. enumerable: true,
  6822. configurable: true
  6823. });
  6824. Object.defineProperty(MDCSelectHelperTextFoundation, "strings", {
  6825. get: function get() {
  6826. return constants_1.strings;
  6827. },
  6828. enumerable: true,
  6829. configurable: true
  6830. });
  6831. Object.defineProperty(MDCSelectHelperTextFoundation, "defaultAdapter", {
  6832. get: function get() {
  6833. return {
  6834. addClass: function addClass() {
  6835. return undefined;
  6836. },
  6837. removeClass: function removeClass() {
  6838. return undefined;
  6839. },
  6840. hasClass: function hasClass() {
  6841. return false;
  6842. },
  6843. setAttr: function setAttr() {
  6844. return undefined;
  6845. },
  6846. removeAttr: function removeAttr() {
  6847. return undefined;
  6848. },
  6849. setContent: function setContent() {
  6850. return undefined;
  6851. }
  6852. };
  6853. },
  6854. enumerable: true,
  6855. configurable: true
  6856. });
  6857. MDCSelectHelperTextFoundation.prototype.setContent = function(content) {
  6858. this.adapter_.setContent(content);
  6859. };
  6860. MDCSelectHelperTextFoundation.prototype.setPersistent = function(isPersistent) {
  6861. if (isPersistent) {
  6862. this.adapter_.addClass(constants_1.cssClasses.HELPER_TEXT_PERSISTENT);
  6863. } else {
  6864. this.adapter_.removeClass(constants_1.cssClasses.HELPER_TEXT_PERSISTENT);
  6865. }
  6866. };
  6867. MDCSelectHelperTextFoundation.prototype.setValidation = function(isValidation) {
  6868. if (isValidation) {
  6869. this.adapter_.addClass(constants_1.cssClasses.HELPER_TEXT_VALIDATION_MSG);
  6870. } else {
  6871. this.adapter_.removeClass(constants_1.cssClasses.HELPER_TEXT_VALIDATION_MSG);
  6872. }
  6873. };
  6874. MDCSelectHelperTextFoundation.prototype.showToScreenReader = function() {
  6875. this.adapter_.removeAttr(constants_1.strings.ARIA_HIDDEN);
  6876. };
  6877. MDCSelectHelperTextFoundation.prototype.setValidity = function(selectIsValid) {
  6878. var helperTextIsPersistent = this.adapter_.hasClass(constants_1.cssClasses.HELPER_TEXT_PERSISTENT);
  6879. var helperTextIsValidationMsg = this.adapter_.hasClass(constants_1.cssClasses.HELPER_TEXT_VALIDATION_MSG);
  6880. var validationMsgNeedsDisplay = helperTextIsValidationMsg && !selectIsValid;
  6881. if (validationMsgNeedsDisplay) {
  6882. this.adapter_.setAttr(constants_1.strings.ROLE, "alert");
  6883. } else {
  6884. this.adapter_.removeAttr(constants_1.strings.ROLE);
  6885. }
  6886. if (!helperTextIsPersistent && !validationMsgNeedsDisplay) {
  6887. this.hide_();
  6888. }
  6889. };
  6890. MDCSelectHelperTextFoundation.prototype.hide_ = function() {
  6891. this.adapter_.setAttr(constants_1.strings.ARIA_HIDDEN, "true");
  6892. };
  6893. return MDCSelectHelperTextFoundation;
  6894. }(foundation_1.MDCFoundation);
  6895. exports.MDCSelectHelperTextFoundation = MDCSelectHelperTextFoundation;
  6896. exports.default = MDCSelectHelperTextFoundation;
  6897. }, function(module, exports, __webpack_require__) {
  6898. "use strict";
  6899. var __extends = this && this.__extends || function() {
  6900. var _extendStatics = function extendStatics(d, b) {
  6901. _extendStatics = Object.setPrototypeOf || {
  6902. __proto__: []
  6903. } instanceof Array && function(d, b) {
  6904. d.__proto__ = b;
  6905. } || function(d, b) {
  6906. for (var p in b) {
  6907. if (b.hasOwnProperty(p)) d[p] = b[p];
  6908. }
  6909. };
  6910. return _extendStatics(d, b);
  6911. };
  6912. return function(d, b) {
  6913. _extendStatics(d, b);
  6914. function __() {
  6915. this.constructor = d;
  6916. }
  6917. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  6918. };
  6919. }();
  6920. Object.defineProperty(exports, "__esModule", {
  6921. value: true
  6922. });
  6923. var component_1 = __webpack_require__(1);
  6924. var foundation_1 = __webpack_require__(54);
  6925. var MDCSelectIcon = function(_super) {
  6926. __extends(MDCSelectIcon, _super);
  6927. function MDCSelectIcon() {
  6928. return _super !== null && _super.apply(this, arguments) || this;
  6929. }
  6930. MDCSelectIcon.attachTo = function(root) {
  6931. return new MDCSelectIcon(root);
  6932. };
  6933. Object.defineProperty(MDCSelectIcon.prototype, "foundation", {
  6934. get: function get() {
  6935. return this.foundation_;
  6936. },
  6937. enumerable: true,
  6938. configurable: true
  6939. });
  6940. MDCSelectIcon.prototype.getDefaultFoundation = function() {
  6941. var _this = this;
  6942. var adapter = {
  6943. getAttr: function getAttr(attr) {
  6944. return _this.root_.getAttribute(attr);
  6945. },
  6946. setAttr: function setAttr(attr, value) {
  6947. return _this.root_.setAttribute(attr, value);
  6948. },
  6949. removeAttr: function removeAttr(attr) {
  6950. return _this.root_.removeAttribute(attr);
  6951. },
  6952. setContent: function setContent(content) {
  6953. _this.root_.textContent = content;
  6954. },
  6955. registerInteractionHandler: function registerInteractionHandler(evtType, handler) {
  6956. return _this.listen(evtType, handler);
  6957. },
  6958. deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) {
  6959. return _this.unlisten(evtType, handler);
  6960. },
  6961. notifyIconAction: function notifyIconAction() {
  6962. return _this.emit(foundation_1.MDCSelectIconFoundation.strings.ICON_EVENT, {}, true);
  6963. }
  6964. };
  6965. return new foundation_1.MDCSelectIconFoundation(adapter);
  6966. };
  6967. return MDCSelectIcon;
  6968. }(component_1.MDCComponent);
  6969. exports.MDCSelectIcon = MDCSelectIcon;
  6970. }, function(module, exports, __webpack_require__) {
  6971. "use strict";
  6972. var __extends = this && this.__extends || function() {
  6973. var _extendStatics = function extendStatics(d, b) {
  6974. _extendStatics = Object.setPrototypeOf || {
  6975. __proto__: []
  6976. } instanceof Array && function(d, b) {
  6977. d.__proto__ = b;
  6978. } || function(d, b) {
  6979. for (var p in b) {
  6980. if (b.hasOwnProperty(p)) d[p] = b[p];
  6981. }
  6982. };
  6983. return _extendStatics(d, b);
  6984. };
  6985. return function(d, b) {
  6986. _extendStatics(d, b);
  6987. function __() {
  6988. this.constructor = d;
  6989. }
  6990. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  6991. };
  6992. }();
  6993. var __assign = this && this.__assign || function() {
  6994. __assign = Object.assign || function(t) {
  6995. for (var s, i = 1, n = arguments.length; i < n; i++) {
  6996. s = arguments[i];
  6997. for (var p in s) {
  6998. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  6999. }
  7000. }
  7001. return t;
  7002. };
  7003. return __assign.apply(this, arguments);
  7004. };
  7005. Object.defineProperty(exports, "__esModule", {
  7006. value: true
  7007. });
  7008. var foundation_1 = __webpack_require__(0);
  7009. var constants_1 = __webpack_require__(129);
  7010. var INTERACTION_EVENTS = [ "click", "keydown" ];
  7011. var MDCSelectIconFoundation = function(_super) {
  7012. __extends(MDCSelectIconFoundation, _super);
  7013. function MDCSelectIconFoundation(adapter) {
  7014. var _this = _super.call(this, __assign({}, MDCSelectIconFoundation.defaultAdapter, adapter)) || this;
  7015. _this.savedTabIndex_ = null;
  7016. _this.interactionHandler_ = function(evt) {
  7017. return _this.handleInteraction(evt);
  7018. };
  7019. return _this;
  7020. }
  7021. Object.defineProperty(MDCSelectIconFoundation, "strings", {
  7022. get: function get() {
  7023. return constants_1.strings;
  7024. },
  7025. enumerable: true,
  7026. configurable: true
  7027. });
  7028. Object.defineProperty(MDCSelectIconFoundation, "defaultAdapter", {
  7029. get: function get() {
  7030. return {
  7031. getAttr: function getAttr() {
  7032. return null;
  7033. },
  7034. setAttr: function setAttr() {
  7035. return undefined;
  7036. },
  7037. removeAttr: function removeAttr() {
  7038. return undefined;
  7039. },
  7040. setContent: function setContent() {
  7041. return undefined;
  7042. },
  7043. registerInteractionHandler: function registerInteractionHandler() {
  7044. return undefined;
  7045. },
  7046. deregisterInteractionHandler: function deregisterInteractionHandler() {
  7047. return undefined;
  7048. },
  7049. notifyIconAction: function notifyIconAction() {
  7050. return undefined;
  7051. }
  7052. };
  7053. },
  7054. enumerable: true,
  7055. configurable: true
  7056. });
  7057. MDCSelectIconFoundation.prototype.init = function() {
  7058. var _this = this;
  7059. this.savedTabIndex_ = this.adapter_.getAttr("tabindex");
  7060. INTERACTION_EVENTS.forEach(function(evtType) {
  7061. _this.adapter_.registerInteractionHandler(evtType, _this.interactionHandler_);
  7062. });
  7063. };
  7064. MDCSelectIconFoundation.prototype.destroy = function() {
  7065. var _this = this;
  7066. INTERACTION_EVENTS.forEach(function(evtType) {
  7067. _this.adapter_.deregisterInteractionHandler(evtType, _this.interactionHandler_);
  7068. });
  7069. };
  7070. MDCSelectIconFoundation.prototype.setDisabled = function(disabled) {
  7071. if (!this.savedTabIndex_) {
  7072. return;
  7073. }
  7074. if (disabled) {
  7075. this.adapter_.setAttr("tabindex", "-1");
  7076. this.adapter_.removeAttr("role");
  7077. } else {
  7078. this.adapter_.setAttr("tabindex", this.savedTabIndex_);
  7079. this.adapter_.setAttr("role", constants_1.strings.ICON_ROLE);
  7080. }
  7081. };
  7082. MDCSelectIconFoundation.prototype.setAriaLabel = function(label) {
  7083. this.adapter_.setAttr("aria-label", label);
  7084. };
  7085. MDCSelectIconFoundation.prototype.setContent = function(content) {
  7086. this.adapter_.setContent(content);
  7087. };
  7088. MDCSelectIconFoundation.prototype.handleInteraction = function(evt) {
  7089. var isEnterKey = evt.key === "Enter" || evt.keyCode === 13;
  7090. if (evt.type === "click" || isEnterKey) {
  7091. this.adapter_.notifyIconAction();
  7092. }
  7093. };
  7094. return MDCSelectIconFoundation;
  7095. }(foundation_1.MDCFoundation);
  7096. exports.MDCSelectIconFoundation = MDCSelectIconFoundation;
  7097. exports.default = MDCSelectIconFoundation;
  7098. }, function(module, exports, __webpack_require__) {
  7099. "use strict";
  7100. Object.defineProperty(exports, "__esModule", {
  7101. value: true
  7102. });
  7103. var cssClasses = {
  7104. ACTIVE: "mdc-slider--active",
  7105. DISABLED: "mdc-slider--disabled",
  7106. DISCRETE: "mdc-slider--discrete",
  7107. FOCUS: "mdc-slider--focus",
  7108. HAS_TRACK_MARKER: "mdc-slider--display-markers",
  7109. IN_TRANSIT: "mdc-slider--in-transit",
  7110. IS_DISCRETE: "mdc-slider--discrete"
  7111. };
  7112. exports.cssClasses = cssClasses;
  7113. var strings = {
  7114. ARIA_DISABLED: "aria-disabled",
  7115. ARIA_VALUEMAX: "aria-valuemax",
  7116. ARIA_VALUEMIN: "aria-valuemin",
  7117. ARIA_VALUENOW: "aria-valuenow",
  7118. CHANGE_EVENT: "MDCSlider:change",
  7119. INPUT_EVENT: "MDCSlider:input",
  7120. LAST_TRACK_MARKER_SELECTOR: ".mdc-slider__track-marker:last-child",
  7121. PIN_VALUE_MARKER_SELECTOR: ".mdc-slider__pin-value-marker",
  7122. STEP_DATA_ATTR: "data-step",
  7123. THUMB_CONTAINER_SELECTOR: ".mdc-slider__thumb-container",
  7124. TRACK_MARKER_CONTAINER_SELECTOR: ".mdc-slider__track-marker-container",
  7125. TRACK_SELECTOR: ".mdc-slider__track"
  7126. };
  7127. exports.strings = strings;
  7128. var numbers = {
  7129. PAGE_FACTOR: 4
  7130. };
  7131. exports.numbers = numbers;
  7132. }, function(module, exports, __webpack_require__) {
  7133. "use strict";
  7134. var __extends = this && this.__extends || function() {
  7135. var _extendStatics = function extendStatics(d, b) {
  7136. _extendStatics = Object.setPrototypeOf || {
  7137. __proto__: []
  7138. } instanceof Array && function(d, b) {
  7139. d.__proto__ = b;
  7140. } || function(d, b) {
  7141. for (var p in b) {
  7142. if (b.hasOwnProperty(p)) d[p] = b[p];
  7143. }
  7144. };
  7145. return _extendStatics(d, b);
  7146. };
  7147. return function(d, b) {
  7148. _extendStatics(d, b);
  7149. function __() {
  7150. this.constructor = d;
  7151. }
  7152. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  7153. };
  7154. }();
  7155. var __assign = this && this.__assign || function() {
  7156. __assign = Object.assign || function(t) {
  7157. for (var s, i = 1, n = arguments.length; i < n; i++) {
  7158. s = arguments[i];
  7159. for (var p in s) {
  7160. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  7161. }
  7162. }
  7163. return t;
  7164. };
  7165. return __assign.apply(this, arguments);
  7166. };
  7167. Object.defineProperty(exports, "__esModule", {
  7168. value: true
  7169. });
  7170. var util_1 = __webpack_require__(10);
  7171. var foundation_1 = __webpack_require__(0);
  7172. var constants_1 = __webpack_require__(55);
  7173. var DOWN_EVENTS = [ "mousedown", "pointerdown", "touchstart" ];
  7174. var UP_EVENTS = [ "mouseup", "pointerup", "touchend" ];
  7175. var MOVE_EVENT_MAP = {
  7176. mousedown: "mousemove",
  7177. pointerdown: "pointermove",
  7178. touchstart: "touchmove"
  7179. };
  7180. var KEY_IDS = {
  7181. ARROW_DOWN: "ArrowDown",
  7182. ARROW_LEFT: "ArrowLeft",
  7183. ARROW_RIGHT: "ArrowRight",
  7184. ARROW_UP: "ArrowUp",
  7185. END: "End",
  7186. HOME: "Home",
  7187. PAGE_DOWN: "PageDown",
  7188. PAGE_UP: "PageUp"
  7189. };
  7190. var MDCSliderFoundation = function(_super) {
  7191. __extends(MDCSliderFoundation, _super);
  7192. function MDCSliderFoundation(adapter) {
  7193. var _this = _super.call(this, __assign({}, MDCSliderFoundation.defaultAdapter, adapter)) || this;
  7194. _this.savedTabIndex_ = NaN;
  7195. _this.active_ = false;
  7196. _this.inTransit_ = false;
  7197. _this.isDiscrete_ = false;
  7198. _this.hasTrackMarker_ = false;
  7199. _this.handlingThumbTargetEvt_ = false;
  7200. _this.min_ = 0;
  7201. _this.max_ = 100;
  7202. _this.step_ = 0;
  7203. _this.value_ = 0;
  7204. _this.disabled_ = false;
  7205. _this.preventFocusState_ = false;
  7206. _this.thumbContainerPointerHandler_ = function() {
  7207. return _this.handlingThumbTargetEvt_ = true;
  7208. };
  7209. _this.interactionStartHandler_ = function(evt) {
  7210. return _this.handleDown_(evt);
  7211. };
  7212. _this.keydownHandler_ = function(evt) {
  7213. return _this.handleKeydown_(evt);
  7214. };
  7215. _this.focusHandler_ = function() {
  7216. return _this.handleFocus_();
  7217. };
  7218. _this.blurHandler_ = function() {
  7219. return _this.handleBlur_();
  7220. };
  7221. _this.resizeHandler_ = function() {
  7222. return _this.layout();
  7223. };
  7224. return _this;
  7225. }
  7226. Object.defineProperty(MDCSliderFoundation, "cssClasses", {
  7227. get: function get() {
  7228. return constants_1.cssClasses;
  7229. },
  7230. enumerable: true,
  7231. configurable: true
  7232. });
  7233. Object.defineProperty(MDCSliderFoundation, "strings", {
  7234. get: function get() {
  7235. return constants_1.strings;
  7236. },
  7237. enumerable: true,
  7238. configurable: true
  7239. });
  7240. Object.defineProperty(MDCSliderFoundation, "numbers", {
  7241. get: function get() {
  7242. return constants_1.numbers;
  7243. },
  7244. enumerable: true,
  7245. configurable: true
  7246. });
  7247. Object.defineProperty(MDCSliderFoundation, "defaultAdapter", {
  7248. get: function get() {
  7249. return {
  7250. hasClass: function hasClass() {
  7251. return false;
  7252. },
  7253. addClass: function addClass() {
  7254. return undefined;
  7255. },
  7256. removeClass: function removeClass() {
  7257. return undefined;
  7258. },
  7259. getAttribute: function getAttribute() {
  7260. return null;
  7261. },
  7262. setAttribute: function setAttribute() {
  7263. return undefined;
  7264. },
  7265. removeAttribute: function removeAttribute() {
  7266. return undefined;
  7267. },
  7268. computeBoundingRect: function computeBoundingRect() {
  7269. return {
  7270. top: 0,
  7271. right: 0,
  7272. bottom: 0,
  7273. left: 0,
  7274. width: 0,
  7275. height: 0
  7276. };
  7277. },
  7278. getTabIndex: function getTabIndex() {
  7279. return 0;
  7280. },
  7281. registerInteractionHandler: function registerInteractionHandler() {
  7282. return undefined;
  7283. },
  7284. deregisterInteractionHandler: function deregisterInteractionHandler() {
  7285. return undefined;
  7286. },
  7287. registerThumbContainerInteractionHandler: function registerThumbContainerInteractionHandler() {
  7288. return undefined;
  7289. },
  7290. deregisterThumbContainerInteractionHandler: function deregisterThumbContainerInteractionHandler() {
  7291. return undefined;
  7292. },
  7293. registerBodyInteractionHandler: function registerBodyInteractionHandler() {
  7294. return undefined;
  7295. },
  7296. deregisterBodyInteractionHandler: function deregisterBodyInteractionHandler() {
  7297. return undefined;
  7298. },
  7299. registerResizeHandler: function registerResizeHandler() {
  7300. return undefined;
  7301. },
  7302. deregisterResizeHandler: function deregisterResizeHandler() {
  7303. return undefined;
  7304. },
  7305. notifyInput: function notifyInput() {
  7306. return undefined;
  7307. },
  7308. notifyChange: function notifyChange() {
  7309. return undefined;
  7310. },
  7311. setThumbContainerStyleProperty: function setThumbContainerStyleProperty() {
  7312. return undefined;
  7313. },
  7314. setTrackStyleProperty: function setTrackStyleProperty() {
  7315. return undefined;
  7316. },
  7317. setMarkerValue: function setMarkerValue() {
  7318. return undefined;
  7319. },
  7320. appendTrackMarkers: function appendTrackMarkers() {
  7321. return undefined;
  7322. },
  7323. removeTrackMarkers: function removeTrackMarkers() {
  7324. return undefined;
  7325. },
  7326. setLastTrackMarkersStyleProperty: function setLastTrackMarkersStyleProperty() {
  7327. return undefined;
  7328. },
  7329. isRTL: function isRTL() {
  7330. return false;
  7331. }
  7332. };
  7333. },
  7334. enumerable: true,
  7335. configurable: true
  7336. });
  7337. MDCSliderFoundation.prototype.init = function() {
  7338. var _this = this;
  7339. this.isDiscrete_ = this.adapter_.hasClass(constants_1.cssClasses.IS_DISCRETE);
  7340. this.hasTrackMarker_ = this.adapter_.hasClass(constants_1.cssClasses.HAS_TRACK_MARKER);
  7341. DOWN_EVENTS.forEach(function(evtName) {
  7342. _this.adapter_.registerInteractionHandler(evtName, _this.interactionStartHandler_);
  7343. _this.adapter_.registerThumbContainerInteractionHandler(evtName, _this.thumbContainerPointerHandler_);
  7344. });
  7345. this.adapter_.registerInteractionHandler("keydown", this.keydownHandler_);
  7346. this.adapter_.registerInteractionHandler("focus", this.focusHandler_);
  7347. this.adapter_.registerInteractionHandler("blur", this.blurHandler_);
  7348. this.adapter_.registerResizeHandler(this.resizeHandler_);
  7349. this.layout();
  7350. if (this.isDiscrete_ && this.getStep() === 0) {
  7351. this.step_ = 1;
  7352. }
  7353. };
  7354. MDCSliderFoundation.prototype.destroy = function() {
  7355. var _this = this;
  7356. DOWN_EVENTS.forEach(function(evtName) {
  7357. _this.adapter_.deregisterInteractionHandler(evtName, _this.interactionStartHandler_);
  7358. _this.adapter_.deregisterThumbContainerInteractionHandler(evtName, _this.thumbContainerPointerHandler_);
  7359. });
  7360. this.adapter_.deregisterInteractionHandler("keydown", this.keydownHandler_);
  7361. this.adapter_.deregisterInteractionHandler("focus", this.focusHandler_);
  7362. this.adapter_.deregisterInteractionHandler("blur", this.blurHandler_);
  7363. this.adapter_.deregisterResizeHandler(this.resizeHandler_);
  7364. };
  7365. MDCSliderFoundation.prototype.setupTrackMarker = function() {
  7366. if (this.isDiscrete_ && this.hasTrackMarker_ && this.getStep() !== 0) {
  7367. var min = this.getMin();
  7368. var max = this.getMax();
  7369. var step = this.getStep();
  7370. var numMarkers = (max - min) / step;
  7371. var indivisible = Math.ceil(numMarkers) !== numMarkers;
  7372. if (indivisible) {
  7373. numMarkers = Math.ceil(numMarkers);
  7374. }
  7375. this.adapter_.removeTrackMarkers();
  7376. this.adapter_.appendTrackMarkers(numMarkers);
  7377. if (indivisible) {
  7378. var lastStepRatio = (max - numMarkers * step) / step + 1;
  7379. this.adapter_.setLastTrackMarkersStyleProperty("flex-grow", String(lastStepRatio));
  7380. }
  7381. }
  7382. };
  7383. MDCSliderFoundation.prototype.layout = function() {
  7384. this.rect_ = this.adapter_.computeBoundingRect();
  7385. this.updateUIForCurrentValue_();
  7386. };
  7387. MDCSliderFoundation.prototype.getValue = function() {
  7388. return this.value_;
  7389. };
  7390. MDCSliderFoundation.prototype.setValue = function(value) {
  7391. this.setValue_(value, false);
  7392. };
  7393. MDCSliderFoundation.prototype.getMax = function() {
  7394. return this.max_;
  7395. };
  7396. MDCSliderFoundation.prototype.setMax = function(max) {
  7397. if (max < this.min_) {
  7398. throw new Error("Cannot set max to be less than the slider's minimum value");
  7399. }
  7400. this.max_ = max;
  7401. this.setValue_(this.value_, false, true);
  7402. this.adapter_.setAttribute(constants_1.strings.ARIA_VALUEMAX, String(this.max_));
  7403. this.setupTrackMarker();
  7404. };
  7405. MDCSliderFoundation.prototype.getMin = function() {
  7406. return this.min_;
  7407. };
  7408. MDCSliderFoundation.prototype.setMin = function(min) {
  7409. if (min > this.max_) {
  7410. throw new Error("Cannot set min to be greater than the slider's maximum value");
  7411. }
  7412. this.min_ = min;
  7413. this.setValue_(this.value_, false, true);
  7414. this.adapter_.setAttribute(constants_1.strings.ARIA_VALUEMIN, String(this.min_));
  7415. this.setupTrackMarker();
  7416. };
  7417. MDCSliderFoundation.prototype.getStep = function() {
  7418. return this.step_;
  7419. };
  7420. MDCSliderFoundation.prototype.setStep = function(step) {
  7421. if (step < 0) {
  7422. throw new Error("Step cannot be set to a negative number");
  7423. }
  7424. if (this.isDiscrete_ && (typeof step !== "number" || step < 1)) {
  7425. step = 1;
  7426. }
  7427. this.step_ = step;
  7428. this.setValue_(this.value_, false, true);
  7429. this.setupTrackMarker();
  7430. };
  7431. MDCSliderFoundation.prototype.isDisabled = function() {
  7432. return this.disabled_;
  7433. };
  7434. MDCSliderFoundation.prototype.setDisabled = function(disabled) {
  7435. this.disabled_ = disabled;
  7436. this.toggleClass_(constants_1.cssClasses.DISABLED, this.disabled_);
  7437. if (this.disabled_) {
  7438. this.savedTabIndex_ = this.adapter_.getTabIndex();
  7439. this.adapter_.setAttribute(constants_1.strings.ARIA_DISABLED, "true");
  7440. this.adapter_.removeAttribute("tabindex");
  7441. } else {
  7442. this.adapter_.removeAttribute(constants_1.strings.ARIA_DISABLED);
  7443. if (!isNaN(this.savedTabIndex_)) {
  7444. this.adapter_.setAttribute("tabindex", String(this.savedTabIndex_));
  7445. }
  7446. }
  7447. };
  7448. MDCSliderFoundation.prototype.handleDown_ = function(downEvent) {
  7449. var _this = this;
  7450. if (this.disabled_) {
  7451. return;
  7452. }
  7453. this.preventFocusState_ = true;
  7454. this.setInTransit_(!this.handlingThumbTargetEvt_);
  7455. this.handlingThumbTargetEvt_ = false;
  7456. this.setActive_(true);
  7457. var moveHandler = function moveHandler(moveEvent) {
  7458. _this.handleMove_(moveEvent);
  7459. };
  7460. var moveEventType = MOVE_EVENT_MAP[downEvent.type];
  7461. var upHandler = function upHandler() {
  7462. _this.handleUp_();
  7463. _this.adapter_.deregisterBodyInteractionHandler(moveEventType, moveHandler);
  7464. UP_EVENTS.forEach(function(evtName) {
  7465. return _this.adapter_.deregisterBodyInteractionHandler(evtName, upHandler);
  7466. });
  7467. };
  7468. this.adapter_.registerBodyInteractionHandler(moveEventType, moveHandler);
  7469. UP_EVENTS.forEach(function(evtName) {
  7470. return _this.adapter_.registerBodyInteractionHandler(evtName, upHandler);
  7471. });
  7472. this.setValueFromEvt_(downEvent);
  7473. };
  7474. MDCSliderFoundation.prototype.handleMove_ = function(evt) {
  7475. evt.preventDefault();
  7476. this.setValueFromEvt_(evt);
  7477. };
  7478. MDCSliderFoundation.prototype.handleUp_ = function() {
  7479. this.setActive_(false);
  7480. this.adapter_.notifyChange();
  7481. };
  7482. MDCSliderFoundation.prototype.getPageX_ = function(evt) {
  7483. if (evt.targetTouches && evt.targetTouches.length > 0) {
  7484. return evt.targetTouches[0].pageX;
  7485. }
  7486. return evt.pageX;
  7487. };
  7488. MDCSliderFoundation.prototype.setValueFromEvt_ = function(evt) {
  7489. var pageX = this.getPageX_(evt);
  7490. var value = this.computeValueFromPageX_(pageX);
  7491. this.setValue_(value, true);
  7492. };
  7493. MDCSliderFoundation.prototype.computeValueFromPageX_ = function(pageX) {
  7494. var _a = this, max = _a.max_, min = _a.min_;
  7495. var xPos = pageX - this.rect_.left;
  7496. var pctComplete = xPos / this.rect_.width;
  7497. if (this.adapter_.isRTL()) {
  7498. pctComplete = 1 - pctComplete;
  7499. }
  7500. return min + pctComplete * (max - min);
  7501. };
  7502. MDCSliderFoundation.prototype.handleKeydown_ = function(evt) {
  7503. var keyId = this.getKeyId_(evt);
  7504. var value = this.getValueForKeyId_(keyId);
  7505. if (isNaN(value)) {
  7506. return;
  7507. }
  7508. evt.preventDefault();
  7509. this.adapter_.addClass(constants_1.cssClasses.FOCUS);
  7510. this.setValue_(value, true);
  7511. this.adapter_.notifyChange();
  7512. };
  7513. MDCSliderFoundation.prototype.getKeyId_ = function(kbdEvt) {
  7514. if (kbdEvt.key === KEY_IDS.ARROW_LEFT || kbdEvt.keyCode === 37) {
  7515. return KEY_IDS.ARROW_LEFT;
  7516. }
  7517. if (kbdEvt.key === KEY_IDS.ARROW_RIGHT || kbdEvt.keyCode === 39) {
  7518. return KEY_IDS.ARROW_RIGHT;
  7519. }
  7520. if (kbdEvt.key === KEY_IDS.ARROW_UP || kbdEvt.keyCode === 38) {
  7521. return KEY_IDS.ARROW_UP;
  7522. }
  7523. if (kbdEvt.key === KEY_IDS.ARROW_DOWN || kbdEvt.keyCode === 40) {
  7524. return KEY_IDS.ARROW_DOWN;
  7525. }
  7526. if (kbdEvt.key === KEY_IDS.HOME || kbdEvt.keyCode === 36) {
  7527. return KEY_IDS.HOME;
  7528. }
  7529. if (kbdEvt.key === KEY_IDS.END || kbdEvt.keyCode === 35) {
  7530. return KEY_IDS.END;
  7531. }
  7532. if (kbdEvt.key === KEY_IDS.PAGE_UP || kbdEvt.keyCode === 33) {
  7533. return KEY_IDS.PAGE_UP;
  7534. }
  7535. if (kbdEvt.key === KEY_IDS.PAGE_DOWN || kbdEvt.keyCode === 34) {
  7536. return KEY_IDS.PAGE_DOWN;
  7537. }
  7538. return "";
  7539. };
  7540. MDCSliderFoundation.prototype.getValueForKeyId_ = function(keyId) {
  7541. var _a = this, max = _a.max_, min = _a.min_, step = _a.step_;
  7542. var delta = step || (max - min) / 100;
  7543. var valueNeedsToBeFlipped = this.adapter_.isRTL() && (keyId === KEY_IDS.ARROW_LEFT || keyId === KEY_IDS.ARROW_RIGHT);
  7544. if (valueNeedsToBeFlipped) {
  7545. delta = -delta;
  7546. }
  7547. switch (keyId) {
  7548. case KEY_IDS.ARROW_LEFT:
  7549. case KEY_IDS.ARROW_DOWN:
  7550. return this.value_ - delta;
  7551. case KEY_IDS.ARROW_RIGHT:
  7552. case KEY_IDS.ARROW_UP:
  7553. return this.value_ + delta;
  7554. case KEY_IDS.HOME:
  7555. return this.min_;
  7556. case KEY_IDS.END:
  7557. return this.max_;
  7558. case KEY_IDS.PAGE_UP:
  7559. return this.value_ + delta * constants_1.numbers.PAGE_FACTOR;
  7560. case KEY_IDS.PAGE_DOWN:
  7561. return this.value_ - delta * constants_1.numbers.PAGE_FACTOR;
  7562. default:
  7563. return NaN;
  7564. }
  7565. };
  7566. MDCSliderFoundation.prototype.handleFocus_ = function() {
  7567. if (this.preventFocusState_) {
  7568. return;
  7569. }
  7570. this.adapter_.addClass(constants_1.cssClasses.FOCUS);
  7571. };
  7572. MDCSliderFoundation.prototype.handleBlur_ = function() {
  7573. this.preventFocusState_ = false;
  7574. this.adapter_.removeClass(constants_1.cssClasses.FOCUS);
  7575. };
  7576. MDCSliderFoundation.prototype.setValue_ = function(value, shouldFireInput, force) {
  7577. if (force === void 0) {
  7578. force = false;
  7579. }
  7580. if (value === this.value_ && !force) {
  7581. return;
  7582. }
  7583. var _a = this, min = _a.min_, max = _a.max_;
  7584. var valueSetToBoundary = value === min || value === max;
  7585. if (this.step_ && !valueSetToBoundary) {
  7586. value = this.quantize_(value);
  7587. }
  7588. if (value < min) {
  7589. value = min;
  7590. } else if (value > max) {
  7591. value = max;
  7592. }
  7593. this.value_ = value;
  7594. this.adapter_.setAttribute(constants_1.strings.ARIA_VALUENOW, String(this.value_));
  7595. this.updateUIForCurrentValue_();
  7596. if (shouldFireInput) {
  7597. this.adapter_.notifyInput();
  7598. if (this.isDiscrete_) {
  7599. this.adapter_.setMarkerValue(value);
  7600. }
  7601. }
  7602. };
  7603. MDCSliderFoundation.prototype.quantize_ = function(value) {
  7604. var numSteps = Math.round(value / this.step_);
  7605. return numSteps * this.step_;
  7606. };
  7607. MDCSliderFoundation.prototype.updateUIForCurrentValue_ = function() {
  7608. var _this = this;
  7609. var _a = this, max = _a.max_, min = _a.min_, value = _a.value_;
  7610. var pctComplete = (value - min) / (max - min);
  7611. var translatePx = pctComplete * this.rect_.width;
  7612. if (this.adapter_.isRTL()) {
  7613. translatePx = this.rect_.width - translatePx;
  7614. }
  7615. var transformProp = util_1.getCorrectPropertyName(window, "transform");
  7616. var transitionendEvtName = util_1.getCorrectEventName(window, "transitionend");
  7617. if (this.inTransit_) {
  7618. var onTransitionEnd_1 = function onTransitionEnd_1() {
  7619. _this.setInTransit_(false);
  7620. _this.adapter_.deregisterThumbContainerInteractionHandler(transitionendEvtName, onTransitionEnd_1);
  7621. };
  7622. this.adapter_.registerThumbContainerInteractionHandler(transitionendEvtName, onTransitionEnd_1);
  7623. }
  7624. requestAnimationFrame(function() {
  7625. _this.adapter_.setThumbContainerStyleProperty(transformProp, "translateX(" + translatePx + "px) translateX(-50%)");
  7626. _this.adapter_.setTrackStyleProperty(transformProp, "scaleX(" + pctComplete + ")");
  7627. });
  7628. };
  7629. MDCSliderFoundation.prototype.setActive_ = function(active) {
  7630. this.active_ = active;
  7631. this.toggleClass_(constants_1.cssClasses.ACTIVE, this.active_);
  7632. };
  7633. MDCSliderFoundation.prototype.setInTransit_ = function(inTransit) {
  7634. this.inTransit_ = inTransit;
  7635. this.toggleClass_(constants_1.cssClasses.IN_TRANSIT, this.inTransit_);
  7636. };
  7637. MDCSliderFoundation.prototype.toggleClass_ = function(className, shouldBePresent) {
  7638. if (shouldBePresent) {
  7639. this.adapter_.addClass(className);
  7640. } else {
  7641. this.adapter_.removeClass(className);
  7642. }
  7643. };
  7644. return MDCSliderFoundation;
  7645. }(foundation_1.MDCFoundation);
  7646. exports.MDCSliderFoundation = MDCSliderFoundation;
  7647. exports.default = MDCSliderFoundation;
  7648. }, function(module, exports, __webpack_require__) {
  7649. "use strict";
  7650. Object.defineProperty(exports, "__esModule", {
  7651. value: true
  7652. });
  7653. var constants_1 = __webpack_require__(20);
  7654. var ARIA_LIVE_DELAY_MS = constants_1.numbers.ARIA_LIVE_DELAY_MS;
  7655. var ARIA_LIVE_LABEL_TEXT_ATTR = constants_1.strings.ARIA_LIVE_LABEL_TEXT_ATTR;
  7656. function announce(ariaEl, labelEl) {
  7657. if (labelEl === void 0) {
  7658. labelEl = ariaEl;
  7659. }
  7660. var priority = ariaEl.getAttribute("aria-live");
  7661. var labelText = labelEl.textContent.trim();
  7662. if (!labelText || !priority) {
  7663. return;
  7664. }
  7665. ariaEl.setAttribute("aria-live", "off");
  7666. labelEl.textContent = "";
  7667. labelEl.innerHTML = '<span style="display: inline-block; width: 0; height: 1px;">&nbsp;</span>';
  7668. labelEl.setAttribute(ARIA_LIVE_LABEL_TEXT_ATTR, labelText);
  7669. setTimeout(function() {
  7670. ariaEl.setAttribute("aria-live", priority);
  7671. labelEl.removeAttribute(ARIA_LIVE_LABEL_TEXT_ATTR);
  7672. labelEl.textContent = labelText;
  7673. }, ARIA_LIVE_DELAY_MS);
  7674. }
  7675. exports.announce = announce;
  7676. }, function(module, exports, __webpack_require__) {
  7677. "use strict";
  7678. var __extends = this && this.__extends || function() {
  7679. var _extendStatics = function extendStatics(d, b) {
  7680. _extendStatics = Object.setPrototypeOf || {
  7681. __proto__: []
  7682. } instanceof Array && function(d, b) {
  7683. d.__proto__ = b;
  7684. } || function(d, b) {
  7685. for (var p in b) {
  7686. if (b.hasOwnProperty(p)) d[p] = b[p];
  7687. }
  7688. };
  7689. return _extendStatics(d, b);
  7690. };
  7691. return function(d, b) {
  7692. _extendStatics(d, b);
  7693. function __() {
  7694. this.constructor = d;
  7695. }
  7696. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  7697. };
  7698. }();
  7699. var __assign = this && this.__assign || function() {
  7700. __assign = Object.assign || function(t) {
  7701. for (var s, i = 1, n = arguments.length; i < n; i++) {
  7702. s = arguments[i];
  7703. for (var p in s) {
  7704. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  7705. }
  7706. }
  7707. return t;
  7708. };
  7709. return __assign.apply(this, arguments);
  7710. };
  7711. Object.defineProperty(exports, "__esModule", {
  7712. value: true
  7713. });
  7714. var foundation_1 = __webpack_require__(0);
  7715. var constants_1 = __webpack_require__(20);
  7716. var OPENING = constants_1.cssClasses.OPENING, OPEN = constants_1.cssClasses.OPEN, CLOSING = constants_1.cssClasses.CLOSING;
  7717. var REASON_ACTION = constants_1.strings.REASON_ACTION, REASON_DISMISS = constants_1.strings.REASON_DISMISS;
  7718. var MDCSnackbarFoundation = function(_super) {
  7719. __extends(MDCSnackbarFoundation, _super);
  7720. function MDCSnackbarFoundation(adapter) {
  7721. var _this = _super.call(this, __assign({}, MDCSnackbarFoundation.defaultAdapter, adapter)) || this;
  7722. _this.isOpen_ = false;
  7723. _this.animationFrame_ = 0;
  7724. _this.animationTimer_ = 0;
  7725. _this.autoDismissTimer_ = 0;
  7726. _this.autoDismissTimeoutMs_ = constants_1.numbers.DEFAULT_AUTO_DISMISS_TIMEOUT_MS;
  7727. _this.closeOnEscape_ = true;
  7728. return _this;
  7729. }
  7730. Object.defineProperty(MDCSnackbarFoundation, "cssClasses", {
  7731. get: function get() {
  7732. return constants_1.cssClasses;
  7733. },
  7734. enumerable: true,
  7735. configurable: true
  7736. });
  7737. Object.defineProperty(MDCSnackbarFoundation, "strings", {
  7738. get: function get() {
  7739. return constants_1.strings;
  7740. },
  7741. enumerable: true,
  7742. configurable: true
  7743. });
  7744. Object.defineProperty(MDCSnackbarFoundation, "numbers", {
  7745. get: function get() {
  7746. return constants_1.numbers;
  7747. },
  7748. enumerable: true,
  7749. configurable: true
  7750. });
  7751. Object.defineProperty(MDCSnackbarFoundation, "defaultAdapter", {
  7752. get: function get() {
  7753. return {
  7754. addClass: function addClass() {
  7755. return undefined;
  7756. },
  7757. announce: function announce() {
  7758. return undefined;
  7759. },
  7760. notifyClosed: function notifyClosed() {
  7761. return undefined;
  7762. },
  7763. notifyClosing: function notifyClosing() {
  7764. return undefined;
  7765. },
  7766. notifyOpened: function notifyOpened() {
  7767. return undefined;
  7768. },
  7769. notifyOpening: function notifyOpening() {
  7770. return undefined;
  7771. },
  7772. removeClass: function removeClass() {
  7773. return undefined;
  7774. }
  7775. };
  7776. },
  7777. enumerable: true,
  7778. configurable: true
  7779. });
  7780. MDCSnackbarFoundation.prototype.destroy = function() {
  7781. this.clearAutoDismissTimer_();
  7782. cancelAnimationFrame(this.animationFrame_);
  7783. this.animationFrame_ = 0;
  7784. clearTimeout(this.animationTimer_);
  7785. this.animationTimer_ = 0;
  7786. this.adapter_.removeClass(OPENING);
  7787. this.adapter_.removeClass(OPEN);
  7788. this.adapter_.removeClass(CLOSING);
  7789. };
  7790. MDCSnackbarFoundation.prototype.open = function() {
  7791. var _this = this;
  7792. this.clearAutoDismissTimer_();
  7793. this.isOpen_ = true;
  7794. this.adapter_.notifyOpening();
  7795. this.adapter_.removeClass(CLOSING);
  7796. this.adapter_.addClass(OPENING);
  7797. this.adapter_.announce();
  7798. this.runNextAnimationFrame_(function() {
  7799. _this.adapter_.addClass(OPEN);
  7800. _this.animationTimer_ = setTimeout(function() {
  7801. _this.handleAnimationTimerEnd_();
  7802. _this.adapter_.notifyOpened();
  7803. _this.autoDismissTimer_ = setTimeout(function() {
  7804. _this.close(REASON_DISMISS);
  7805. }, _this.getTimeoutMs());
  7806. }, constants_1.numbers.SNACKBAR_ANIMATION_OPEN_TIME_MS);
  7807. });
  7808. };
  7809. MDCSnackbarFoundation.prototype.close = function(reason) {
  7810. var _this = this;
  7811. if (reason === void 0) {
  7812. reason = "";
  7813. }
  7814. if (!this.isOpen_) {
  7815. return;
  7816. }
  7817. cancelAnimationFrame(this.animationFrame_);
  7818. this.animationFrame_ = 0;
  7819. this.clearAutoDismissTimer_();
  7820. this.isOpen_ = false;
  7821. this.adapter_.notifyClosing(reason);
  7822. this.adapter_.addClass(constants_1.cssClasses.CLOSING);
  7823. this.adapter_.removeClass(constants_1.cssClasses.OPEN);
  7824. this.adapter_.removeClass(constants_1.cssClasses.OPENING);
  7825. clearTimeout(this.animationTimer_);
  7826. this.animationTimer_ = setTimeout(function() {
  7827. _this.handleAnimationTimerEnd_();
  7828. _this.adapter_.notifyClosed(reason);
  7829. }, constants_1.numbers.SNACKBAR_ANIMATION_CLOSE_TIME_MS);
  7830. };
  7831. MDCSnackbarFoundation.prototype.isOpen = function() {
  7832. return this.isOpen_;
  7833. };
  7834. MDCSnackbarFoundation.prototype.getTimeoutMs = function() {
  7835. return this.autoDismissTimeoutMs_;
  7836. };
  7837. MDCSnackbarFoundation.prototype.setTimeoutMs = function(timeoutMs) {
  7838. var minValue = constants_1.numbers.MIN_AUTO_DISMISS_TIMEOUT_MS;
  7839. var maxValue = constants_1.numbers.MAX_AUTO_DISMISS_TIMEOUT_MS;
  7840. if (timeoutMs <= maxValue && timeoutMs >= minValue) {
  7841. this.autoDismissTimeoutMs_ = timeoutMs;
  7842. } else {
  7843. throw new Error("timeoutMs must be an integer in the range " + minValue + "–" + maxValue + ", but got '" + timeoutMs + "'");
  7844. }
  7845. };
  7846. MDCSnackbarFoundation.prototype.getCloseOnEscape = function() {
  7847. return this.closeOnEscape_;
  7848. };
  7849. MDCSnackbarFoundation.prototype.setCloseOnEscape = function(closeOnEscape) {
  7850. this.closeOnEscape_ = closeOnEscape;
  7851. };
  7852. MDCSnackbarFoundation.prototype.handleKeyDown = function(evt) {
  7853. var isEscapeKey = evt.key === "Escape" || evt.keyCode === 27;
  7854. if (isEscapeKey && this.getCloseOnEscape()) {
  7855. this.close(REASON_DISMISS);
  7856. }
  7857. };
  7858. MDCSnackbarFoundation.prototype.handleActionButtonClick = function(_evt) {
  7859. this.close(REASON_ACTION);
  7860. };
  7861. MDCSnackbarFoundation.prototype.handleActionIconClick = function(_evt) {
  7862. this.close(REASON_DISMISS);
  7863. };
  7864. MDCSnackbarFoundation.prototype.clearAutoDismissTimer_ = function() {
  7865. clearTimeout(this.autoDismissTimer_);
  7866. this.autoDismissTimer_ = 0;
  7867. };
  7868. MDCSnackbarFoundation.prototype.handleAnimationTimerEnd_ = function() {
  7869. this.animationTimer_ = 0;
  7870. this.adapter_.removeClass(constants_1.cssClasses.OPENING);
  7871. this.adapter_.removeClass(constants_1.cssClasses.CLOSING);
  7872. };
  7873. MDCSnackbarFoundation.prototype.runNextAnimationFrame_ = function(callback) {
  7874. var _this = this;
  7875. cancelAnimationFrame(this.animationFrame_);
  7876. this.animationFrame_ = requestAnimationFrame(function() {
  7877. _this.animationFrame_ = 0;
  7878. clearTimeout(_this.animationTimer_);
  7879. _this.animationTimer_ = setTimeout(callback, 0);
  7880. });
  7881. };
  7882. return MDCSnackbarFoundation;
  7883. }(foundation_1.MDCFoundation);
  7884. exports.MDCSnackbarFoundation = MDCSnackbarFoundation;
  7885. exports.default = MDCSnackbarFoundation;
  7886. }, function(module, exports, __webpack_require__) {
  7887. "use strict";
  7888. var __extends = this && this.__extends || function() {
  7889. var _extendStatics = function extendStatics(d, b) {
  7890. _extendStatics = Object.setPrototypeOf || {
  7891. __proto__: []
  7892. } instanceof Array && function(d, b) {
  7893. d.__proto__ = b;
  7894. } || function(d, b) {
  7895. for (var p in b) {
  7896. if (b.hasOwnProperty(p)) d[p] = b[p];
  7897. }
  7898. };
  7899. return _extendStatics(d, b);
  7900. };
  7901. return function(d, b) {
  7902. _extendStatics(d, b);
  7903. function __() {
  7904. this.constructor = d;
  7905. }
  7906. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  7907. };
  7908. }();
  7909. var __assign = this && this.__assign || function() {
  7910. __assign = Object.assign || function(t) {
  7911. for (var s, i = 1, n = arguments.length; i < n; i++) {
  7912. s = arguments[i];
  7913. for (var p in s) {
  7914. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  7915. }
  7916. }
  7917. return t;
  7918. };
  7919. return __assign.apply(this, arguments);
  7920. };
  7921. Object.defineProperty(exports, "__esModule", {
  7922. value: true
  7923. });
  7924. var foundation_1 = __webpack_require__(0);
  7925. var constants_1 = __webpack_require__(138);
  7926. var MDCSwitchFoundation = function(_super) {
  7927. __extends(MDCSwitchFoundation, _super);
  7928. function MDCSwitchFoundation(adapter) {
  7929. return _super.call(this, __assign({}, MDCSwitchFoundation.defaultAdapter, adapter)) || this;
  7930. }
  7931. Object.defineProperty(MDCSwitchFoundation, "strings", {
  7932. get: function get() {
  7933. return constants_1.strings;
  7934. },
  7935. enumerable: true,
  7936. configurable: true
  7937. });
  7938. Object.defineProperty(MDCSwitchFoundation, "cssClasses", {
  7939. get: function get() {
  7940. return constants_1.cssClasses;
  7941. },
  7942. enumerable: true,
  7943. configurable: true
  7944. });
  7945. Object.defineProperty(MDCSwitchFoundation, "defaultAdapter", {
  7946. get: function get() {
  7947. return {
  7948. addClass: function addClass() {
  7949. return undefined;
  7950. },
  7951. removeClass: function removeClass() {
  7952. return undefined;
  7953. },
  7954. setNativeControlChecked: function setNativeControlChecked() {
  7955. return undefined;
  7956. },
  7957. setNativeControlDisabled: function setNativeControlDisabled() {
  7958. return undefined;
  7959. }
  7960. };
  7961. },
  7962. enumerable: true,
  7963. configurable: true
  7964. });
  7965. MDCSwitchFoundation.prototype.setChecked = function(checked) {
  7966. this.adapter_.setNativeControlChecked(checked);
  7967. this.updateCheckedStyling_(checked);
  7968. };
  7969. MDCSwitchFoundation.prototype.setDisabled = function(disabled) {
  7970. this.adapter_.setNativeControlDisabled(disabled);
  7971. if (disabled) {
  7972. this.adapter_.addClass(constants_1.cssClasses.DISABLED);
  7973. } else {
  7974. this.adapter_.removeClass(constants_1.cssClasses.DISABLED);
  7975. }
  7976. };
  7977. MDCSwitchFoundation.prototype.handleChange = function(evt) {
  7978. var nativeControl = evt.target;
  7979. this.updateCheckedStyling_(nativeControl.checked);
  7980. };
  7981. MDCSwitchFoundation.prototype.updateCheckedStyling_ = function(checked) {
  7982. if (checked) {
  7983. this.adapter_.addClass(constants_1.cssClasses.CHECKED);
  7984. } else {
  7985. this.adapter_.removeClass(constants_1.cssClasses.CHECKED);
  7986. }
  7987. };
  7988. return MDCSwitchFoundation;
  7989. }(foundation_1.MDCFoundation);
  7990. exports.MDCSwitchFoundation = MDCSwitchFoundation;
  7991. exports.default = MDCSwitchFoundation;
  7992. }, function(module, exports, __webpack_require__) {
  7993. "use strict";
  7994. var __extends = this && this.__extends || function() {
  7995. var _extendStatics = function extendStatics(d, b) {
  7996. _extendStatics = Object.setPrototypeOf || {
  7997. __proto__: []
  7998. } instanceof Array && function(d, b) {
  7999. d.__proto__ = b;
  8000. } || function(d, b) {
  8001. for (var p in b) {
  8002. if (b.hasOwnProperty(p)) d[p] = b[p];
  8003. }
  8004. };
  8005. return _extendStatics(d, b);
  8006. };
  8007. return function(d, b) {
  8008. _extendStatics(d, b);
  8009. function __() {
  8010. this.constructor = d;
  8011. }
  8012. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  8013. };
  8014. }();
  8015. var __importStar = this && this.__importStar || function(mod) {
  8016. if (mod && mod.__esModule) return mod;
  8017. var result = {};
  8018. if (mod != null) for (var k in mod) {
  8019. if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  8020. }
  8021. result["default"] = mod;
  8022. return result;
  8023. };
  8024. Object.defineProperty(exports, "__esModule", {
  8025. value: true
  8026. });
  8027. var component_1 = __webpack_require__(1);
  8028. var ponyfill_1 = __webpack_require__(3);
  8029. var foundation_1 = __webpack_require__(61);
  8030. var util = __importStar(__webpack_require__(63));
  8031. var MDCTabScroller = function(_super) {
  8032. __extends(MDCTabScroller, _super);
  8033. function MDCTabScroller() {
  8034. return _super !== null && _super.apply(this, arguments) || this;
  8035. }
  8036. MDCTabScroller.attachTo = function(root) {
  8037. return new MDCTabScroller(root);
  8038. };
  8039. MDCTabScroller.prototype.initialize = function() {
  8040. this.area_ = this.root_.querySelector(foundation_1.MDCTabScrollerFoundation.strings.AREA_SELECTOR);
  8041. this.content_ = this.root_.querySelector(foundation_1.MDCTabScrollerFoundation.strings.CONTENT_SELECTOR);
  8042. };
  8043. MDCTabScroller.prototype.initialSyncWithDOM = function() {
  8044. var _this = this;
  8045. this.handleInteraction_ = function() {
  8046. return _this.foundation_.handleInteraction();
  8047. };
  8048. this.handleTransitionEnd_ = function(evt) {
  8049. return _this.foundation_.handleTransitionEnd(evt);
  8050. };
  8051. this.area_.addEventListener("wheel", this.handleInteraction_);
  8052. this.area_.addEventListener("touchstart", this.handleInteraction_);
  8053. this.area_.addEventListener("pointerdown", this.handleInteraction_);
  8054. this.area_.addEventListener("mousedown", this.handleInteraction_);
  8055. this.area_.addEventListener("keydown", this.handleInteraction_);
  8056. this.content_.addEventListener("transitionend", this.handleTransitionEnd_);
  8057. };
  8058. MDCTabScroller.prototype.destroy = function() {
  8059. _super.prototype.destroy.call(this);
  8060. this.area_.removeEventListener("wheel", this.handleInteraction_);
  8061. this.area_.removeEventListener("touchstart", this.handleInteraction_);
  8062. this.area_.removeEventListener("pointerdown", this.handleInteraction_);
  8063. this.area_.removeEventListener("mousedown", this.handleInteraction_);
  8064. this.area_.removeEventListener("keydown", this.handleInteraction_);
  8065. this.content_.removeEventListener("transitionend", this.handleTransitionEnd_);
  8066. };
  8067. MDCTabScroller.prototype.getDefaultFoundation = function() {
  8068. var _this = this;
  8069. var adapter = {
  8070. eventTargetMatchesSelector: function eventTargetMatchesSelector(evtTarget, selector) {
  8071. return ponyfill_1.matches(evtTarget, selector);
  8072. },
  8073. addClass: function addClass(className) {
  8074. return _this.root_.classList.add(className);
  8075. },
  8076. removeClass: function removeClass(className) {
  8077. return _this.root_.classList.remove(className);
  8078. },
  8079. addScrollAreaClass: function addScrollAreaClass(className) {
  8080. return _this.area_.classList.add(className);
  8081. },
  8082. setScrollAreaStyleProperty: function setScrollAreaStyleProperty(prop, value) {
  8083. return _this.area_.style.setProperty(prop, value);
  8084. },
  8085. setScrollContentStyleProperty: function setScrollContentStyleProperty(prop, value) {
  8086. return _this.content_.style.setProperty(prop, value);
  8087. },
  8088. getScrollContentStyleValue: function getScrollContentStyleValue(propName) {
  8089. return window.getComputedStyle(_this.content_).getPropertyValue(propName);
  8090. },
  8091. setScrollAreaScrollLeft: function setScrollAreaScrollLeft(scrollX) {
  8092. return _this.area_.scrollLeft = scrollX;
  8093. },
  8094. getScrollAreaScrollLeft: function getScrollAreaScrollLeft() {
  8095. return _this.area_.scrollLeft;
  8096. },
  8097. getScrollContentOffsetWidth: function getScrollContentOffsetWidth() {
  8098. return _this.content_.offsetWidth;
  8099. },
  8100. getScrollAreaOffsetWidth: function getScrollAreaOffsetWidth() {
  8101. return _this.area_.offsetWidth;
  8102. },
  8103. computeScrollAreaClientRect: function computeScrollAreaClientRect() {
  8104. return _this.area_.getBoundingClientRect();
  8105. },
  8106. computeScrollContentClientRect: function computeScrollContentClientRect() {
  8107. return _this.content_.getBoundingClientRect();
  8108. },
  8109. computeHorizontalScrollbarHeight: function computeHorizontalScrollbarHeight() {
  8110. return util.computeHorizontalScrollbarHeight(document);
  8111. }
  8112. };
  8113. return new foundation_1.MDCTabScrollerFoundation(adapter);
  8114. };
  8115. MDCTabScroller.prototype.getScrollPosition = function() {
  8116. return this.foundation_.getScrollPosition();
  8117. };
  8118. MDCTabScroller.prototype.getScrollContentWidth = function() {
  8119. return this.content_.offsetWidth;
  8120. };
  8121. MDCTabScroller.prototype.incrementScroll = function(scrollXIncrement) {
  8122. this.foundation_.incrementScroll(scrollXIncrement);
  8123. };
  8124. MDCTabScroller.prototype.scrollTo = function(scrollX) {
  8125. this.foundation_.scrollTo(scrollX);
  8126. };
  8127. return MDCTabScroller;
  8128. }(component_1.MDCComponent);
  8129. exports.MDCTabScroller = MDCTabScroller;
  8130. }, function(module, exports, __webpack_require__) {
  8131. "use strict";
  8132. var __extends = this && this.__extends || function() {
  8133. var _extendStatics = function extendStatics(d, b) {
  8134. _extendStatics = Object.setPrototypeOf || {
  8135. __proto__: []
  8136. } instanceof Array && function(d, b) {
  8137. d.__proto__ = b;
  8138. } || function(d, b) {
  8139. for (var p in b) {
  8140. if (b.hasOwnProperty(p)) d[p] = b[p];
  8141. }
  8142. };
  8143. return _extendStatics(d, b);
  8144. };
  8145. return function(d, b) {
  8146. _extendStatics(d, b);
  8147. function __() {
  8148. this.constructor = d;
  8149. }
  8150. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  8151. };
  8152. }();
  8153. var __assign = this && this.__assign || function() {
  8154. __assign = Object.assign || function(t) {
  8155. for (var s, i = 1, n = arguments.length; i < n; i++) {
  8156. s = arguments[i];
  8157. for (var p in s) {
  8158. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  8159. }
  8160. }
  8161. return t;
  8162. };
  8163. return __assign.apply(this, arguments);
  8164. };
  8165. var __read = this && this.__read || function(o, n) {
  8166. var m = typeof Symbol === "function" && o[Symbol.iterator];
  8167. if (!m) return o;
  8168. var i = m.call(o), r, ar = [], e;
  8169. try {
  8170. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
  8171. ar.push(r.value);
  8172. }
  8173. } catch (error) {
  8174. e = {
  8175. error: error
  8176. };
  8177. } finally {
  8178. try {
  8179. if (r && !r.done && (m = i["return"])) m.call(i);
  8180. } finally {
  8181. if (e) throw e.error;
  8182. }
  8183. }
  8184. return ar;
  8185. };
  8186. Object.defineProperty(exports, "__esModule", {
  8187. value: true
  8188. });
  8189. var foundation_1 = __webpack_require__(0);
  8190. var constants_1 = __webpack_require__(62);
  8191. var rtl_default_scroller_1 = __webpack_require__(141);
  8192. var rtl_negative_scroller_1 = __webpack_require__(142);
  8193. var rtl_reverse_scroller_1 = __webpack_require__(143);
  8194. var MDCTabScrollerFoundation = function(_super) {
  8195. __extends(MDCTabScrollerFoundation, _super);
  8196. function MDCTabScrollerFoundation(adapter) {
  8197. var _this = _super.call(this, __assign({}, MDCTabScrollerFoundation.defaultAdapter, adapter)) || this;
  8198. _this.isAnimating_ = false;
  8199. return _this;
  8200. }
  8201. Object.defineProperty(MDCTabScrollerFoundation, "cssClasses", {
  8202. get: function get() {
  8203. return constants_1.cssClasses;
  8204. },
  8205. enumerable: true,
  8206. configurable: true
  8207. });
  8208. Object.defineProperty(MDCTabScrollerFoundation, "strings", {
  8209. get: function get() {
  8210. return constants_1.strings;
  8211. },
  8212. enumerable: true,
  8213. configurable: true
  8214. });
  8215. Object.defineProperty(MDCTabScrollerFoundation, "defaultAdapter", {
  8216. get: function get() {
  8217. return {
  8218. eventTargetMatchesSelector: function eventTargetMatchesSelector() {
  8219. return false;
  8220. },
  8221. addClass: function addClass() {
  8222. return undefined;
  8223. },
  8224. removeClass: function removeClass() {
  8225. return undefined;
  8226. },
  8227. addScrollAreaClass: function addScrollAreaClass() {
  8228. return undefined;
  8229. },
  8230. setScrollAreaStyleProperty: function setScrollAreaStyleProperty() {
  8231. return undefined;
  8232. },
  8233. setScrollContentStyleProperty: function setScrollContentStyleProperty() {
  8234. return undefined;
  8235. },
  8236. getScrollContentStyleValue: function getScrollContentStyleValue() {
  8237. return "";
  8238. },
  8239. setScrollAreaScrollLeft: function setScrollAreaScrollLeft() {
  8240. return undefined;
  8241. },
  8242. getScrollAreaScrollLeft: function getScrollAreaScrollLeft() {
  8243. return 0;
  8244. },
  8245. getScrollContentOffsetWidth: function getScrollContentOffsetWidth() {
  8246. return 0;
  8247. },
  8248. getScrollAreaOffsetWidth: function getScrollAreaOffsetWidth() {
  8249. return 0;
  8250. },
  8251. computeScrollAreaClientRect: function computeScrollAreaClientRect() {
  8252. return {
  8253. top: 0,
  8254. right: 0,
  8255. bottom: 0,
  8256. left: 0,
  8257. width: 0,
  8258. height: 0
  8259. };
  8260. },
  8261. computeScrollContentClientRect: function computeScrollContentClientRect() {
  8262. return {
  8263. top: 0,
  8264. right: 0,
  8265. bottom: 0,
  8266. left: 0,
  8267. width: 0,
  8268. height: 0
  8269. };
  8270. },
  8271. computeHorizontalScrollbarHeight: function computeHorizontalScrollbarHeight() {
  8272. return 0;
  8273. }
  8274. };
  8275. },
  8276. enumerable: true,
  8277. configurable: true
  8278. });
  8279. MDCTabScrollerFoundation.prototype.init = function() {
  8280. var horizontalScrollbarHeight = this.adapter_.computeHorizontalScrollbarHeight();
  8281. this.adapter_.setScrollAreaStyleProperty("margin-bottom", -horizontalScrollbarHeight + "px");
  8282. this.adapter_.addScrollAreaClass(MDCTabScrollerFoundation.cssClasses.SCROLL_AREA_SCROLL);
  8283. };
  8284. MDCTabScrollerFoundation.prototype.getScrollPosition = function() {
  8285. if (this.isRTL_()) {
  8286. return this.computeCurrentScrollPositionRTL_();
  8287. }
  8288. var currentTranslateX = this.calculateCurrentTranslateX_();
  8289. var scrollLeft = this.adapter_.getScrollAreaScrollLeft();
  8290. return scrollLeft - currentTranslateX;
  8291. };
  8292. MDCTabScrollerFoundation.prototype.handleInteraction = function() {
  8293. if (!this.isAnimating_) {
  8294. return;
  8295. }
  8296. this.stopScrollAnimation_();
  8297. };
  8298. MDCTabScrollerFoundation.prototype.handleTransitionEnd = function(evt) {
  8299. var evtTarget = evt.target;
  8300. if (!this.isAnimating_ || !this.adapter_.eventTargetMatchesSelector(evtTarget, MDCTabScrollerFoundation.strings.CONTENT_SELECTOR)) {
  8301. return;
  8302. }
  8303. this.isAnimating_ = false;
  8304. this.adapter_.removeClass(MDCTabScrollerFoundation.cssClasses.ANIMATING);
  8305. };
  8306. MDCTabScrollerFoundation.prototype.incrementScroll = function(scrollXIncrement) {
  8307. if (scrollXIncrement === 0) {
  8308. return;
  8309. }
  8310. if (this.isRTL_()) {
  8311. return this.incrementScrollRTL_(scrollXIncrement);
  8312. }
  8313. this.incrementScroll_(scrollXIncrement);
  8314. };
  8315. MDCTabScrollerFoundation.prototype.scrollTo = function(scrollX) {
  8316. if (this.isRTL_()) {
  8317. return this.scrollToRTL_(scrollX);
  8318. }
  8319. this.scrollTo_(scrollX);
  8320. };
  8321. MDCTabScrollerFoundation.prototype.getRTLScroller = function() {
  8322. if (!this.rtlScrollerInstance_) {
  8323. this.rtlScrollerInstance_ = this.rtlScrollerFactory_();
  8324. }
  8325. return this.rtlScrollerInstance_;
  8326. };
  8327. MDCTabScrollerFoundation.prototype.calculateCurrentTranslateX_ = function() {
  8328. var transformValue = this.adapter_.getScrollContentStyleValue("transform");
  8329. if (transformValue === "none") {
  8330. return 0;
  8331. }
  8332. var match = /\((.+?)\)/.exec(transformValue);
  8333. if (!match) {
  8334. return 0;
  8335. }
  8336. var matrixParams = match[1];
  8337. var _a = __read(matrixParams.split(","), 6), a = _a[0], b = _a[1], c = _a[2], d = _a[3], tx = _a[4], ty = _a[5];
  8338. return parseFloat(tx);
  8339. };
  8340. MDCTabScrollerFoundation.prototype.clampScrollValue_ = function(scrollX) {
  8341. var edges = this.calculateScrollEdges_();
  8342. return Math.min(Math.max(edges.left, scrollX), edges.right);
  8343. };
  8344. MDCTabScrollerFoundation.prototype.computeCurrentScrollPositionRTL_ = function() {
  8345. var translateX = this.calculateCurrentTranslateX_();
  8346. return this.getRTLScroller().getScrollPositionRTL(translateX);
  8347. };
  8348. MDCTabScrollerFoundation.prototype.calculateScrollEdges_ = function() {
  8349. var contentWidth = this.adapter_.getScrollContentOffsetWidth();
  8350. var rootWidth = this.adapter_.getScrollAreaOffsetWidth();
  8351. return {
  8352. left: 0,
  8353. right: contentWidth - rootWidth
  8354. };
  8355. };
  8356. MDCTabScrollerFoundation.prototype.scrollTo_ = function(scrollX) {
  8357. var currentScrollX = this.getScrollPosition();
  8358. var safeScrollX = this.clampScrollValue_(scrollX);
  8359. var scrollDelta = safeScrollX - currentScrollX;
  8360. this.animate_({
  8361. finalScrollPosition: safeScrollX,
  8362. scrollDelta: scrollDelta
  8363. });
  8364. };
  8365. MDCTabScrollerFoundation.prototype.scrollToRTL_ = function(scrollX) {
  8366. var animation = this.getRTLScroller().scrollToRTL(scrollX);
  8367. this.animate_(animation);
  8368. };
  8369. MDCTabScrollerFoundation.prototype.incrementScroll_ = function(scrollX) {
  8370. var currentScrollX = this.getScrollPosition();
  8371. var targetScrollX = scrollX + currentScrollX;
  8372. var safeScrollX = this.clampScrollValue_(targetScrollX);
  8373. var scrollDelta = safeScrollX - currentScrollX;
  8374. this.animate_({
  8375. finalScrollPosition: safeScrollX,
  8376. scrollDelta: scrollDelta
  8377. });
  8378. };
  8379. MDCTabScrollerFoundation.prototype.incrementScrollRTL_ = function(scrollX) {
  8380. var animation = this.getRTLScroller().incrementScrollRTL(scrollX);
  8381. this.animate_(animation);
  8382. };
  8383. MDCTabScrollerFoundation.prototype.animate_ = function(animation) {
  8384. var _this = this;
  8385. if (animation.scrollDelta === 0) {
  8386. return;
  8387. }
  8388. this.stopScrollAnimation_();
  8389. this.adapter_.setScrollAreaScrollLeft(animation.finalScrollPosition);
  8390. this.adapter_.setScrollContentStyleProperty("transform", "translateX(" + animation.scrollDelta + "px)");
  8391. this.adapter_.computeScrollAreaClientRect();
  8392. requestAnimationFrame(function() {
  8393. _this.adapter_.addClass(MDCTabScrollerFoundation.cssClasses.ANIMATING);
  8394. _this.adapter_.setScrollContentStyleProperty("transform", "none");
  8395. });
  8396. this.isAnimating_ = true;
  8397. };
  8398. MDCTabScrollerFoundation.prototype.stopScrollAnimation_ = function() {
  8399. this.isAnimating_ = false;
  8400. var currentScrollPosition = this.getAnimatingScrollPosition_();
  8401. this.adapter_.removeClass(MDCTabScrollerFoundation.cssClasses.ANIMATING);
  8402. this.adapter_.setScrollContentStyleProperty("transform", "translateX(0px)");
  8403. this.adapter_.setScrollAreaScrollLeft(currentScrollPosition);
  8404. };
  8405. MDCTabScrollerFoundation.prototype.getAnimatingScrollPosition_ = function() {
  8406. var currentTranslateX = this.calculateCurrentTranslateX_();
  8407. var scrollLeft = this.adapter_.getScrollAreaScrollLeft();
  8408. if (this.isRTL_()) {
  8409. return this.getRTLScroller().getAnimatingScrollPosition(scrollLeft, currentTranslateX);
  8410. }
  8411. return scrollLeft - currentTranslateX;
  8412. };
  8413. MDCTabScrollerFoundation.prototype.rtlScrollerFactory_ = function() {
  8414. var initialScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  8415. this.adapter_.setScrollAreaScrollLeft(initialScrollLeft - 1);
  8416. var newScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  8417. if (newScrollLeft < 0) {
  8418. this.adapter_.setScrollAreaScrollLeft(initialScrollLeft);
  8419. return new rtl_negative_scroller_1.MDCTabScrollerRTLNegative(this.adapter_);
  8420. }
  8421. var rootClientRect = this.adapter_.computeScrollAreaClientRect();
  8422. var contentClientRect = this.adapter_.computeScrollContentClientRect();
  8423. var rightEdgeDelta = Math.round(contentClientRect.right - rootClientRect.right);
  8424. this.adapter_.setScrollAreaScrollLeft(initialScrollLeft);
  8425. if (rightEdgeDelta === newScrollLeft) {
  8426. return new rtl_reverse_scroller_1.MDCTabScrollerRTLReverse(this.adapter_);
  8427. }
  8428. return new rtl_default_scroller_1.MDCTabScrollerRTLDefault(this.adapter_);
  8429. };
  8430. MDCTabScrollerFoundation.prototype.isRTL_ = function() {
  8431. return this.adapter_.getScrollContentStyleValue("direction") === "rtl";
  8432. };
  8433. return MDCTabScrollerFoundation;
  8434. }(foundation_1.MDCFoundation);
  8435. exports.MDCTabScrollerFoundation = MDCTabScrollerFoundation;
  8436. exports.default = MDCTabScrollerFoundation;
  8437. }, function(module, exports, __webpack_require__) {
  8438. "use strict";
  8439. Object.defineProperty(exports, "__esModule", {
  8440. value: true
  8441. });
  8442. var cssClasses = {
  8443. ANIMATING: "mdc-tab-scroller--animating",
  8444. SCROLL_AREA_SCROLL: "mdc-tab-scroller__scroll-area--scroll",
  8445. SCROLL_TEST: "mdc-tab-scroller__test"
  8446. };
  8447. exports.cssClasses = cssClasses;
  8448. var strings = {
  8449. AREA_SELECTOR: ".mdc-tab-scroller__scroll-area",
  8450. CONTENT_SELECTOR: ".mdc-tab-scroller__scroll-content"
  8451. };
  8452. exports.strings = strings;
  8453. }, function(module, exports, __webpack_require__) {
  8454. "use strict";
  8455. Object.defineProperty(exports, "__esModule", {
  8456. value: true
  8457. });
  8458. var constants_1 = __webpack_require__(62);
  8459. var horizontalScrollbarHeight_;
  8460. function computeHorizontalScrollbarHeight(documentObj, shouldCacheResult) {
  8461. if (shouldCacheResult === void 0) {
  8462. shouldCacheResult = true;
  8463. }
  8464. if (shouldCacheResult && typeof horizontalScrollbarHeight_ !== "undefined") {
  8465. return horizontalScrollbarHeight_;
  8466. }
  8467. var el = documentObj.createElement("div");
  8468. el.classList.add(constants_1.cssClasses.SCROLL_TEST);
  8469. documentObj.body.appendChild(el);
  8470. var horizontalScrollbarHeight = el.offsetHeight - el.clientHeight;
  8471. documentObj.body.removeChild(el);
  8472. if (shouldCacheResult) {
  8473. horizontalScrollbarHeight_ = horizontalScrollbarHeight;
  8474. }
  8475. return horizontalScrollbarHeight;
  8476. }
  8477. exports.computeHorizontalScrollbarHeight = computeHorizontalScrollbarHeight;
  8478. }, function(module, exports, __webpack_require__) {
  8479. "use strict";
  8480. var __extends = this && this.__extends || function() {
  8481. var _extendStatics = function extendStatics(d, b) {
  8482. _extendStatics = Object.setPrototypeOf || {
  8483. __proto__: []
  8484. } instanceof Array && function(d, b) {
  8485. d.__proto__ = b;
  8486. } || function(d, b) {
  8487. for (var p in b) {
  8488. if (b.hasOwnProperty(p)) d[p] = b[p];
  8489. }
  8490. };
  8491. return _extendStatics(d, b);
  8492. };
  8493. return function(d, b) {
  8494. _extendStatics(d, b);
  8495. function __() {
  8496. this.constructor = d;
  8497. }
  8498. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  8499. };
  8500. }();
  8501. var __assign = this && this.__assign || function() {
  8502. __assign = Object.assign || function(t) {
  8503. for (var s, i = 1, n = arguments.length; i < n; i++) {
  8504. s = arguments[i];
  8505. for (var p in s) {
  8506. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  8507. }
  8508. }
  8509. return t;
  8510. };
  8511. return __assign.apply(this, arguments);
  8512. };
  8513. Object.defineProperty(exports, "__esModule", {
  8514. value: true
  8515. });
  8516. var component_1 = __webpack_require__(1);
  8517. var component_2 = __webpack_require__(2);
  8518. var foundation_1 = __webpack_require__(4);
  8519. var component_3 = __webpack_require__(65);
  8520. var foundation_2 = __webpack_require__(22);
  8521. var MDCTab = function(_super) {
  8522. __extends(MDCTab, _super);
  8523. function MDCTab() {
  8524. return _super !== null && _super.apply(this, arguments) || this;
  8525. }
  8526. MDCTab.attachTo = function(root) {
  8527. return new MDCTab(root);
  8528. };
  8529. MDCTab.prototype.initialize = function(rippleFactory, tabIndicatorFactory) {
  8530. if (rippleFactory === void 0) {
  8531. rippleFactory = function rippleFactory(el, foundation) {
  8532. return new component_2.MDCRipple(el, foundation);
  8533. };
  8534. }
  8535. if (tabIndicatorFactory === void 0) {
  8536. tabIndicatorFactory = function tabIndicatorFactory(el) {
  8537. return new component_3.MDCTabIndicator(el);
  8538. };
  8539. }
  8540. this.id = this.root_.id;
  8541. var rippleSurface = this.root_.querySelector(foundation_2.MDCTabFoundation.strings.RIPPLE_SELECTOR);
  8542. var rippleAdapter = __assign({}, component_2.MDCRipple.createAdapter(this), {
  8543. addClass: function addClass(className) {
  8544. return rippleSurface.classList.add(className);
  8545. },
  8546. removeClass: function removeClass(className) {
  8547. return rippleSurface.classList.remove(className);
  8548. },
  8549. updateCssVariable: function updateCssVariable(varName, value) {
  8550. return rippleSurface.style.setProperty(varName, value);
  8551. }
  8552. });
  8553. var rippleFoundation = new foundation_1.MDCRippleFoundation(rippleAdapter);
  8554. this.ripple_ = rippleFactory(this.root_, rippleFoundation);
  8555. var tabIndicatorElement = this.root_.querySelector(foundation_2.MDCTabFoundation.strings.TAB_INDICATOR_SELECTOR);
  8556. this.tabIndicator_ = tabIndicatorFactory(tabIndicatorElement);
  8557. this.content_ = this.root_.querySelector(foundation_2.MDCTabFoundation.strings.CONTENT_SELECTOR);
  8558. };
  8559. MDCTab.prototype.initialSyncWithDOM = function() {
  8560. var _this = this;
  8561. this.handleClick_ = function() {
  8562. return _this.foundation_.handleClick();
  8563. };
  8564. this.listen("click", this.handleClick_);
  8565. };
  8566. MDCTab.prototype.destroy = function() {
  8567. this.unlisten("click", this.handleClick_);
  8568. this.ripple_.destroy();
  8569. _super.prototype.destroy.call(this);
  8570. };
  8571. MDCTab.prototype.getDefaultFoundation = function() {
  8572. var _this = this;
  8573. var adapter = {
  8574. setAttr: function setAttr(attr, value) {
  8575. return _this.root_.setAttribute(attr, value);
  8576. },
  8577. addClass: function addClass(className) {
  8578. return _this.root_.classList.add(className);
  8579. },
  8580. removeClass: function removeClass(className) {
  8581. return _this.root_.classList.remove(className);
  8582. },
  8583. hasClass: function hasClass(className) {
  8584. return _this.root_.classList.contains(className);
  8585. },
  8586. activateIndicator: function activateIndicator(previousIndicatorClientRect) {
  8587. return _this.tabIndicator_.activate(previousIndicatorClientRect);
  8588. },
  8589. deactivateIndicator: function deactivateIndicator() {
  8590. return _this.tabIndicator_.deactivate();
  8591. },
  8592. notifyInteracted: function notifyInteracted() {
  8593. return _this.emit(foundation_2.MDCTabFoundation.strings.INTERACTED_EVENT, {
  8594. tabId: _this.id
  8595. }, true);
  8596. },
  8597. getOffsetLeft: function getOffsetLeft() {
  8598. return _this.root_.offsetLeft;
  8599. },
  8600. getOffsetWidth: function getOffsetWidth() {
  8601. return _this.root_.offsetWidth;
  8602. },
  8603. getContentOffsetLeft: function getContentOffsetLeft() {
  8604. return _this.content_.offsetLeft;
  8605. },
  8606. getContentOffsetWidth: function getContentOffsetWidth() {
  8607. return _this.content_.offsetWidth;
  8608. },
  8609. focus: function focus() {
  8610. return _this.root_.focus();
  8611. }
  8612. };
  8613. return new foundation_2.MDCTabFoundation(adapter);
  8614. };
  8615. Object.defineProperty(MDCTab.prototype, "active", {
  8616. get: function get() {
  8617. return this.foundation_.isActive();
  8618. },
  8619. enumerable: true,
  8620. configurable: true
  8621. });
  8622. Object.defineProperty(MDCTab.prototype, "focusOnActivate", {
  8623. set: function set(focusOnActivate) {
  8624. this.foundation_.setFocusOnActivate(focusOnActivate);
  8625. },
  8626. enumerable: true,
  8627. configurable: true
  8628. });
  8629. MDCTab.prototype.activate = function(computeIndicatorClientRect) {
  8630. this.foundation_.activate(computeIndicatorClientRect);
  8631. };
  8632. MDCTab.prototype.deactivate = function() {
  8633. this.foundation_.deactivate();
  8634. };
  8635. MDCTab.prototype.computeIndicatorClientRect = function() {
  8636. return this.tabIndicator_.computeContentClientRect();
  8637. };
  8638. MDCTab.prototype.computeDimensions = function() {
  8639. return this.foundation_.computeDimensions();
  8640. };
  8641. MDCTab.prototype.focus = function() {
  8642. this.root_.focus();
  8643. };
  8644. return MDCTab;
  8645. }(component_1.MDCComponent);
  8646. exports.MDCTab = MDCTab;
  8647. }, function(module, exports, __webpack_require__) {
  8648. "use strict";
  8649. var __extends = this && this.__extends || function() {
  8650. var _extendStatics = function extendStatics(d, b) {
  8651. _extendStatics = Object.setPrototypeOf || {
  8652. __proto__: []
  8653. } instanceof Array && function(d, b) {
  8654. d.__proto__ = b;
  8655. } || function(d, b) {
  8656. for (var p in b) {
  8657. if (b.hasOwnProperty(p)) d[p] = b[p];
  8658. }
  8659. };
  8660. return _extendStatics(d, b);
  8661. };
  8662. return function(d, b) {
  8663. _extendStatics(d, b);
  8664. function __() {
  8665. this.constructor = d;
  8666. }
  8667. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  8668. };
  8669. }();
  8670. Object.defineProperty(exports, "__esModule", {
  8671. value: true
  8672. });
  8673. var component_1 = __webpack_require__(1);
  8674. var fading_foundation_1 = __webpack_require__(66);
  8675. var foundation_1 = __webpack_require__(9);
  8676. var sliding_foundation_1 = __webpack_require__(67);
  8677. var MDCTabIndicator = function(_super) {
  8678. __extends(MDCTabIndicator, _super);
  8679. function MDCTabIndicator() {
  8680. return _super !== null && _super.apply(this, arguments) || this;
  8681. }
  8682. MDCTabIndicator.attachTo = function(root) {
  8683. return new MDCTabIndicator(root);
  8684. };
  8685. MDCTabIndicator.prototype.initialize = function() {
  8686. this.content_ = this.root_.querySelector(foundation_1.MDCTabIndicatorFoundation.strings.CONTENT_SELECTOR);
  8687. };
  8688. MDCTabIndicator.prototype.computeContentClientRect = function() {
  8689. return this.foundation_.computeContentClientRect();
  8690. };
  8691. MDCTabIndicator.prototype.getDefaultFoundation = function() {
  8692. var _this = this;
  8693. var adapter = {
  8694. addClass: function addClass(className) {
  8695. return _this.root_.classList.add(className);
  8696. },
  8697. removeClass: function removeClass(className) {
  8698. return _this.root_.classList.remove(className);
  8699. },
  8700. computeContentClientRect: function computeContentClientRect() {
  8701. return _this.content_.getBoundingClientRect();
  8702. },
  8703. setContentStyleProperty: function setContentStyleProperty(prop, value) {
  8704. return _this.content_.style.setProperty(prop, value);
  8705. }
  8706. };
  8707. if (this.root_.classList.contains(foundation_1.MDCTabIndicatorFoundation.cssClasses.FADE)) {
  8708. return new fading_foundation_1.MDCFadingTabIndicatorFoundation(adapter);
  8709. }
  8710. return new sliding_foundation_1.MDCSlidingTabIndicatorFoundation(adapter);
  8711. };
  8712. MDCTabIndicator.prototype.activate = function(previousIndicatorClientRect) {
  8713. this.foundation_.activate(previousIndicatorClientRect);
  8714. };
  8715. MDCTabIndicator.prototype.deactivate = function() {
  8716. this.foundation_.deactivate();
  8717. };
  8718. return MDCTabIndicator;
  8719. }(component_1.MDCComponent);
  8720. exports.MDCTabIndicator = MDCTabIndicator;
  8721. }, function(module, exports, __webpack_require__) {
  8722. "use strict";
  8723. var __extends = this && this.__extends || function() {
  8724. var _extendStatics = function extendStatics(d, b) {
  8725. _extendStatics = Object.setPrototypeOf || {
  8726. __proto__: []
  8727. } instanceof Array && function(d, b) {
  8728. d.__proto__ = b;
  8729. } || function(d, b) {
  8730. for (var p in b) {
  8731. if (b.hasOwnProperty(p)) d[p] = b[p];
  8732. }
  8733. };
  8734. return _extendStatics(d, b);
  8735. };
  8736. return function(d, b) {
  8737. _extendStatics(d, b);
  8738. function __() {
  8739. this.constructor = d;
  8740. }
  8741. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  8742. };
  8743. }();
  8744. Object.defineProperty(exports, "__esModule", {
  8745. value: true
  8746. });
  8747. var foundation_1 = __webpack_require__(9);
  8748. var MDCFadingTabIndicatorFoundation = function(_super) {
  8749. __extends(MDCFadingTabIndicatorFoundation, _super);
  8750. function MDCFadingTabIndicatorFoundation() {
  8751. return _super !== null && _super.apply(this, arguments) || this;
  8752. }
  8753. MDCFadingTabIndicatorFoundation.prototype.activate = function() {
  8754. this.adapter_.addClass(foundation_1.MDCTabIndicatorFoundation.cssClasses.ACTIVE);
  8755. };
  8756. MDCFadingTabIndicatorFoundation.prototype.deactivate = function() {
  8757. this.adapter_.removeClass(foundation_1.MDCTabIndicatorFoundation.cssClasses.ACTIVE);
  8758. };
  8759. return MDCFadingTabIndicatorFoundation;
  8760. }(foundation_1.MDCTabIndicatorFoundation);
  8761. exports.MDCFadingTabIndicatorFoundation = MDCFadingTabIndicatorFoundation;
  8762. exports.default = MDCFadingTabIndicatorFoundation;
  8763. }, function(module, exports, __webpack_require__) {
  8764. "use strict";
  8765. var __extends = this && this.__extends || function() {
  8766. var _extendStatics = function extendStatics(d, b) {
  8767. _extendStatics = Object.setPrototypeOf || {
  8768. __proto__: []
  8769. } instanceof Array && function(d, b) {
  8770. d.__proto__ = b;
  8771. } || function(d, b) {
  8772. for (var p in b) {
  8773. if (b.hasOwnProperty(p)) d[p] = b[p];
  8774. }
  8775. };
  8776. return _extendStatics(d, b);
  8777. };
  8778. return function(d, b) {
  8779. _extendStatics(d, b);
  8780. function __() {
  8781. this.constructor = d;
  8782. }
  8783. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  8784. };
  8785. }();
  8786. Object.defineProperty(exports, "__esModule", {
  8787. value: true
  8788. });
  8789. var foundation_1 = __webpack_require__(9);
  8790. var MDCSlidingTabIndicatorFoundation = function(_super) {
  8791. __extends(MDCSlidingTabIndicatorFoundation, _super);
  8792. function MDCSlidingTabIndicatorFoundation() {
  8793. return _super !== null && _super.apply(this, arguments) || this;
  8794. }
  8795. MDCSlidingTabIndicatorFoundation.prototype.activate = function(previousIndicatorClientRect) {
  8796. if (!previousIndicatorClientRect) {
  8797. this.adapter_.addClass(foundation_1.MDCTabIndicatorFoundation.cssClasses.ACTIVE);
  8798. return;
  8799. }
  8800. var currentClientRect = this.computeContentClientRect();
  8801. var widthDelta = previousIndicatorClientRect.width / currentClientRect.width;
  8802. var xPosition = previousIndicatorClientRect.left - currentClientRect.left;
  8803. this.adapter_.addClass(foundation_1.MDCTabIndicatorFoundation.cssClasses.NO_TRANSITION);
  8804. this.adapter_.setContentStyleProperty("transform", "translateX(" + xPosition + "px) scaleX(" + widthDelta + ")");
  8805. this.computeContentClientRect();
  8806. this.adapter_.removeClass(foundation_1.MDCTabIndicatorFoundation.cssClasses.NO_TRANSITION);
  8807. this.adapter_.addClass(foundation_1.MDCTabIndicatorFoundation.cssClasses.ACTIVE);
  8808. this.adapter_.setContentStyleProperty("transform", "");
  8809. };
  8810. MDCSlidingTabIndicatorFoundation.prototype.deactivate = function() {
  8811. this.adapter_.removeClass(foundation_1.MDCTabIndicatorFoundation.cssClasses.ACTIVE);
  8812. };
  8813. return MDCSlidingTabIndicatorFoundation;
  8814. }(foundation_1.MDCTabIndicatorFoundation);
  8815. exports.MDCSlidingTabIndicatorFoundation = MDCSlidingTabIndicatorFoundation;
  8816. exports.default = MDCSlidingTabIndicatorFoundation;
  8817. }, function(module, exports, __webpack_require__) {
  8818. "use strict";
  8819. var __extends = this && this.__extends || function() {
  8820. var _extendStatics = function extendStatics(d, b) {
  8821. _extendStatics = Object.setPrototypeOf || {
  8822. __proto__: []
  8823. } instanceof Array && function(d, b) {
  8824. d.__proto__ = b;
  8825. } || function(d, b) {
  8826. for (var p in b) {
  8827. if (b.hasOwnProperty(p)) d[p] = b[p];
  8828. }
  8829. };
  8830. return _extendStatics(d, b);
  8831. };
  8832. return function(d, b) {
  8833. _extendStatics(d, b);
  8834. function __() {
  8835. this.constructor = d;
  8836. }
  8837. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  8838. };
  8839. }();
  8840. var __assign = this && this.__assign || function() {
  8841. __assign = Object.assign || function(t) {
  8842. for (var s, i = 1, n = arguments.length; i < n; i++) {
  8843. s = arguments[i];
  8844. for (var p in s) {
  8845. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  8846. }
  8847. }
  8848. return t;
  8849. };
  8850. return __assign.apply(this, arguments);
  8851. };
  8852. Object.defineProperty(exports, "__esModule", {
  8853. value: true
  8854. });
  8855. var foundation_1 = __webpack_require__(0);
  8856. var constants_1 = __webpack_require__(146);
  8857. var ACCEPTABLE_KEYS = new Set();
  8858. ACCEPTABLE_KEYS.add(constants_1.strings.ARROW_LEFT_KEY);
  8859. ACCEPTABLE_KEYS.add(constants_1.strings.ARROW_RIGHT_KEY);
  8860. ACCEPTABLE_KEYS.add(constants_1.strings.END_KEY);
  8861. ACCEPTABLE_KEYS.add(constants_1.strings.HOME_KEY);
  8862. ACCEPTABLE_KEYS.add(constants_1.strings.ENTER_KEY);
  8863. ACCEPTABLE_KEYS.add(constants_1.strings.SPACE_KEY);
  8864. var KEYCODE_MAP = new Map();
  8865. KEYCODE_MAP.set(constants_1.numbers.ARROW_LEFT_KEYCODE, constants_1.strings.ARROW_LEFT_KEY);
  8866. KEYCODE_MAP.set(constants_1.numbers.ARROW_RIGHT_KEYCODE, constants_1.strings.ARROW_RIGHT_KEY);
  8867. KEYCODE_MAP.set(constants_1.numbers.END_KEYCODE, constants_1.strings.END_KEY);
  8868. KEYCODE_MAP.set(constants_1.numbers.HOME_KEYCODE, constants_1.strings.HOME_KEY);
  8869. KEYCODE_MAP.set(constants_1.numbers.ENTER_KEYCODE, constants_1.strings.ENTER_KEY);
  8870. KEYCODE_MAP.set(constants_1.numbers.SPACE_KEYCODE, constants_1.strings.SPACE_KEY);
  8871. var MDCTabBarFoundation = function(_super) {
  8872. __extends(MDCTabBarFoundation, _super);
  8873. function MDCTabBarFoundation(adapter) {
  8874. var _this = _super.call(this, __assign({}, MDCTabBarFoundation.defaultAdapter, adapter)) || this;
  8875. _this.useAutomaticActivation_ = false;
  8876. return _this;
  8877. }
  8878. Object.defineProperty(MDCTabBarFoundation, "strings", {
  8879. get: function get() {
  8880. return constants_1.strings;
  8881. },
  8882. enumerable: true,
  8883. configurable: true
  8884. });
  8885. Object.defineProperty(MDCTabBarFoundation, "numbers", {
  8886. get: function get() {
  8887. return constants_1.numbers;
  8888. },
  8889. enumerable: true,
  8890. configurable: true
  8891. });
  8892. Object.defineProperty(MDCTabBarFoundation, "defaultAdapter", {
  8893. get: function get() {
  8894. return {
  8895. scrollTo: function scrollTo() {
  8896. return undefined;
  8897. },
  8898. incrementScroll: function incrementScroll() {
  8899. return undefined;
  8900. },
  8901. getScrollPosition: function getScrollPosition() {
  8902. return 0;
  8903. },
  8904. getScrollContentWidth: function getScrollContentWidth() {
  8905. return 0;
  8906. },
  8907. getOffsetWidth: function getOffsetWidth() {
  8908. return 0;
  8909. },
  8910. isRTL: function isRTL() {
  8911. return false;
  8912. },
  8913. setActiveTab: function setActiveTab() {
  8914. return undefined;
  8915. },
  8916. activateTabAtIndex: function activateTabAtIndex() {
  8917. return undefined;
  8918. },
  8919. deactivateTabAtIndex: function deactivateTabAtIndex() {
  8920. return undefined;
  8921. },
  8922. focusTabAtIndex: function focusTabAtIndex() {
  8923. return undefined;
  8924. },
  8925. getTabIndicatorClientRectAtIndex: function getTabIndicatorClientRectAtIndex() {
  8926. return {
  8927. top: 0,
  8928. right: 0,
  8929. bottom: 0,
  8930. left: 0,
  8931. width: 0,
  8932. height: 0
  8933. };
  8934. },
  8935. getTabDimensionsAtIndex: function getTabDimensionsAtIndex() {
  8936. return {
  8937. rootLeft: 0,
  8938. rootRight: 0,
  8939. contentLeft: 0,
  8940. contentRight: 0
  8941. };
  8942. },
  8943. getPreviousActiveTabIndex: function getPreviousActiveTabIndex() {
  8944. return -1;
  8945. },
  8946. getFocusedTabIndex: function getFocusedTabIndex() {
  8947. return -1;
  8948. },
  8949. getIndexOfTabById: function getIndexOfTabById() {
  8950. return -1;
  8951. },
  8952. getTabListLength: function getTabListLength() {
  8953. return 0;
  8954. },
  8955. notifyTabActivated: function notifyTabActivated() {
  8956. return undefined;
  8957. }
  8958. };
  8959. },
  8960. enumerable: true,
  8961. configurable: true
  8962. });
  8963. MDCTabBarFoundation.prototype.setUseAutomaticActivation = function(useAutomaticActivation) {
  8964. this.useAutomaticActivation_ = useAutomaticActivation;
  8965. };
  8966. MDCTabBarFoundation.prototype.activateTab = function(index) {
  8967. var previousActiveIndex = this.adapter_.getPreviousActiveTabIndex();
  8968. if (!this.indexIsInRange_(index) || index === previousActiveIndex) {
  8969. return;
  8970. }
  8971. var previousClientRect;
  8972. if (previousActiveIndex !== -1) {
  8973. this.adapter_.deactivateTabAtIndex(previousActiveIndex);
  8974. previousClientRect = this.adapter_.getTabIndicatorClientRectAtIndex(previousActiveIndex);
  8975. }
  8976. this.adapter_.activateTabAtIndex(index, previousClientRect);
  8977. this.scrollIntoView(index);
  8978. this.adapter_.notifyTabActivated(index);
  8979. };
  8980. MDCTabBarFoundation.prototype.handleKeyDown = function(evt) {
  8981. var key = this.getKeyFromEvent_(evt);
  8982. if (key === undefined) {
  8983. return;
  8984. }
  8985. if (!this.isActivationKey_(key)) {
  8986. evt.preventDefault();
  8987. }
  8988. if (this.useAutomaticActivation_) {
  8989. if (this.isActivationKey_(key)) {
  8990. return;
  8991. }
  8992. var index = this.determineTargetFromKey_(this.adapter_.getPreviousActiveTabIndex(), key);
  8993. this.adapter_.setActiveTab(index);
  8994. this.scrollIntoView(index);
  8995. } else {
  8996. var focusedTabIndex = this.adapter_.getFocusedTabIndex();
  8997. if (this.isActivationKey_(key)) {
  8998. this.adapter_.setActiveTab(focusedTabIndex);
  8999. } else {
  9000. var index = this.determineTargetFromKey_(focusedTabIndex, key);
  9001. this.adapter_.focusTabAtIndex(index);
  9002. this.scrollIntoView(index);
  9003. }
  9004. }
  9005. };
  9006. MDCTabBarFoundation.prototype.handleTabInteraction = function(evt) {
  9007. this.adapter_.setActiveTab(this.adapter_.getIndexOfTabById(evt.detail.tabId));
  9008. };
  9009. MDCTabBarFoundation.prototype.scrollIntoView = function(index) {
  9010. if (!this.indexIsInRange_(index)) {
  9011. return;
  9012. }
  9013. if (index === 0) {
  9014. return this.adapter_.scrollTo(0);
  9015. }
  9016. if (index === this.adapter_.getTabListLength() - 1) {
  9017. return this.adapter_.scrollTo(this.adapter_.getScrollContentWidth());
  9018. }
  9019. if (this.isRTL_()) {
  9020. return this.scrollIntoViewRTL_(index);
  9021. }
  9022. this.scrollIntoView_(index);
  9023. };
  9024. MDCTabBarFoundation.prototype.determineTargetFromKey_ = function(origin, key) {
  9025. var isRTL = this.isRTL_();
  9026. var maxIndex = this.adapter_.getTabListLength() - 1;
  9027. var shouldGoToEnd = key === constants_1.strings.END_KEY;
  9028. var shouldDecrement = key === constants_1.strings.ARROW_LEFT_KEY && !isRTL || key === constants_1.strings.ARROW_RIGHT_KEY && isRTL;
  9029. var shouldIncrement = key === constants_1.strings.ARROW_RIGHT_KEY && !isRTL || key === constants_1.strings.ARROW_LEFT_KEY && isRTL;
  9030. var index = origin;
  9031. if (shouldGoToEnd) {
  9032. index = maxIndex;
  9033. } else if (shouldDecrement) {
  9034. index -= 1;
  9035. } else if (shouldIncrement) {
  9036. index += 1;
  9037. } else {
  9038. index = 0;
  9039. }
  9040. if (index < 0) {
  9041. index = maxIndex;
  9042. } else if (index > maxIndex) {
  9043. index = 0;
  9044. }
  9045. return index;
  9046. };
  9047. MDCTabBarFoundation.prototype.calculateScrollIncrement_ = function(index, nextIndex, scrollPosition, barWidth) {
  9048. var nextTabDimensions = this.adapter_.getTabDimensionsAtIndex(nextIndex);
  9049. var relativeContentLeft = nextTabDimensions.contentLeft - scrollPosition - barWidth;
  9050. var relativeContentRight = nextTabDimensions.contentRight - scrollPosition;
  9051. var leftIncrement = relativeContentRight - constants_1.numbers.EXTRA_SCROLL_AMOUNT;
  9052. var rightIncrement = relativeContentLeft + constants_1.numbers.EXTRA_SCROLL_AMOUNT;
  9053. if (nextIndex < index) {
  9054. return Math.min(leftIncrement, 0);
  9055. }
  9056. return Math.max(rightIncrement, 0);
  9057. };
  9058. MDCTabBarFoundation.prototype.calculateScrollIncrementRTL_ = function(index, nextIndex, scrollPosition, barWidth, scrollContentWidth) {
  9059. var nextTabDimensions = this.adapter_.getTabDimensionsAtIndex(nextIndex);
  9060. var relativeContentLeft = scrollContentWidth - nextTabDimensions.contentLeft - scrollPosition;
  9061. var relativeContentRight = scrollContentWidth - nextTabDimensions.contentRight - scrollPosition - barWidth;
  9062. var leftIncrement = relativeContentRight + constants_1.numbers.EXTRA_SCROLL_AMOUNT;
  9063. var rightIncrement = relativeContentLeft - constants_1.numbers.EXTRA_SCROLL_AMOUNT;
  9064. if (nextIndex > index) {
  9065. return Math.max(leftIncrement, 0);
  9066. }
  9067. return Math.min(rightIncrement, 0);
  9068. };
  9069. MDCTabBarFoundation.prototype.findAdjacentTabIndexClosestToEdge_ = function(index, tabDimensions, scrollPosition, barWidth) {
  9070. var relativeRootLeft = tabDimensions.rootLeft - scrollPosition;
  9071. var relativeRootRight = tabDimensions.rootRight - scrollPosition - barWidth;
  9072. var relativeRootDelta = relativeRootLeft + relativeRootRight;
  9073. var leftEdgeIsCloser = relativeRootLeft < 0 || relativeRootDelta < 0;
  9074. var rightEdgeIsCloser = relativeRootRight > 0 || relativeRootDelta > 0;
  9075. if (leftEdgeIsCloser) {
  9076. return index - 1;
  9077. }
  9078. if (rightEdgeIsCloser) {
  9079. return index + 1;
  9080. }
  9081. return -1;
  9082. };
  9083. MDCTabBarFoundation.prototype.findAdjacentTabIndexClosestToEdgeRTL_ = function(index, tabDimensions, scrollPosition, barWidth, scrollContentWidth) {
  9084. var rootLeft = scrollContentWidth - tabDimensions.rootLeft - barWidth - scrollPosition;
  9085. var rootRight = scrollContentWidth - tabDimensions.rootRight - scrollPosition;
  9086. var rootDelta = rootLeft + rootRight;
  9087. var leftEdgeIsCloser = rootLeft > 0 || rootDelta > 0;
  9088. var rightEdgeIsCloser = rootRight < 0 || rootDelta < 0;
  9089. if (leftEdgeIsCloser) {
  9090. return index + 1;
  9091. }
  9092. if (rightEdgeIsCloser) {
  9093. return index - 1;
  9094. }
  9095. return -1;
  9096. };
  9097. MDCTabBarFoundation.prototype.getKeyFromEvent_ = function(evt) {
  9098. if (ACCEPTABLE_KEYS.has(evt.key)) {
  9099. return evt.key;
  9100. }
  9101. return KEYCODE_MAP.get(evt.keyCode);
  9102. };
  9103. MDCTabBarFoundation.prototype.isActivationKey_ = function(key) {
  9104. return key === constants_1.strings.SPACE_KEY || key === constants_1.strings.ENTER_KEY;
  9105. };
  9106. MDCTabBarFoundation.prototype.indexIsInRange_ = function(index) {
  9107. return index >= 0 && index < this.adapter_.getTabListLength();
  9108. };
  9109. MDCTabBarFoundation.prototype.isRTL_ = function() {
  9110. return this.adapter_.isRTL();
  9111. };
  9112. MDCTabBarFoundation.prototype.scrollIntoView_ = function(index) {
  9113. var scrollPosition = this.adapter_.getScrollPosition();
  9114. var barWidth = this.adapter_.getOffsetWidth();
  9115. var tabDimensions = this.adapter_.getTabDimensionsAtIndex(index);
  9116. var nextIndex = this.findAdjacentTabIndexClosestToEdge_(index, tabDimensions, scrollPosition, barWidth);
  9117. if (!this.indexIsInRange_(nextIndex)) {
  9118. return;
  9119. }
  9120. var scrollIncrement = this.calculateScrollIncrement_(index, nextIndex, scrollPosition, barWidth);
  9121. this.adapter_.incrementScroll(scrollIncrement);
  9122. };
  9123. MDCTabBarFoundation.prototype.scrollIntoViewRTL_ = function(index) {
  9124. var scrollPosition = this.adapter_.getScrollPosition();
  9125. var barWidth = this.adapter_.getOffsetWidth();
  9126. var tabDimensions = this.adapter_.getTabDimensionsAtIndex(index);
  9127. var scrollWidth = this.adapter_.getScrollContentWidth();
  9128. var nextIndex = this.findAdjacentTabIndexClosestToEdgeRTL_(index, tabDimensions, scrollPosition, barWidth, scrollWidth);
  9129. if (!this.indexIsInRange_(nextIndex)) {
  9130. return;
  9131. }
  9132. var scrollIncrement = this.calculateScrollIncrementRTL_(index, nextIndex, scrollPosition, barWidth, scrollWidth);
  9133. this.adapter_.incrementScroll(scrollIncrement);
  9134. };
  9135. return MDCTabBarFoundation;
  9136. }(foundation_1.MDCFoundation);
  9137. exports.MDCTabBarFoundation = MDCTabBarFoundation;
  9138. exports.default = MDCTabBarFoundation;
  9139. }, function(module, exports, __webpack_require__) {
  9140. "use strict";
  9141. var __extends = this && this.__extends || function() {
  9142. var _extendStatics = function extendStatics(d, b) {
  9143. _extendStatics = Object.setPrototypeOf || {
  9144. __proto__: []
  9145. } instanceof Array && function(d, b) {
  9146. d.__proto__ = b;
  9147. } || function(d, b) {
  9148. for (var p in b) {
  9149. if (b.hasOwnProperty(p)) d[p] = b[p];
  9150. }
  9151. };
  9152. return _extendStatics(d, b);
  9153. };
  9154. return function(d, b) {
  9155. _extendStatics(d, b);
  9156. function __() {
  9157. this.constructor = d;
  9158. }
  9159. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  9160. };
  9161. }();
  9162. Object.defineProperty(exports, "__esModule", {
  9163. value: true
  9164. });
  9165. var component_1 = __webpack_require__(1);
  9166. var foundation_1 = __webpack_require__(23);
  9167. var MDCTextFieldCharacterCounter = function(_super) {
  9168. __extends(MDCTextFieldCharacterCounter, _super);
  9169. function MDCTextFieldCharacterCounter() {
  9170. return _super !== null && _super.apply(this, arguments) || this;
  9171. }
  9172. MDCTextFieldCharacterCounter.attachTo = function(root) {
  9173. return new MDCTextFieldCharacterCounter(root);
  9174. };
  9175. Object.defineProperty(MDCTextFieldCharacterCounter.prototype, "foundation", {
  9176. get: function get() {
  9177. return this.foundation_;
  9178. },
  9179. enumerable: true,
  9180. configurable: true
  9181. });
  9182. MDCTextFieldCharacterCounter.prototype.getDefaultFoundation = function() {
  9183. var _this = this;
  9184. var adapter = {
  9185. setContent: function setContent(content) {
  9186. _this.root_.textContent = content;
  9187. }
  9188. };
  9189. return new foundation_1.MDCTextFieldCharacterCounterFoundation(adapter);
  9190. };
  9191. return MDCTextFieldCharacterCounter;
  9192. }(component_1.MDCComponent);
  9193. exports.MDCTextFieldCharacterCounter = MDCTextFieldCharacterCounter;
  9194. }, function(module, exports, __webpack_require__) {
  9195. "use strict";
  9196. Object.defineProperty(exports, "__esModule", {
  9197. value: true
  9198. });
  9199. var strings = {
  9200. ARIA_CONTROLS: "aria-controls",
  9201. ICON_SELECTOR: ".mdc-text-field__icon",
  9202. INPUT_SELECTOR: ".mdc-text-field__input",
  9203. LABEL_SELECTOR: ".mdc-floating-label",
  9204. LINE_RIPPLE_SELECTOR: ".mdc-line-ripple",
  9205. OUTLINE_SELECTOR: ".mdc-notched-outline"
  9206. };
  9207. exports.strings = strings;
  9208. var cssClasses = {
  9209. DENSE: "mdc-text-field--dense",
  9210. DISABLED: "mdc-text-field--disabled",
  9211. FOCUSED: "mdc-text-field--focused",
  9212. FULLWIDTH: "mdc-text-field--fullwidth",
  9213. HELPER_LINE: "mdc-text-field-helper-line",
  9214. INVALID: "mdc-text-field--invalid",
  9215. NO_LABEL: "mdc-text-field--no-label",
  9216. OUTLINED: "mdc-text-field--outlined",
  9217. ROOT: "mdc-text-field",
  9218. TEXTAREA: "mdc-text-field--textarea",
  9219. WITH_LEADING_ICON: "mdc-text-field--with-leading-icon",
  9220. WITH_TRAILING_ICON: "mdc-text-field--with-trailing-icon"
  9221. };
  9222. exports.cssClasses = cssClasses;
  9223. var numbers = {
  9224. DENSE_LABEL_SCALE: .923,
  9225. LABEL_SCALE: .75
  9226. };
  9227. exports.numbers = numbers;
  9228. var VALIDATION_ATTR_WHITELIST = [ "pattern", "min", "max", "required", "step", "minlength", "maxlength" ];
  9229. exports.VALIDATION_ATTR_WHITELIST = VALIDATION_ATTR_WHITELIST;
  9230. var ALWAYS_FLOAT_TYPES = [ "color", "date", "datetime-local", "month", "range", "time", "week" ];
  9231. exports.ALWAYS_FLOAT_TYPES = ALWAYS_FLOAT_TYPES;
  9232. }, function(module, exports, __webpack_require__) {
  9233. "use strict";
  9234. var __extends = this && this.__extends || function() {
  9235. var _extendStatics = function extendStatics(d, b) {
  9236. _extendStatics = Object.setPrototypeOf || {
  9237. __proto__: []
  9238. } instanceof Array && function(d, b) {
  9239. d.__proto__ = b;
  9240. } || function(d, b) {
  9241. for (var p in b) {
  9242. if (b.hasOwnProperty(p)) d[p] = b[p];
  9243. }
  9244. };
  9245. return _extendStatics(d, b);
  9246. };
  9247. return function(d, b) {
  9248. _extendStatics(d, b);
  9249. function __() {
  9250. this.constructor = d;
  9251. }
  9252. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  9253. };
  9254. }();
  9255. var __assign = this && this.__assign || function() {
  9256. __assign = Object.assign || function(t) {
  9257. for (var s, i = 1, n = arguments.length; i < n; i++) {
  9258. s = arguments[i];
  9259. for (var p in s) {
  9260. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  9261. }
  9262. }
  9263. return t;
  9264. };
  9265. return __assign.apply(this, arguments);
  9266. };
  9267. Object.defineProperty(exports, "__esModule", {
  9268. value: true
  9269. });
  9270. var foundation_1 = __webpack_require__(0);
  9271. var constants_1 = __webpack_require__(70);
  9272. var POINTERDOWN_EVENTS = [ "mousedown", "touchstart" ];
  9273. var INTERACTION_EVENTS = [ "click", "keydown" ];
  9274. var MDCTextFieldFoundation = function(_super) {
  9275. __extends(MDCTextFieldFoundation, _super);
  9276. function MDCTextFieldFoundation(adapter, foundationMap) {
  9277. if (foundationMap === void 0) {
  9278. foundationMap = {};
  9279. }
  9280. var _this = _super.call(this, __assign({}, MDCTextFieldFoundation.defaultAdapter, adapter)) || this;
  9281. _this.isFocused_ = false;
  9282. _this.receivedUserInput_ = false;
  9283. _this.isValid_ = true;
  9284. _this.useNativeValidation_ = true;
  9285. _this.helperText_ = foundationMap.helperText;
  9286. _this.characterCounter_ = foundationMap.characterCounter;
  9287. _this.leadingIcon_ = foundationMap.leadingIcon;
  9288. _this.trailingIcon_ = foundationMap.trailingIcon;
  9289. _this.inputFocusHandler_ = function() {
  9290. return _this.activateFocus();
  9291. };
  9292. _this.inputBlurHandler_ = function() {
  9293. return _this.deactivateFocus();
  9294. };
  9295. _this.inputInputHandler_ = function() {
  9296. return _this.handleInput();
  9297. };
  9298. _this.setPointerXOffset_ = function(evt) {
  9299. return _this.setTransformOrigin(evt);
  9300. };
  9301. _this.textFieldInteractionHandler_ = function() {
  9302. return _this.handleTextFieldInteraction();
  9303. };
  9304. _this.validationAttributeChangeHandler_ = function(attributesList) {
  9305. return _this.handleValidationAttributeChange(attributesList);
  9306. };
  9307. return _this;
  9308. }
  9309. Object.defineProperty(MDCTextFieldFoundation, "cssClasses", {
  9310. get: function get() {
  9311. return constants_1.cssClasses;
  9312. },
  9313. enumerable: true,
  9314. configurable: true
  9315. });
  9316. Object.defineProperty(MDCTextFieldFoundation, "strings", {
  9317. get: function get() {
  9318. return constants_1.strings;
  9319. },
  9320. enumerable: true,
  9321. configurable: true
  9322. });
  9323. Object.defineProperty(MDCTextFieldFoundation, "numbers", {
  9324. get: function get() {
  9325. return constants_1.numbers;
  9326. },
  9327. enumerable: true,
  9328. configurable: true
  9329. });
  9330. Object.defineProperty(MDCTextFieldFoundation.prototype, "shouldAlwaysFloat_", {
  9331. get: function get() {
  9332. var type = this.getNativeInput_().type;
  9333. return constants_1.ALWAYS_FLOAT_TYPES.indexOf(type) >= 0;
  9334. },
  9335. enumerable: true,
  9336. configurable: true
  9337. });
  9338. Object.defineProperty(MDCTextFieldFoundation.prototype, "shouldFloat", {
  9339. get: function get() {
  9340. return this.shouldAlwaysFloat_ || this.isFocused_ || Boolean(this.getValue()) || this.isBadInput_();
  9341. },
  9342. enumerable: true,
  9343. configurable: true
  9344. });
  9345. Object.defineProperty(MDCTextFieldFoundation.prototype, "shouldShake", {
  9346. get: function get() {
  9347. return !this.isFocused_ && !this.isValid() && Boolean(this.getValue());
  9348. },
  9349. enumerable: true,
  9350. configurable: true
  9351. });
  9352. Object.defineProperty(MDCTextFieldFoundation, "defaultAdapter", {
  9353. get: function get() {
  9354. return {
  9355. addClass: function addClass() {
  9356. return undefined;
  9357. },
  9358. removeClass: function removeClass() {
  9359. return undefined;
  9360. },
  9361. hasClass: function hasClass() {
  9362. return true;
  9363. },
  9364. registerTextFieldInteractionHandler: function registerTextFieldInteractionHandler() {
  9365. return undefined;
  9366. },
  9367. deregisterTextFieldInteractionHandler: function deregisterTextFieldInteractionHandler() {
  9368. return undefined;
  9369. },
  9370. registerInputInteractionHandler: function registerInputInteractionHandler() {
  9371. return undefined;
  9372. },
  9373. deregisterInputInteractionHandler: function deregisterInputInteractionHandler() {
  9374. return undefined;
  9375. },
  9376. registerValidationAttributeChangeHandler: function registerValidationAttributeChangeHandler() {
  9377. return new MutationObserver(function() {
  9378. return undefined;
  9379. });
  9380. },
  9381. deregisterValidationAttributeChangeHandler: function deregisterValidationAttributeChangeHandler() {
  9382. return undefined;
  9383. },
  9384. getNativeInput: function getNativeInput() {
  9385. return null;
  9386. },
  9387. isFocused: function isFocused() {
  9388. return false;
  9389. },
  9390. activateLineRipple: function activateLineRipple() {
  9391. return undefined;
  9392. },
  9393. deactivateLineRipple: function deactivateLineRipple() {
  9394. return undefined;
  9395. },
  9396. setLineRippleTransformOrigin: function setLineRippleTransformOrigin() {
  9397. return undefined;
  9398. },
  9399. shakeLabel: function shakeLabel() {
  9400. return undefined;
  9401. },
  9402. floatLabel: function floatLabel() {
  9403. return undefined;
  9404. },
  9405. hasLabel: function hasLabel() {
  9406. return false;
  9407. },
  9408. getLabelWidth: function getLabelWidth() {
  9409. return 0;
  9410. },
  9411. hasOutline: function hasOutline() {
  9412. return false;
  9413. },
  9414. notchOutline: function notchOutline() {
  9415. return undefined;
  9416. },
  9417. closeOutline: function closeOutline() {
  9418. return undefined;
  9419. }
  9420. };
  9421. },
  9422. enumerable: true,
  9423. configurable: true
  9424. });
  9425. MDCTextFieldFoundation.prototype.init = function() {
  9426. var _this = this;
  9427. if (this.adapter_.isFocused()) {
  9428. this.inputFocusHandler_();
  9429. } else if (this.adapter_.hasLabel() && this.shouldFloat) {
  9430. this.notchOutline(true);
  9431. this.adapter_.floatLabel(true);
  9432. }
  9433. this.adapter_.registerInputInteractionHandler("focus", this.inputFocusHandler_);
  9434. this.adapter_.registerInputInteractionHandler("blur", this.inputBlurHandler_);
  9435. this.adapter_.registerInputInteractionHandler("input", this.inputInputHandler_);
  9436. POINTERDOWN_EVENTS.forEach(function(evtType) {
  9437. _this.adapter_.registerInputInteractionHandler(evtType, _this.setPointerXOffset_);
  9438. });
  9439. INTERACTION_EVENTS.forEach(function(evtType) {
  9440. _this.adapter_.registerTextFieldInteractionHandler(evtType, _this.textFieldInteractionHandler_);
  9441. });
  9442. this.validationObserver_ = this.adapter_.registerValidationAttributeChangeHandler(this.validationAttributeChangeHandler_);
  9443. this.setCharacterCounter_(this.getValue().length);
  9444. };
  9445. MDCTextFieldFoundation.prototype.destroy = function() {
  9446. var _this = this;
  9447. this.adapter_.deregisterInputInteractionHandler("focus", this.inputFocusHandler_);
  9448. this.adapter_.deregisterInputInteractionHandler("blur", this.inputBlurHandler_);
  9449. this.adapter_.deregisterInputInteractionHandler("input", this.inputInputHandler_);
  9450. POINTERDOWN_EVENTS.forEach(function(evtType) {
  9451. _this.adapter_.deregisterInputInteractionHandler(evtType, _this.setPointerXOffset_);
  9452. });
  9453. INTERACTION_EVENTS.forEach(function(evtType) {
  9454. _this.adapter_.deregisterTextFieldInteractionHandler(evtType, _this.textFieldInteractionHandler_);
  9455. });
  9456. this.adapter_.deregisterValidationAttributeChangeHandler(this.validationObserver_);
  9457. };
  9458. MDCTextFieldFoundation.prototype.handleTextFieldInteraction = function() {
  9459. var nativeInput = this.adapter_.getNativeInput();
  9460. if (nativeInput && nativeInput.disabled) {
  9461. return;
  9462. }
  9463. this.receivedUserInput_ = true;
  9464. };
  9465. MDCTextFieldFoundation.prototype.handleValidationAttributeChange = function(attributesList) {
  9466. var _this = this;
  9467. attributesList.some(function(attributeName) {
  9468. if (constants_1.VALIDATION_ATTR_WHITELIST.indexOf(attributeName) > -1) {
  9469. _this.styleValidity_(true);
  9470. return true;
  9471. }
  9472. return false;
  9473. });
  9474. if (attributesList.indexOf("maxlength") > -1) {
  9475. this.setCharacterCounter_(this.getValue().length);
  9476. }
  9477. };
  9478. MDCTextFieldFoundation.prototype.notchOutline = function(openNotch) {
  9479. if (!this.adapter_.hasOutline()) {
  9480. return;
  9481. }
  9482. if (openNotch) {
  9483. var isDense = this.adapter_.hasClass(constants_1.cssClasses.DENSE);
  9484. var labelScale = isDense ? constants_1.numbers.DENSE_LABEL_SCALE : constants_1.numbers.LABEL_SCALE;
  9485. var labelWidth = this.adapter_.getLabelWidth() * labelScale;
  9486. this.adapter_.notchOutline(labelWidth);
  9487. } else {
  9488. this.adapter_.closeOutline();
  9489. }
  9490. };
  9491. MDCTextFieldFoundation.prototype.activateFocus = function() {
  9492. this.isFocused_ = true;
  9493. this.styleFocused_(this.isFocused_);
  9494. this.adapter_.activateLineRipple();
  9495. if (this.adapter_.hasLabel()) {
  9496. this.notchOutline(this.shouldFloat);
  9497. this.adapter_.floatLabel(this.shouldFloat);
  9498. this.adapter_.shakeLabel(this.shouldShake);
  9499. }
  9500. if (this.helperText_) {
  9501. this.helperText_.showToScreenReader();
  9502. }
  9503. };
  9504. MDCTextFieldFoundation.prototype.setTransformOrigin = function(evt) {
  9505. var touches = evt.touches;
  9506. var targetEvent = touches ? touches[0] : evt;
  9507. var targetClientRect = targetEvent.target.getBoundingClientRect();
  9508. var normalizedX = targetEvent.clientX - targetClientRect.left;
  9509. this.adapter_.setLineRippleTransformOrigin(normalizedX);
  9510. };
  9511. MDCTextFieldFoundation.prototype.handleInput = function() {
  9512. this.autoCompleteFocus();
  9513. this.setCharacterCounter_(this.getValue().length);
  9514. };
  9515. MDCTextFieldFoundation.prototype.autoCompleteFocus = function() {
  9516. if (!this.receivedUserInput_) {
  9517. this.activateFocus();
  9518. }
  9519. };
  9520. MDCTextFieldFoundation.prototype.deactivateFocus = function() {
  9521. this.isFocused_ = false;
  9522. this.adapter_.deactivateLineRipple();
  9523. var isValid = this.isValid();
  9524. this.styleValidity_(isValid);
  9525. this.styleFocused_(this.isFocused_);
  9526. if (this.adapter_.hasLabel()) {
  9527. this.notchOutline(this.shouldFloat);
  9528. this.adapter_.floatLabel(this.shouldFloat);
  9529. this.adapter_.shakeLabel(this.shouldShake);
  9530. }
  9531. if (!this.shouldFloat) {
  9532. this.receivedUserInput_ = false;
  9533. }
  9534. };
  9535. MDCTextFieldFoundation.prototype.getValue = function() {
  9536. return this.getNativeInput_().value;
  9537. };
  9538. MDCTextFieldFoundation.prototype.setValue = function(value) {
  9539. if (this.getValue() !== value) {
  9540. this.getNativeInput_().value = value;
  9541. }
  9542. this.setCharacterCounter_(value.length);
  9543. var isValid = this.isValid();
  9544. this.styleValidity_(isValid);
  9545. if (this.adapter_.hasLabel()) {
  9546. this.notchOutline(this.shouldFloat);
  9547. this.adapter_.floatLabel(this.shouldFloat);
  9548. this.adapter_.shakeLabel(this.shouldShake);
  9549. }
  9550. };
  9551. MDCTextFieldFoundation.prototype.isValid = function() {
  9552. return this.useNativeValidation_ ? this.isNativeInputValid_() : this.isValid_;
  9553. };
  9554. MDCTextFieldFoundation.prototype.setValid = function(isValid) {
  9555. this.isValid_ = isValid;
  9556. this.styleValidity_(isValid);
  9557. var shouldShake = !isValid && !this.isFocused_;
  9558. if (this.adapter_.hasLabel()) {
  9559. this.adapter_.shakeLabel(shouldShake);
  9560. }
  9561. };
  9562. MDCTextFieldFoundation.prototype.setUseNativeValidation = function(useNativeValidation) {
  9563. this.useNativeValidation_ = useNativeValidation;
  9564. };
  9565. MDCTextFieldFoundation.prototype.isDisabled = function() {
  9566. return this.getNativeInput_().disabled;
  9567. };
  9568. MDCTextFieldFoundation.prototype.setDisabled = function(disabled) {
  9569. this.getNativeInput_().disabled = disabled;
  9570. this.styleDisabled_(disabled);
  9571. };
  9572. MDCTextFieldFoundation.prototype.setHelperTextContent = function(content) {
  9573. if (this.helperText_) {
  9574. this.helperText_.setContent(content);
  9575. }
  9576. };
  9577. MDCTextFieldFoundation.prototype.setLeadingIconAriaLabel = function(label) {
  9578. if (this.leadingIcon_) {
  9579. this.leadingIcon_.setAriaLabel(label);
  9580. }
  9581. };
  9582. MDCTextFieldFoundation.prototype.setLeadingIconContent = function(content) {
  9583. if (this.leadingIcon_) {
  9584. this.leadingIcon_.setContent(content);
  9585. }
  9586. };
  9587. MDCTextFieldFoundation.prototype.setTrailingIconAriaLabel = function(label) {
  9588. if (this.trailingIcon_) {
  9589. this.trailingIcon_.setAriaLabel(label);
  9590. }
  9591. };
  9592. MDCTextFieldFoundation.prototype.setTrailingIconContent = function(content) {
  9593. if (this.trailingIcon_) {
  9594. this.trailingIcon_.setContent(content);
  9595. }
  9596. };
  9597. MDCTextFieldFoundation.prototype.setCharacterCounter_ = function(currentLength) {
  9598. if (!this.characterCounter_) {
  9599. return;
  9600. }
  9601. var maxLength = this.getNativeInput_().maxLength;
  9602. if (maxLength === -1) {
  9603. throw new Error("MDCTextFieldFoundation: Expected maxlength html property on text input or textarea.");
  9604. }
  9605. this.characterCounter_.setCounterValue(currentLength, maxLength);
  9606. };
  9607. MDCTextFieldFoundation.prototype.isBadInput_ = function() {
  9608. return this.getNativeInput_().validity.badInput || false;
  9609. };
  9610. MDCTextFieldFoundation.prototype.isNativeInputValid_ = function() {
  9611. return this.getNativeInput_().validity.valid;
  9612. };
  9613. MDCTextFieldFoundation.prototype.styleValidity_ = function(isValid) {
  9614. var INVALID = MDCTextFieldFoundation.cssClasses.INVALID;
  9615. if (isValid) {
  9616. this.adapter_.removeClass(INVALID);
  9617. } else {
  9618. this.adapter_.addClass(INVALID);
  9619. }
  9620. if (this.helperText_) {
  9621. this.helperText_.setValidity(isValid);
  9622. }
  9623. };
  9624. MDCTextFieldFoundation.prototype.styleFocused_ = function(isFocused) {
  9625. var FOCUSED = MDCTextFieldFoundation.cssClasses.FOCUSED;
  9626. if (isFocused) {
  9627. this.adapter_.addClass(FOCUSED);
  9628. } else {
  9629. this.adapter_.removeClass(FOCUSED);
  9630. }
  9631. };
  9632. MDCTextFieldFoundation.prototype.styleDisabled_ = function(isDisabled) {
  9633. var _a = MDCTextFieldFoundation.cssClasses, DISABLED = _a.DISABLED, INVALID = _a.INVALID;
  9634. if (isDisabled) {
  9635. this.adapter_.addClass(DISABLED);
  9636. this.adapter_.removeClass(INVALID);
  9637. } else {
  9638. this.adapter_.removeClass(DISABLED);
  9639. }
  9640. if (this.leadingIcon_) {
  9641. this.leadingIcon_.setDisabled(isDisabled);
  9642. }
  9643. if (this.trailingIcon_) {
  9644. this.trailingIcon_.setDisabled(isDisabled);
  9645. }
  9646. };
  9647. MDCTextFieldFoundation.prototype.getNativeInput_ = function() {
  9648. var nativeInput = this.adapter_ ? this.adapter_.getNativeInput() : null;
  9649. return nativeInput || {
  9650. disabled: false,
  9651. maxLength: -1,
  9652. type: "input",
  9653. validity: {
  9654. badInput: false,
  9655. valid: true
  9656. },
  9657. value: ""
  9658. };
  9659. };
  9660. return MDCTextFieldFoundation;
  9661. }(foundation_1.MDCFoundation);
  9662. exports.MDCTextFieldFoundation = MDCTextFieldFoundation;
  9663. exports.default = MDCTextFieldFoundation;
  9664. }, function(module, exports, __webpack_require__) {
  9665. "use strict";
  9666. var __extends = this && this.__extends || function() {
  9667. var _extendStatics = function extendStatics(d, b) {
  9668. _extendStatics = Object.setPrototypeOf || {
  9669. __proto__: []
  9670. } instanceof Array && function(d, b) {
  9671. d.__proto__ = b;
  9672. } || function(d, b) {
  9673. for (var p in b) {
  9674. if (b.hasOwnProperty(p)) d[p] = b[p];
  9675. }
  9676. };
  9677. return _extendStatics(d, b);
  9678. };
  9679. return function(d, b) {
  9680. _extendStatics(d, b);
  9681. function __() {
  9682. this.constructor = d;
  9683. }
  9684. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  9685. };
  9686. }();
  9687. Object.defineProperty(exports, "__esModule", {
  9688. value: true
  9689. });
  9690. var component_1 = __webpack_require__(1);
  9691. var foundation_1 = __webpack_require__(24);
  9692. var MDCTextFieldHelperText = function(_super) {
  9693. __extends(MDCTextFieldHelperText, _super);
  9694. function MDCTextFieldHelperText() {
  9695. return _super !== null && _super.apply(this, arguments) || this;
  9696. }
  9697. MDCTextFieldHelperText.attachTo = function(root) {
  9698. return new MDCTextFieldHelperText(root);
  9699. };
  9700. Object.defineProperty(MDCTextFieldHelperText.prototype, "foundation", {
  9701. get: function get() {
  9702. return this.foundation_;
  9703. },
  9704. enumerable: true,
  9705. configurable: true
  9706. });
  9707. MDCTextFieldHelperText.prototype.getDefaultFoundation = function() {
  9708. var _this = this;
  9709. var adapter = {
  9710. addClass: function addClass(className) {
  9711. return _this.root_.classList.add(className);
  9712. },
  9713. removeClass: function removeClass(className) {
  9714. return _this.root_.classList.remove(className);
  9715. },
  9716. hasClass: function hasClass(className) {
  9717. return _this.root_.classList.contains(className);
  9718. },
  9719. setAttr: function setAttr(attr, value) {
  9720. return _this.root_.setAttribute(attr, value);
  9721. },
  9722. removeAttr: function removeAttr(attr) {
  9723. return _this.root_.removeAttribute(attr);
  9724. },
  9725. setContent: function setContent(content) {
  9726. _this.root_.textContent = content;
  9727. }
  9728. };
  9729. return new foundation_1.MDCTextFieldHelperTextFoundation(adapter);
  9730. };
  9731. return MDCTextFieldHelperText;
  9732. }(component_1.MDCComponent);
  9733. exports.MDCTextFieldHelperText = MDCTextFieldHelperText;
  9734. }, function(module, exports, __webpack_require__) {
  9735. "use strict";
  9736. var __extends = this && this.__extends || function() {
  9737. var _extendStatics = function extendStatics(d, b) {
  9738. _extendStatics = Object.setPrototypeOf || {
  9739. __proto__: []
  9740. } instanceof Array && function(d, b) {
  9741. d.__proto__ = b;
  9742. } || function(d, b) {
  9743. for (var p in b) {
  9744. if (b.hasOwnProperty(p)) d[p] = b[p];
  9745. }
  9746. };
  9747. return _extendStatics(d, b);
  9748. };
  9749. return function(d, b) {
  9750. _extendStatics(d, b);
  9751. function __() {
  9752. this.constructor = d;
  9753. }
  9754. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  9755. };
  9756. }();
  9757. Object.defineProperty(exports, "__esModule", {
  9758. value: true
  9759. });
  9760. var component_1 = __webpack_require__(1);
  9761. var foundation_1 = __webpack_require__(74);
  9762. var MDCTextFieldIcon = function(_super) {
  9763. __extends(MDCTextFieldIcon, _super);
  9764. function MDCTextFieldIcon() {
  9765. return _super !== null && _super.apply(this, arguments) || this;
  9766. }
  9767. MDCTextFieldIcon.attachTo = function(root) {
  9768. return new MDCTextFieldIcon(root);
  9769. };
  9770. Object.defineProperty(MDCTextFieldIcon.prototype, "foundation", {
  9771. get: function get() {
  9772. return this.foundation_;
  9773. },
  9774. enumerable: true,
  9775. configurable: true
  9776. });
  9777. MDCTextFieldIcon.prototype.getDefaultFoundation = function() {
  9778. var _this = this;
  9779. var adapter = {
  9780. getAttr: function getAttr(attr) {
  9781. return _this.root_.getAttribute(attr);
  9782. },
  9783. setAttr: function setAttr(attr, value) {
  9784. return _this.root_.setAttribute(attr, value);
  9785. },
  9786. removeAttr: function removeAttr(attr) {
  9787. return _this.root_.removeAttribute(attr);
  9788. },
  9789. setContent: function setContent(content) {
  9790. _this.root_.textContent = content;
  9791. },
  9792. registerInteractionHandler: function registerInteractionHandler(evtType, handler) {
  9793. return _this.listen(evtType, handler);
  9794. },
  9795. deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) {
  9796. return _this.unlisten(evtType, handler);
  9797. },
  9798. notifyIconAction: function notifyIconAction() {
  9799. return _this.emit(foundation_1.MDCTextFieldIconFoundation.strings.ICON_EVENT, {}, true);
  9800. }
  9801. };
  9802. return new foundation_1.MDCTextFieldIconFoundation(adapter);
  9803. };
  9804. return MDCTextFieldIcon;
  9805. }(component_1.MDCComponent);
  9806. exports.MDCTextFieldIcon = MDCTextFieldIcon;
  9807. }, function(module, exports, __webpack_require__) {
  9808. "use strict";
  9809. var __extends = this && this.__extends || function() {
  9810. var _extendStatics = function extendStatics(d, b) {
  9811. _extendStatics = Object.setPrototypeOf || {
  9812. __proto__: []
  9813. } instanceof Array && function(d, b) {
  9814. d.__proto__ = b;
  9815. } || function(d, b) {
  9816. for (var p in b) {
  9817. if (b.hasOwnProperty(p)) d[p] = b[p];
  9818. }
  9819. };
  9820. return _extendStatics(d, b);
  9821. };
  9822. return function(d, b) {
  9823. _extendStatics(d, b);
  9824. function __() {
  9825. this.constructor = d;
  9826. }
  9827. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  9828. };
  9829. }();
  9830. var __assign = this && this.__assign || function() {
  9831. __assign = Object.assign || function(t) {
  9832. for (var s, i = 1, n = arguments.length; i < n; i++) {
  9833. s = arguments[i];
  9834. for (var p in s) {
  9835. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  9836. }
  9837. }
  9838. return t;
  9839. };
  9840. return __assign.apply(this, arguments);
  9841. };
  9842. Object.defineProperty(exports, "__esModule", {
  9843. value: true
  9844. });
  9845. var foundation_1 = __webpack_require__(0);
  9846. var constants_1 = __webpack_require__(154);
  9847. var INTERACTION_EVENTS = [ "click", "keydown" ];
  9848. var MDCTextFieldIconFoundation = function(_super) {
  9849. __extends(MDCTextFieldIconFoundation, _super);
  9850. function MDCTextFieldIconFoundation(adapter) {
  9851. var _this = _super.call(this, __assign({}, MDCTextFieldIconFoundation.defaultAdapter, adapter)) || this;
  9852. _this.savedTabIndex_ = null;
  9853. _this.interactionHandler_ = function(evt) {
  9854. return _this.handleInteraction(evt);
  9855. };
  9856. return _this;
  9857. }
  9858. Object.defineProperty(MDCTextFieldIconFoundation, "strings", {
  9859. get: function get() {
  9860. return constants_1.strings;
  9861. },
  9862. enumerable: true,
  9863. configurable: true
  9864. });
  9865. Object.defineProperty(MDCTextFieldIconFoundation, "cssClasses", {
  9866. get: function get() {
  9867. return constants_1.cssClasses;
  9868. },
  9869. enumerable: true,
  9870. configurable: true
  9871. });
  9872. Object.defineProperty(MDCTextFieldIconFoundation, "defaultAdapter", {
  9873. get: function get() {
  9874. return {
  9875. getAttr: function getAttr() {
  9876. return null;
  9877. },
  9878. setAttr: function setAttr() {
  9879. return undefined;
  9880. },
  9881. removeAttr: function removeAttr() {
  9882. return undefined;
  9883. },
  9884. setContent: function setContent() {
  9885. return undefined;
  9886. },
  9887. registerInteractionHandler: function registerInteractionHandler() {
  9888. return undefined;
  9889. },
  9890. deregisterInteractionHandler: function deregisterInteractionHandler() {
  9891. return undefined;
  9892. },
  9893. notifyIconAction: function notifyIconAction() {
  9894. return undefined;
  9895. }
  9896. };
  9897. },
  9898. enumerable: true,
  9899. configurable: true
  9900. });
  9901. MDCTextFieldIconFoundation.prototype.init = function() {
  9902. var _this = this;
  9903. this.savedTabIndex_ = this.adapter_.getAttr("tabindex");
  9904. INTERACTION_EVENTS.forEach(function(evtType) {
  9905. _this.adapter_.registerInteractionHandler(evtType, _this.interactionHandler_);
  9906. });
  9907. };
  9908. MDCTextFieldIconFoundation.prototype.destroy = function() {
  9909. var _this = this;
  9910. INTERACTION_EVENTS.forEach(function(evtType) {
  9911. _this.adapter_.deregisterInteractionHandler(evtType, _this.interactionHandler_);
  9912. });
  9913. };
  9914. MDCTextFieldIconFoundation.prototype.setDisabled = function(disabled) {
  9915. if (!this.savedTabIndex_) {
  9916. return;
  9917. }
  9918. if (disabled) {
  9919. this.adapter_.setAttr("tabindex", "-1");
  9920. this.adapter_.removeAttr("role");
  9921. } else {
  9922. this.adapter_.setAttr("tabindex", this.savedTabIndex_);
  9923. this.adapter_.setAttr("role", constants_1.strings.ICON_ROLE);
  9924. }
  9925. };
  9926. MDCTextFieldIconFoundation.prototype.setAriaLabel = function(label) {
  9927. this.adapter_.setAttr("aria-label", label);
  9928. };
  9929. MDCTextFieldIconFoundation.prototype.setContent = function(content) {
  9930. this.adapter_.setContent(content);
  9931. };
  9932. MDCTextFieldIconFoundation.prototype.handleInteraction = function(evt) {
  9933. var isEnterKey = evt.key === "Enter" || evt.keyCode === 13;
  9934. if (evt.type === "click" || isEnterKey) {
  9935. this.adapter_.notifyIconAction();
  9936. }
  9937. };
  9938. return MDCTextFieldIconFoundation;
  9939. }(foundation_1.MDCFoundation);
  9940. exports.MDCTextFieldIconFoundation = MDCTextFieldIconFoundation;
  9941. exports.default = MDCTextFieldIconFoundation;
  9942. }, function(module, exports, __webpack_require__) {
  9943. "use strict";
  9944. var __extends = this && this.__extends || function() {
  9945. var _extendStatics = function extendStatics(d, b) {
  9946. _extendStatics = Object.setPrototypeOf || {
  9947. __proto__: []
  9948. } instanceof Array && function(d, b) {
  9949. d.__proto__ = b;
  9950. } || function(d, b) {
  9951. for (var p in b) {
  9952. if (b.hasOwnProperty(p)) d[p] = b[p];
  9953. }
  9954. };
  9955. return _extendStatics(d, b);
  9956. };
  9957. return function(d, b) {
  9958. _extendStatics(d, b);
  9959. function __() {
  9960. this.constructor = d;
  9961. }
  9962. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  9963. };
  9964. }();
  9965. var __assign = this && this.__assign || function() {
  9966. __assign = Object.assign || function(t) {
  9967. for (var s, i = 1, n = arguments.length; i < n; i++) {
  9968. s = arguments[i];
  9969. for (var p in s) {
  9970. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  9971. }
  9972. }
  9973. return t;
  9974. };
  9975. return __assign.apply(this, arguments);
  9976. };
  9977. Object.defineProperty(exports, "__esModule", {
  9978. value: true
  9979. });
  9980. var foundation_1 = __webpack_require__(0);
  9981. var constants_1 = __webpack_require__(160);
  9982. var MDCToolbarFoundation = function(_super) {
  9983. __extends(MDCToolbarFoundation, _super);
  9984. function MDCToolbarFoundation(adapter) {
  9985. var _this = _super.call(this, __assign({}, MDCToolbarFoundation.defaultAdapter, adapter)) || this;
  9986. _this.checkRowHeightFrame_ = 0;
  9987. _this.scrollFrame_ = 0;
  9988. _this.executedLastChange_ = false;
  9989. _this.isFixed_ = false;
  9990. _this.isFixedLastRow_ = false;
  9991. _this.hasFlexibleFirstRow_ = false;
  9992. _this.useFlexDefaultBehavior_ = false;
  9993. _this.calculations_ = {
  9994. flexibleExpansionHeight: 0,
  9995. flexibleExpansionRatio: 0,
  9996. maxTranslateYDistance: 0,
  9997. maxTranslateYRatio: 0,
  9998. scrollThreshold: 0,
  9999. scrollThresholdRatio: 0,
  10000. toolbarHeight: 0,
  10001. toolbarRatio: 0,
  10002. toolbarRowHeight: 0
  10003. };
  10004. return _this;
  10005. }
  10006. Object.defineProperty(MDCToolbarFoundation, "cssClasses", {
  10007. get: function get() {
  10008. return constants_1.cssClasses;
  10009. },
  10010. enumerable: true,
  10011. configurable: true
  10012. });
  10013. Object.defineProperty(MDCToolbarFoundation, "strings", {
  10014. get: function get() {
  10015. return constants_1.strings;
  10016. },
  10017. enumerable: true,
  10018. configurable: true
  10019. });
  10020. Object.defineProperty(MDCToolbarFoundation, "numbers", {
  10021. get: function get() {
  10022. return constants_1.numbers;
  10023. },
  10024. enumerable: true,
  10025. configurable: true
  10026. });
  10027. Object.defineProperty(MDCToolbarFoundation, "defaultAdapter", {
  10028. get: function get() {
  10029. return {
  10030. hasClass: function hasClass() {
  10031. return false;
  10032. },
  10033. addClass: function addClass() {
  10034. return undefined;
  10035. },
  10036. removeClass: function removeClass() {
  10037. return undefined;
  10038. },
  10039. registerScrollHandler: function registerScrollHandler() {
  10040. return undefined;
  10041. },
  10042. deregisterScrollHandler: function deregisterScrollHandler() {
  10043. return undefined;
  10044. },
  10045. registerResizeHandler: function registerResizeHandler() {
  10046. return undefined;
  10047. },
  10048. deregisterResizeHandler: function deregisterResizeHandler() {
  10049. return undefined;
  10050. },
  10051. getViewportWidth: function getViewportWidth() {
  10052. return 0;
  10053. },
  10054. getViewportScrollY: function getViewportScrollY() {
  10055. return 0;
  10056. },
  10057. getOffsetHeight: function getOffsetHeight() {
  10058. return 0;
  10059. },
  10060. getFirstRowElementOffsetHeight: function getFirstRowElementOffsetHeight() {
  10061. return 0;
  10062. },
  10063. notifyChange: function notifyChange() {
  10064. return undefined;
  10065. },
  10066. setStyle: function setStyle() {
  10067. return undefined;
  10068. },
  10069. setStyleForTitleElement: function setStyleForTitleElement() {
  10070. return undefined;
  10071. },
  10072. setStyleForFlexibleRowElement: function setStyleForFlexibleRowElement() {
  10073. return undefined;
  10074. },
  10075. setStyleForFixedAdjustElement: function setStyleForFixedAdjustElement() {
  10076. return undefined;
  10077. }
  10078. };
  10079. },
  10080. enumerable: true,
  10081. configurable: true
  10082. });
  10083. MDCToolbarFoundation.prototype.init = function() {
  10084. var _this = this;
  10085. this.isFixed_ = this.adapter_.hasClass(constants_1.cssClasses.FIXED);
  10086. this.isFixedLastRow_ = this.adapter_.hasClass(constants_1.cssClasses.FIXED_LASTROW) && this.isFixed_;
  10087. this.hasFlexibleFirstRow_ = this.adapter_.hasClass(constants_1.cssClasses.TOOLBAR_ROW_FLEXIBLE);
  10088. if (this.hasFlexibleFirstRow_) {
  10089. this.useFlexDefaultBehavior_ = this.adapter_.hasClass(constants_1.cssClasses.FLEXIBLE_DEFAULT_BEHAVIOR);
  10090. }
  10091. this.resizeHandler_ = function() {
  10092. return _this.checkRowHeight_();
  10093. };
  10094. this.scrollHandler_ = function() {
  10095. return _this.updateToolbarStyles_();
  10096. };
  10097. this.adapter_.registerResizeHandler(this.resizeHandler_);
  10098. this.adapter_.registerScrollHandler(this.scrollHandler_);
  10099. this.initKeyRatio_();
  10100. this.setKeyHeights_();
  10101. };
  10102. MDCToolbarFoundation.prototype.destroy = function() {
  10103. this.adapter_.deregisterResizeHandler(this.resizeHandler_);
  10104. this.adapter_.deregisterScrollHandler(this.scrollHandler_);
  10105. };
  10106. MDCToolbarFoundation.prototype.updateAdjustElementStyles = function() {
  10107. if (this.isFixed_) {
  10108. this.adapter_.setStyleForFixedAdjustElement("margin-top", this.calculations_.toolbarHeight + "px");
  10109. }
  10110. };
  10111. MDCToolbarFoundation.prototype.getFlexibleExpansionRatio_ = function(scrollTop) {
  10112. var delta = 1e-4;
  10113. return Math.max(0, 1 - scrollTop / (this.calculations_.flexibleExpansionHeight + delta));
  10114. };
  10115. MDCToolbarFoundation.prototype.checkRowHeight_ = function() {
  10116. var _this = this;
  10117. cancelAnimationFrame(this.checkRowHeightFrame_);
  10118. this.checkRowHeightFrame_ = requestAnimationFrame(function() {
  10119. return _this.setKeyHeights_();
  10120. });
  10121. };
  10122. MDCToolbarFoundation.prototype.setKeyHeights_ = function() {
  10123. var newToolbarRowHeight = this.getRowHeight_();
  10124. if (newToolbarRowHeight !== this.calculations_.toolbarRowHeight) {
  10125. this.calculations_.toolbarRowHeight = newToolbarRowHeight;
  10126. this.calculations_.toolbarHeight = this.calculations_.toolbarRatio * this.calculations_.toolbarRowHeight;
  10127. this.calculations_.flexibleExpansionHeight = this.calculations_.flexibleExpansionRatio * this.calculations_.toolbarRowHeight;
  10128. this.calculations_.maxTranslateYDistance = this.calculations_.maxTranslateYRatio * this.calculations_.toolbarRowHeight;
  10129. this.calculations_.scrollThreshold = this.calculations_.scrollThresholdRatio * this.calculations_.toolbarRowHeight;
  10130. this.updateAdjustElementStyles();
  10131. this.updateToolbarStyles_();
  10132. }
  10133. };
  10134. MDCToolbarFoundation.prototype.updateToolbarStyles_ = function() {
  10135. var _this = this;
  10136. cancelAnimationFrame(this.scrollFrame_);
  10137. this.scrollFrame_ = requestAnimationFrame(function() {
  10138. var scrollTop = _this.adapter_.getViewportScrollY();
  10139. var hasScrolledOutOfThreshold = _this.scrolledOutOfThreshold_(scrollTop);
  10140. if (hasScrolledOutOfThreshold && _this.executedLastChange_) {
  10141. return;
  10142. }
  10143. var flexibleExpansionRatio = _this.getFlexibleExpansionRatio_(scrollTop);
  10144. _this.updateToolbarFlexibleState_(flexibleExpansionRatio);
  10145. if (_this.isFixedLastRow_) {
  10146. _this.updateToolbarFixedState_(scrollTop);
  10147. }
  10148. if (_this.hasFlexibleFirstRow_) {
  10149. _this.updateFlexibleRowElementStyles_(flexibleExpansionRatio);
  10150. }
  10151. _this.executedLastChange_ = hasScrolledOutOfThreshold;
  10152. _this.adapter_.notifyChange({
  10153. flexibleExpansionRatio: flexibleExpansionRatio
  10154. });
  10155. });
  10156. };
  10157. MDCToolbarFoundation.prototype.scrolledOutOfThreshold_ = function(scrollTop) {
  10158. return scrollTop > this.calculations_.scrollThreshold;
  10159. };
  10160. MDCToolbarFoundation.prototype.initKeyRatio_ = function() {
  10161. var toolbarRowHeight = this.getRowHeight_();
  10162. var firstRowMaxRatio = this.adapter_.getFirstRowElementOffsetHeight() / toolbarRowHeight;
  10163. this.calculations_.toolbarRatio = this.adapter_.getOffsetHeight() / toolbarRowHeight;
  10164. this.calculations_.flexibleExpansionRatio = firstRowMaxRatio - 1;
  10165. this.calculations_.maxTranslateYRatio = this.isFixedLastRow_ ? this.calculations_.toolbarRatio - firstRowMaxRatio : 0;
  10166. this.calculations_.scrollThresholdRatio = (this.isFixedLastRow_ ? this.calculations_.toolbarRatio : firstRowMaxRatio) - 1;
  10167. };
  10168. MDCToolbarFoundation.prototype.getRowHeight_ = function() {
  10169. var breakpoint = constants_1.numbers.TOOLBAR_MOBILE_BREAKPOINT;
  10170. return this.adapter_.getViewportWidth() < breakpoint ? constants_1.numbers.TOOLBAR_ROW_MOBILE_HEIGHT : constants_1.numbers.TOOLBAR_ROW_HEIGHT;
  10171. };
  10172. MDCToolbarFoundation.prototype.updateToolbarFlexibleState_ = function(flexibleExpansionRatio) {
  10173. this.adapter_.removeClass(constants_1.cssClasses.FLEXIBLE_MAX);
  10174. this.adapter_.removeClass(constants_1.cssClasses.FLEXIBLE_MIN);
  10175. if (flexibleExpansionRatio === 1) {
  10176. this.adapter_.addClass(constants_1.cssClasses.FLEXIBLE_MAX);
  10177. } else if (flexibleExpansionRatio === 0) {
  10178. this.adapter_.addClass(constants_1.cssClasses.FLEXIBLE_MIN);
  10179. }
  10180. };
  10181. MDCToolbarFoundation.prototype.updateToolbarFixedState_ = function(scrollTop) {
  10182. var translateDistance = Math.max(0, Math.min(scrollTop - this.calculations_.flexibleExpansionHeight, this.calculations_.maxTranslateYDistance));
  10183. this.adapter_.setStyle("transform", "translateY(" + -translateDistance + "px)");
  10184. if (translateDistance === this.calculations_.maxTranslateYDistance) {
  10185. this.adapter_.addClass(constants_1.cssClasses.FIXED_AT_LAST_ROW);
  10186. } else {
  10187. this.adapter_.removeClass(constants_1.cssClasses.FIXED_AT_LAST_ROW);
  10188. }
  10189. };
  10190. MDCToolbarFoundation.prototype.updateFlexibleRowElementStyles_ = function(flexibleExpansionRatio) {
  10191. if (this.isFixed_) {
  10192. var height = this.calculations_.flexibleExpansionHeight * flexibleExpansionRatio;
  10193. this.adapter_.setStyleForFlexibleRowElement("height", height + this.calculations_.toolbarRowHeight + "px");
  10194. }
  10195. if (this.useFlexDefaultBehavior_) {
  10196. this.updateElementStylesDefaultBehavior_(flexibleExpansionRatio);
  10197. }
  10198. };
  10199. MDCToolbarFoundation.prototype.updateElementStylesDefaultBehavior_ = function(flexibleExpansionRatio) {
  10200. var maxTitleSize = constants_1.numbers.MAX_TITLE_SIZE;
  10201. var minTitleSize = constants_1.numbers.MIN_TITLE_SIZE;
  10202. var currentTitleSize = (maxTitleSize - minTitleSize) * flexibleExpansionRatio + minTitleSize;
  10203. this.adapter_.setStyleForTitleElement("font-size", currentTitleSize + "rem");
  10204. };
  10205. return MDCToolbarFoundation;
  10206. }(foundation_1.MDCFoundation);
  10207. exports.MDCToolbarFoundation = MDCToolbarFoundation;
  10208. exports.default = MDCToolbarFoundation;
  10209. }, function(module, exports, __webpack_require__) {
  10210. "use strict";
  10211. var __extends = this && this.__extends || function() {
  10212. var _extendStatics = function extendStatics(d, b) {
  10213. _extendStatics = Object.setPrototypeOf || {
  10214. __proto__: []
  10215. } instanceof Array && function(d, b) {
  10216. d.__proto__ = b;
  10217. } || function(d, b) {
  10218. for (var p in b) {
  10219. if (b.hasOwnProperty(p)) d[p] = b[p];
  10220. }
  10221. };
  10222. return _extendStatics(d, b);
  10223. };
  10224. return function(d, b) {
  10225. _extendStatics(d, b);
  10226. function __() {
  10227. this.constructor = d;
  10228. }
  10229. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  10230. };
  10231. }();
  10232. Object.defineProperty(exports, "__esModule", {
  10233. value: true
  10234. });
  10235. var constants_1 = __webpack_require__(7);
  10236. var foundation_1 = __webpack_require__(25);
  10237. var MDCFixedTopAppBarFoundation = function(_super) {
  10238. __extends(MDCFixedTopAppBarFoundation, _super);
  10239. function MDCFixedTopAppBarFoundation(adapter) {
  10240. var _this = _super.call(this, adapter) || this;
  10241. _this.wasScrolled_ = false;
  10242. _this.scrollHandler_ = function() {
  10243. return _this.fixedScrollHandler_();
  10244. };
  10245. return _this;
  10246. }
  10247. MDCFixedTopAppBarFoundation.prototype.fixedScrollHandler_ = function() {
  10248. var currentScroll = this.adapter_.getViewportScrollY();
  10249. if (currentScroll <= 0) {
  10250. if (this.wasScrolled_) {
  10251. this.adapter_.removeClass(constants_1.cssClasses.FIXED_SCROLLED_CLASS);
  10252. this.wasScrolled_ = false;
  10253. }
  10254. } else {
  10255. if (!this.wasScrolled_) {
  10256. this.adapter_.addClass(constants_1.cssClasses.FIXED_SCROLLED_CLASS);
  10257. this.wasScrolled_ = true;
  10258. }
  10259. }
  10260. };
  10261. return MDCFixedTopAppBarFoundation;
  10262. }(foundation_1.MDCTopAppBarFoundation);
  10263. exports.MDCFixedTopAppBarFoundation = MDCFixedTopAppBarFoundation;
  10264. exports.default = MDCFixedTopAppBarFoundation;
  10265. }, function(module, exports, __webpack_require__) {
  10266. "use strict";
  10267. var __extends = this && this.__extends || function() {
  10268. var _extendStatics = function extendStatics(d, b) {
  10269. _extendStatics = Object.setPrototypeOf || {
  10270. __proto__: []
  10271. } instanceof Array && function(d, b) {
  10272. d.__proto__ = b;
  10273. } || function(d, b) {
  10274. for (var p in b) {
  10275. if (b.hasOwnProperty(p)) d[p] = b[p];
  10276. }
  10277. };
  10278. return _extendStatics(d, b);
  10279. };
  10280. return function(d, b) {
  10281. _extendStatics(d, b);
  10282. function __() {
  10283. this.constructor = d;
  10284. }
  10285. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  10286. };
  10287. }();
  10288. Object.defineProperty(exports, "__esModule", {
  10289. value: true
  10290. });
  10291. var constants_1 = __webpack_require__(7);
  10292. var foundation_1 = __webpack_require__(26);
  10293. var MDCShortTopAppBarFoundation = function(_super) {
  10294. __extends(MDCShortTopAppBarFoundation, _super);
  10295. function MDCShortTopAppBarFoundation(adapter) {
  10296. var _this = _super.call(this, adapter) || this;
  10297. _this.isCollapsed_ = false;
  10298. return _this;
  10299. }
  10300. Object.defineProperty(MDCShortTopAppBarFoundation.prototype, "isCollapsed", {
  10301. get: function get() {
  10302. return this.isCollapsed_;
  10303. },
  10304. enumerable: true,
  10305. configurable: true
  10306. });
  10307. MDCShortTopAppBarFoundation.prototype.init = function() {
  10308. var _this = this;
  10309. _super.prototype.init.call(this);
  10310. if (this.adapter_.getTotalActionItems() > 0) {
  10311. this.adapter_.addClass(constants_1.cssClasses.SHORT_HAS_ACTION_ITEM_CLASS);
  10312. }
  10313. if (!this.adapter_.hasClass(constants_1.cssClasses.SHORT_COLLAPSED_CLASS)) {
  10314. this.scrollHandler_ = function() {
  10315. return _this.shortAppBarScrollHandler_();
  10316. };
  10317. this.adapter_.registerScrollHandler(this.scrollHandler_);
  10318. this.shortAppBarScrollHandler_();
  10319. }
  10320. };
  10321. MDCShortTopAppBarFoundation.prototype.destroy = function() {
  10322. _super.prototype.destroy.call(this);
  10323. };
  10324. MDCShortTopAppBarFoundation.prototype.shortAppBarScrollHandler_ = function() {
  10325. var currentScroll = this.adapter_.getViewportScrollY();
  10326. if (currentScroll <= 0) {
  10327. if (this.isCollapsed_) {
  10328. this.adapter_.removeClass(constants_1.cssClasses.SHORT_COLLAPSED_CLASS);
  10329. this.isCollapsed_ = false;
  10330. }
  10331. } else {
  10332. if (!this.isCollapsed_) {
  10333. this.adapter_.addClass(constants_1.cssClasses.SHORT_COLLAPSED_CLASS);
  10334. this.isCollapsed_ = true;
  10335. }
  10336. }
  10337. };
  10338. return MDCShortTopAppBarFoundation;
  10339. }(foundation_1.MDCTopAppBarBaseFoundation);
  10340. exports.MDCShortTopAppBarFoundation = MDCShortTopAppBarFoundation;
  10341. exports.default = MDCShortTopAppBarFoundation;
  10342. }, function(module, exports, __webpack_require__) {
  10343. "use strict";
  10344. var __importDefault = this && this.__importDefault || function(mod) {
  10345. return mod && mod.__esModule ? mod : {
  10346. default: mod
  10347. };
  10348. };
  10349. var __importStar = this && this.__importStar || function(mod) {
  10350. if (mod && mod.__esModule) return mod;
  10351. var result = {};
  10352. if (mod != null) for (var k in mod) {
  10353. if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  10354. }
  10355. result["default"] = mod;
  10356. return result;
  10357. };
  10358. Object.defineProperty(exports, "__esModule", {
  10359. value: true
  10360. });
  10361. var index_1 = __importDefault(__webpack_require__(79));
  10362. exports.autoInit = index_1.default;
  10363. var base = __importStar(__webpack_require__(80));
  10364. exports.base = base;
  10365. var checkbox = __importStar(__webpack_require__(81));
  10366. exports.checkbox = checkbox;
  10367. var chips = __importStar(__webpack_require__(85));
  10368. exports.chips = chips;
  10369. var dialog = __importStar(__webpack_require__(90));
  10370. exports.dialog = dialog;
  10371. var dom = __importStar(__webpack_require__(96));
  10372. exports.dom = dom;
  10373. var drawer = __importStar(__webpack_require__(97));
  10374. exports.drawer = drawer;
  10375. var floatingLabel = __importStar(__webpack_require__(102));
  10376. exports.floatingLabel = floatingLabel;
  10377. var formField = __importStar(__webpack_require__(104));
  10378. exports.formField = formField;
  10379. var gridList = __importStar(__webpack_require__(107));
  10380. exports.gridList = gridList;
  10381. var iconButton = __importStar(__webpack_require__(110));
  10382. exports.iconButton = iconButton;
  10383. var lineRipple = __importStar(__webpack_require__(113));
  10384. exports.lineRipple = lineRipple;
  10385. var linearProgress = __importStar(__webpack_require__(115));
  10386. exports.linearProgress = linearProgress;
  10387. var list = __importStar(__webpack_require__(118));
  10388. exports.list = list;
  10389. var menuSurface = __importStar(__webpack_require__(119));
  10390. exports.menuSurface = menuSurface;
  10391. var menu = __importStar(__webpack_require__(120));
  10392. exports.menu = menu;
  10393. var notchedOutline = __importStar(__webpack_require__(121));
  10394. exports.notchedOutline = notchedOutline;
  10395. var radio = __importStar(__webpack_require__(122));
  10396. exports.radio = radio;
  10397. var ripple = __importStar(__webpack_require__(125));
  10398. exports.ripple = ripple;
  10399. var select = __importStar(__webpack_require__(126));
  10400. exports.select = select;
  10401. var slider = __importStar(__webpack_require__(132));
  10402. exports.slider = slider;
  10403. var snackbar = __importStar(__webpack_require__(134));
  10404. exports.snackbar = snackbar;
  10405. var switchControl = __importStar(__webpack_require__(136));
  10406. exports.switchControl = switchControl;
  10407. var tabBar = __importStar(__webpack_require__(139));
  10408. exports.tabBar = tabBar;
  10409. var tabIndicator = __importStar(__webpack_require__(147));
  10410. exports.tabIndicator = tabIndicator;
  10411. var tabScroller = __importStar(__webpack_require__(148));
  10412. exports.tabScroller = tabScroller;
  10413. var tab = __importStar(__webpack_require__(149));
  10414. exports.tab = tab;
  10415. var textField = __importStar(__webpack_require__(150));
  10416. exports.textField = textField;
  10417. var toolbar = __importStar(__webpack_require__(158));
  10418. exports.toolbar = toolbar;
  10419. var topAppBar = __importStar(__webpack_require__(161));
  10420. exports.topAppBar = topAppBar;
  10421. index_1.default.register("MDCCheckbox", checkbox.MDCCheckbox);
  10422. index_1.default.register("MDCChip", chips.MDCChip);
  10423. index_1.default.register("MDCChipSet", chips.MDCChipSet);
  10424. index_1.default.register("MDCDialog", dialog.MDCDialog);
  10425. index_1.default.register("MDCDrawer", drawer.MDCDrawer);
  10426. index_1.default.register("MDCFloatingLabel", floatingLabel.MDCFloatingLabel);
  10427. index_1.default.register("MDCFormField", formField.MDCFormField);
  10428. index_1.default.register("MDCGridList", gridList.MDCGridList);
  10429. index_1.default.register("MDCIconButtonToggle", iconButton.MDCIconButtonToggle);
  10430. index_1.default.register("MDCLineRipple", lineRipple.MDCLineRipple);
  10431. index_1.default.register("MDCLinearProgress", linearProgress.MDCLinearProgress);
  10432. index_1.default.register("MDCList", list.MDCList);
  10433. index_1.default.register("MDCMenu", menu.MDCMenu);
  10434. index_1.default.register("MDCMenuSurface", menuSurface.MDCMenuSurface);
  10435. index_1.default.register("MDCNotchedOutline", notchedOutline.MDCNotchedOutline);
  10436. index_1.default.register("MDCRadio", radio.MDCRadio);
  10437. index_1.default.register("MDCRipple", ripple.MDCRipple);
  10438. index_1.default.register("MDCSelect", select.MDCSelect);
  10439. index_1.default.register("MDCSlider", slider.MDCSlider);
  10440. index_1.default.register("MDCSnackbar", snackbar.MDCSnackbar);
  10441. index_1.default.register("MDCSwitch", switchControl.MDCSwitch);
  10442. index_1.default.register("MDCTabBar", tabBar.MDCTabBar);
  10443. index_1.default.register("MDCTextField", textField.MDCTextField);
  10444. index_1.default.register("MDCToolbar", toolbar.MDCToolbar);
  10445. index_1.default.register("MDCTopAppBar", topAppBar.MDCTopAppBar);
  10446. }, function(module, exports, __webpack_require__) {
  10447. "use strict";
  10448. var __values = this && this.__values || function(o) {
  10449. var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
  10450. if (m) return m.call(o);
  10451. return {
  10452. next: function next() {
  10453. if (o && i >= o.length) o = void 0;
  10454. return {
  10455. value: o && o[i++],
  10456. done: !o
  10457. };
  10458. }
  10459. };
  10460. };
  10461. Object.defineProperty(exports, "__esModule", {
  10462. value: true
  10463. });
  10464. var registry = {};
  10465. var CONSOLE_WARN = console.warn.bind(console);
  10466. function emit(evtType, evtData, shouldBubble) {
  10467. if (shouldBubble === void 0) {
  10468. shouldBubble = false;
  10469. }
  10470. var evt;
  10471. if (typeof CustomEvent === "function") {
  10472. evt = new CustomEvent(evtType, {
  10473. bubbles: shouldBubble,
  10474. detail: evtData
  10475. });
  10476. } else {
  10477. evt = document.createEvent("CustomEvent");
  10478. evt.initCustomEvent(evtType, shouldBubble, false, evtData);
  10479. }
  10480. document.dispatchEvent(evt);
  10481. }
  10482. function mdcAutoInit(root, warn) {
  10483. if (root === void 0) {
  10484. root = document;
  10485. }
  10486. if (warn === void 0) {
  10487. warn = CONSOLE_WARN;
  10488. }
  10489. var e_1, _a;
  10490. var components = [];
  10491. var nodes = [].slice.call(root.querySelectorAll("[data-mdc-auto-init]"));
  10492. try {
  10493. for (var nodes_1 = __values(nodes), nodes_1_1 = nodes_1.next(); !nodes_1_1.done; nodes_1_1 = nodes_1.next()) {
  10494. var node = nodes_1_1.value;
  10495. var ctorName = node.getAttribute("data-mdc-auto-init");
  10496. if (!ctorName) {
  10497. throw new Error("(mdc-auto-init) Constructor name must be given.");
  10498. }
  10499. var Constructor = registry[ctorName];
  10500. if (typeof Constructor !== "function") {
  10501. throw new Error("(mdc-auto-init) Could not find constructor in registry for " + ctorName);
  10502. }
  10503. if (Object.getOwnPropertyDescriptor(node, ctorName)) {
  10504. warn("(mdc-auto-init) Component already initialized for " + node + ". Skipping...");
  10505. continue;
  10506. }
  10507. var component = Constructor.attachTo(node);
  10508. Object.defineProperty(node, ctorName, {
  10509. configurable: true,
  10510. enumerable: false,
  10511. value: component,
  10512. writable: false
  10513. });
  10514. components.push(component);
  10515. }
  10516. } catch (e_1_1) {
  10517. e_1 = {
  10518. error: e_1_1
  10519. };
  10520. } finally {
  10521. try {
  10522. if (nodes_1_1 && !nodes_1_1.done && (_a = nodes_1.return)) _a.call(nodes_1);
  10523. } finally {
  10524. if (e_1) throw e_1.error;
  10525. }
  10526. }
  10527. emit("MDCAutoInit:End", {});
  10528. return components;
  10529. }
  10530. exports.mdcAutoInit = mdcAutoInit;
  10531. mdcAutoInit.register = function(componentName, Constructor, warn) {
  10532. if (warn === void 0) {
  10533. warn = CONSOLE_WARN;
  10534. }
  10535. if (typeof Constructor !== "function") {
  10536. throw new Error("(mdc-auto-init) Invalid Constructor value: " + Constructor + ". Expected function.");
  10537. }
  10538. var registryValue = registry[componentName];
  10539. if (registryValue) {
  10540. warn("(mdc-auto-init) Overriding registration for " + componentName + " with " + Constructor + ". Was: " + registryValue);
  10541. }
  10542. registry[componentName] = Constructor;
  10543. };
  10544. mdcAutoInit.deregister = function(componentName) {
  10545. delete registry[componentName];
  10546. };
  10547. mdcAutoInit.deregisterAll = function() {
  10548. var keys = Object.keys(registry);
  10549. keys.forEach(this.deregister, this);
  10550. };
  10551. exports.default = mdcAutoInit;
  10552. }, function(module, exports, __webpack_require__) {
  10553. "use strict";
  10554. function __export(m) {
  10555. for (var p in m) {
  10556. if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  10557. }
  10558. }
  10559. Object.defineProperty(exports, "__esModule", {
  10560. value: true
  10561. });
  10562. __export(__webpack_require__(1));
  10563. __export(__webpack_require__(0));
  10564. }, function(module, exports, __webpack_require__) {
  10565. "use strict";
  10566. function __export(m) {
  10567. for (var p in m) {
  10568. if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  10569. }
  10570. }
  10571. Object.defineProperty(exports, "__esModule", {
  10572. value: true
  10573. });
  10574. __export(__webpack_require__(82));
  10575. __export(__webpack_require__(27));
  10576. }, function(module, exports, __webpack_require__) {
  10577. "use strict";
  10578. var __extends = this && this.__extends || function() {
  10579. var _extendStatics = function extendStatics(d, b) {
  10580. _extendStatics = Object.setPrototypeOf || {
  10581. __proto__: []
  10582. } instanceof Array && function(d, b) {
  10583. d.__proto__ = b;
  10584. } || function(d, b) {
  10585. for (var p in b) {
  10586. if (b.hasOwnProperty(p)) d[p] = b[p];
  10587. }
  10588. };
  10589. return _extendStatics(d, b);
  10590. };
  10591. return function(d, b) {
  10592. _extendStatics(d, b);
  10593. function __() {
  10594. this.constructor = d;
  10595. }
  10596. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  10597. };
  10598. }();
  10599. var __assign = this && this.__assign || function() {
  10600. __assign = Object.assign || function(t) {
  10601. for (var s, i = 1, n = arguments.length; i < n; i++) {
  10602. s = arguments[i];
  10603. for (var p in s) {
  10604. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  10605. }
  10606. }
  10607. return t;
  10608. };
  10609. return __assign.apply(this, arguments);
  10610. };
  10611. Object.defineProperty(exports, "__esModule", {
  10612. value: true
  10613. });
  10614. var util_1 = __webpack_require__(10);
  10615. var component_1 = __webpack_require__(1);
  10616. var ponyfill_1 = __webpack_require__(3);
  10617. var component_2 = __webpack_require__(2);
  10618. var foundation_1 = __webpack_require__(4);
  10619. var foundation_2 = __webpack_require__(27);
  10620. var CB_PROTO_PROPS = [ "checked", "indeterminate" ];
  10621. var MDCCheckbox = function(_super) {
  10622. __extends(MDCCheckbox, _super);
  10623. function MDCCheckbox() {
  10624. var _this = _super !== null && _super.apply(this, arguments) || this;
  10625. _this.ripple_ = _this.createRipple_();
  10626. return _this;
  10627. }
  10628. MDCCheckbox.attachTo = function(root) {
  10629. return new MDCCheckbox(root);
  10630. };
  10631. Object.defineProperty(MDCCheckbox.prototype, "ripple", {
  10632. get: function get() {
  10633. return this.ripple_;
  10634. },
  10635. enumerable: true,
  10636. configurable: true
  10637. });
  10638. Object.defineProperty(MDCCheckbox.prototype, "checked", {
  10639. get: function get() {
  10640. return this.nativeControl_.checked;
  10641. },
  10642. set: function set(checked) {
  10643. this.nativeControl_.checked = checked;
  10644. },
  10645. enumerable: true,
  10646. configurable: true
  10647. });
  10648. Object.defineProperty(MDCCheckbox.prototype, "indeterminate", {
  10649. get: function get() {
  10650. return this.nativeControl_.indeterminate;
  10651. },
  10652. set: function set(indeterminate) {
  10653. this.nativeControl_.indeterminate = indeterminate;
  10654. },
  10655. enumerable: true,
  10656. configurable: true
  10657. });
  10658. Object.defineProperty(MDCCheckbox.prototype, "disabled", {
  10659. get: function get() {
  10660. return this.nativeControl_.disabled;
  10661. },
  10662. set: function set(disabled) {
  10663. this.foundation_.setDisabled(disabled);
  10664. },
  10665. enumerable: true,
  10666. configurable: true
  10667. });
  10668. Object.defineProperty(MDCCheckbox.prototype, "value", {
  10669. get: function get() {
  10670. return this.nativeControl_.value;
  10671. },
  10672. set: function set(value) {
  10673. this.nativeControl_.value = value;
  10674. },
  10675. enumerable: true,
  10676. configurable: true
  10677. });
  10678. MDCCheckbox.prototype.initialSyncWithDOM = function() {
  10679. var _this = this;
  10680. this.handleChange_ = function() {
  10681. return _this.foundation_.handleChange();
  10682. };
  10683. this.handleAnimationEnd_ = function() {
  10684. return _this.foundation_.handleAnimationEnd();
  10685. };
  10686. this.nativeControl_.addEventListener("change", this.handleChange_);
  10687. this.listen(util_1.getCorrectEventName(window, "animationend"), this.handleAnimationEnd_);
  10688. this.installPropertyChangeHooks_();
  10689. };
  10690. MDCCheckbox.prototype.destroy = function() {
  10691. this.ripple_.destroy();
  10692. this.nativeControl_.removeEventListener("change", this.handleChange_);
  10693. this.unlisten(util_1.getCorrectEventName(window, "animationend"), this.handleAnimationEnd_);
  10694. this.uninstallPropertyChangeHooks_();
  10695. _super.prototype.destroy.call(this);
  10696. };
  10697. MDCCheckbox.prototype.getDefaultFoundation = function() {
  10698. var _this = this;
  10699. var adapter = {
  10700. addClass: function addClass(className) {
  10701. return _this.root_.classList.add(className);
  10702. },
  10703. forceLayout: function forceLayout() {
  10704. return _this.root_.offsetWidth;
  10705. },
  10706. hasNativeControl: function hasNativeControl() {
  10707. return !!_this.nativeControl_;
  10708. },
  10709. isAttachedToDOM: function isAttachedToDOM() {
  10710. return Boolean(_this.root_.parentNode);
  10711. },
  10712. isChecked: function isChecked() {
  10713. return _this.checked;
  10714. },
  10715. isIndeterminate: function isIndeterminate() {
  10716. return _this.indeterminate;
  10717. },
  10718. removeClass: function removeClass(className) {
  10719. return _this.root_.classList.remove(className);
  10720. },
  10721. removeNativeControlAttr: function removeNativeControlAttr(attr) {
  10722. return _this.nativeControl_.removeAttribute(attr);
  10723. },
  10724. setNativeControlAttr: function setNativeControlAttr(attr, value) {
  10725. return _this.nativeControl_.setAttribute(attr, value);
  10726. },
  10727. setNativeControlDisabled: function setNativeControlDisabled(disabled) {
  10728. return _this.nativeControl_.disabled = disabled;
  10729. }
  10730. };
  10731. return new foundation_2.MDCCheckboxFoundation(adapter);
  10732. };
  10733. MDCCheckbox.prototype.createRipple_ = function() {
  10734. var _this = this;
  10735. var adapter = __assign({}, component_2.MDCRipple.createAdapter(this), {
  10736. deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) {
  10737. return _this.nativeControl_.removeEventListener(evtType, handler);
  10738. },
  10739. isSurfaceActive: function isSurfaceActive() {
  10740. return ponyfill_1.matches(_this.nativeControl_, ":active");
  10741. },
  10742. isUnbounded: function isUnbounded() {
  10743. return true;
  10744. },
  10745. registerInteractionHandler: function registerInteractionHandler(evtType, handler) {
  10746. return _this.nativeControl_.addEventListener(evtType, handler);
  10747. }
  10748. });
  10749. return new component_2.MDCRipple(this.root_, new foundation_1.MDCRippleFoundation(adapter));
  10750. };
  10751. MDCCheckbox.prototype.installPropertyChangeHooks_ = function() {
  10752. var _this = this;
  10753. var nativeCb = this.nativeControl_;
  10754. var cbProto = Object.getPrototypeOf(nativeCb);
  10755. CB_PROTO_PROPS.forEach(function(controlState) {
  10756. var desc = Object.getOwnPropertyDescriptor(cbProto, controlState);
  10757. if (!validDescriptor(desc)) {
  10758. return;
  10759. }
  10760. var nativeGetter = desc.get;
  10761. var nativeCbDesc = {
  10762. configurable: desc.configurable,
  10763. enumerable: desc.enumerable,
  10764. get: nativeGetter,
  10765. set: function set(state) {
  10766. desc.set.call(nativeCb, state);
  10767. _this.foundation_.handleChange();
  10768. }
  10769. };
  10770. Object.defineProperty(nativeCb, controlState, nativeCbDesc);
  10771. });
  10772. };
  10773. MDCCheckbox.prototype.uninstallPropertyChangeHooks_ = function() {
  10774. var nativeCb = this.nativeControl_;
  10775. var cbProto = Object.getPrototypeOf(nativeCb);
  10776. CB_PROTO_PROPS.forEach(function(controlState) {
  10777. var desc = Object.getOwnPropertyDescriptor(cbProto, controlState);
  10778. if (!validDescriptor(desc)) {
  10779. return;
  10780. }
  10781. Object.defineProperty(nativeCb, controlState, desc);
  10782. });
  10783. };
  10784. Object.defineProperty(MDCCheckbox.prototype, "nativeControl_", {
  10785. get: function get() {
  10786. var NATIVE_CONTROL_SELECTOR = foundation_2.MDCCheckboxFoundation.strings.NATIVE_CONTROL_SELECTOR;
  10787. var el = this.root_.querySelector(NATIVE_CONTROL_SELECTOR);
  10788. if (!el) {
  10789. throw new Error("Checkbox component requires a " + NATIVE_CONTROL_SELECTOR + " element");
  10790. }
  10791. return el;
  10792. },
  10793. enumerable: true,
  10794. configurable: true
  10795. });
  10796. return MDCCheckbox;
  10797. }(component_1.MDCComponent);
  10798. exports.MDCCheckbox = MDCCheckbox;
  10799. function validDescriptor(inputPropDesc) {
  10800. return !!inputPropDesc && typeof inputPropDesc.set === "function";
  10801. }
  10802. }, function(module, exports, __webpack_require__) {
  10803. "use strict";
  10804. Object.defineProperty(exports, "__esModule", {
  10805. value: true
  10806. });
  10807. exports.cssClasses = {
  10808. BG_FOCUSED: "mdc-ripple-upgraded--background-focused",
  10809. FG_ACTIVATION: "mdc-ripple-upgraded--foreground-activation",
  10810. FG_DEACTIVATION: "mdc-ripple-upgraded--foreground-deactivation",
  10811. ROOT: "mdc-ripple-upgraded",
  10812. UNBOUNDED: "mdc-ripple-upgraded--unbounded"
  10813. };
  10814. exports.strings = {
  10815. VAR_FG_SCALE: "--mdc-ripple-fg-scale",
  10816. VAR_FG_SIZE: "--mdc-ripple-fg-size",
  10817. VAR_FG_TRANSLATE_END: "--mdc-ripple-fg-translate-end",
  10818. VAR_FG_TRANSLATE_START: "--mdc-ripple-fg-translate-start",
  10819. VAR_LEFT: "--mdc-ripple-left",
  10820. VAR_TOP: "--mdc-ripple-top"
  10821. };
  10822. exports.numbers = {
  10823. DEACTIVATION_TIMEOUT_MS: 225,
  10824. FG_DEACTIVATION_MS: 150,
  10825. INITIAL_ORIGIN_SCALE: .6,
  10826. PADDING: 10,
  10827. TAP_DELAY_MS: 300
  10828. };
  10829. }, function(module, exports, __webpack_require__) {
  10830. "use strict";
  10831. Object.defineProperty(exports, "__esModule", {
  10832. value: true
  10833. });
  10834. exports.cssClasses = {
  10835. ANIM_CHECKED_INDETERMINATE: "mdc-checkbox--anim-checked-indeterminate",
  10836. ANIM_CHECKED_UNCHECKED: "mdc-checkbox--anim-checked-unchecked",
  10837. ANIM_INDETERMINATE_CHECKED: "mdc-checkbox--anim-indeterminate-checked",
  10838. ANIM_INDETERMINATE_UNCHECKED: "mdc-checkbox--anim-indeterminate-unchecked",
  10839. ANIM_UNCHECKED_CHECKED: "mdc-checkbox--anim-unchecked-checked",
  10840. ANIM_UNCHECKED_INDETERMINATE: "mdc-checkbox--anim-unchecked-indeterminate",
  10841. BACKGROUND: "mdc-checkbox__background",
  10842. CHECKED: "mdc-checkbox--checked",
  10843. CHECKMARK: "mdc-checkbox__checkmark",
  10844. CHECKMARK_PATH: "mdc-checkbox__checkmark-path",
  10845. DISABLED: "mdc-checkbox--disabled",
  10846. INDETERMINATE: "mdc-checkbox--indeterminate",
  10847. MIXEDMARK: "mdc-checkbox__mixedmark",
  10848. NATIVE_CONTROL: "mdc-checkbox__native-control",
  10849. ROOT: "mdc-checkbox",
  10850. SELECTED: "mdc-checkbox--selected",
  10851. UPGRADED: "mdc-checkbox--upgraded"
  10852. };
  10853. exports.strings = {
  10854. ARIA_CHECKED_ATTR: "aria-checked",
  10855. ARIA_CHECKED_INDETERMINATE_VALUE: "mixed",
  10856. NATIVE_CONTROL_SELECTOR: ".mdc-checkbox__native-control",
  10857. TRANSITION_STATE_CHECKED: "checked",
  10858. TRANSITION_STATE_INDETERMINATE: "indeterminate",
  10859. TRANSITION_STATE_INIT: "init",
  10860. TRANSITION_STATE_UNCHECKED: "unchecked"
  10861. };
  10862. exports.numbers = {
  10863. ANIM_END_LATCH_MS: 250
  10864. };
  10865. }, function(module, exports, __webpack_require__) {
  10866. "use strict";
  10867. function __export(m) {
  10868. for (var p in m) {
  10869. if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  10870. }
  10871. }
  10872. Object.defineProperty(exports, "__esModule", {
  10873. value: true
  10874. });
  10875. __export(__webpack_require__(86));
  10876. __export(__webpack_require__(87));
  10877. }, function(module, exports, __webpack_require__) {
  10878. "use strict";
  10879. function __export(m) {
  10880. for (var p in m) {
  10881. if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  10882. }
  10883. }
  10884. Object.defineProperty(exports, "__esModule", {
  10885. value: true
  10886. });
  10887. __export(__webpack_require__(28));
  10888. __export(__webpack_require__(12));
  10889. }, function(module, exports, __webpack_require__) {
  10890. "use strict";
  10891. function __export(m) {
  10892. for (var p in m) {
  10893. if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  10894. }
  10895. }
  10896. Object.defineProperty(exports, "__esModule", {
  10897. value: true
  10898. });
  10899. __export(__webpack_require__(88));
  10900. __export(__webpack_require__(30));
  10901. }, function(module, exports, __webpack_require__) {
  10902. "use strict";
  10903. var __extends = this && this.__extends || function() {
  10904. var _extendStatics = function extendStatics(d, b) {
  10905. _extendStatics = Object.setPrototypeOf || {
  10906. __proto__: []
  10907. } instanceof Array && function(d, b) {
  10908. d.__proto__ = b;
  10909. } || function(d, b) {
  10910. for (var p in b) {
  10911. if (b.hasOwnProperty(p)) d[p] = b[p];
  10912. }
  10913. };
  10914. return _extendStatics(d, b);
  10915. };
  10916. return function(d, b) {
  10917. _extendStatics(d, b);
  10918. function __() {
  10919. this.constructor = d;
  10920. }
  10921. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  10922. };
  10923. }();
  10924. Object.defineProperty(exports, "__esModule", {
  10925. value: true
  10926. });
  10927. var component_1 = __webpack_require__(1);
  10928. var component_2 = __webpack_require__(28);
  10929. var foundation_1 = __webpack_require__(12);
  10930. var foundation_2 = __webpack_require__(30);
  10931. var _a = foundation_1.MDCChipFoundation.strings, INTERACTION_EVENT = _a.INTERACTION_EVENT, SELECTION_EVENT = _a.SELECTION_EVENT, REMOVAL_EVENT = _a.REMOVAL_EVENT;
  10932. var CHIP_SELECTOR = foundation_2.MDCChipSetFoundation.strings.CHIP_SELECTOR;
  10933. var idCounter = 0;
  10934. var MDCChipSet = function(_super) {
  10935. __extends(MDCChipSet, _super);
  10936. function MDCChipSet() {
  10937. return _super !== null && _super.apply(this, arguments) || this;
  10938. }
  10939. MDCChipSet.attachTo = function(root) {
  10940. return new MDCChipSet(root);
  10941. };
  10942. Object.defineProperty(MDCChipSet.prototype, "chips", {
  10943. get: function get() {
  10944. return this.chips_.slice();
  10945. },
  10946. enumerable: true,
  10947. configurable: true
  10948. });
  10949. Object.defineProperty(MDCChipSet.prototype, "selectedChipIds", {
  10950. get: function get() {
  10951. return this.foundation_.getSelectedChipIds();
  10952. },
  10953. enumerable: true,
  10954. configurable: true
  10955. });
  10956. MDCChipSet.prototype.initialize = function(chipFactory) {
  10957. if (chipFactory === void 0) {
  10958. chipFactory = function chipFactory(el) {
  10959. return new component_2.MDCChip(el);
  10960. };
  10961. }
  10962. this.chipFactory_ = chipFactory;
  10963. this.chips_ = this.instantiateChips_(this.chipFactory_);
  10964. };
  10965. MDCChipSet.prototype.initialSyncWithDOM = function() {
  10966. var _this = this;
  10967. this.chips_.forEach(function(chip) {
  10968. if (chip.id && chip.selected) {
  10969. _this.foundation_.select(chip.id);
  10970. }
  10971. });
  10972. this.handleChipInteraction_ = function(evt) {
  10973. return _this.foundation_.handleChipInteraction(evt.detail.chipId);
  10974. };
  10975. this.handleChipSelection_ = function(evt) {
  10976. return _this.foundation_.handleChipSelection(evt.detail.chipId, evt.detail.selected);
  10977. };
  10978. this.handleChipRemoval_ = function(evt) {
  10979. return _this.foundation_.handleChipRemoval(evt.detail.chipId);
  10980. };
  10981. this.listen(INTERACTION_EVENT, this.handleChipInteraction_);
  10982. this.listen(SELECTION_EVENT, this.handleChipSelection_);
  10983. this.listen(REMOVAL_EVENT, this.handleChipRemoval_);
  10984. };
  10985. MDCChipSet.prototype.destroy = function() {
  10986. this.chips_.forEach(function(chip) {
  10987. chip.destroy();
  10988. });
  10989. this.unlisten(INTERACTION_EVENT, this.handleChipInteraction_);
  10990. this.unlisten(SELECTION_EVENT, this.handleChipSelection_);
  10991. this.unlisten(REMOVAL_EVENT, this.handleChipRemoval_);
  10992. _super.prototype.destroy.call(this);
  10993. };
  10994. MDCChipSet.prototype.addChip = function(chipEl) {
  10995. chipEl.id = chipEl.id || "mdc-chip-" + ++idCounter;
  10996. this.chips_.push(this.chipFactory_(chipEl));
  10997. };
  10998. MDCChipSet.prototype.getDefaultFoundation = function() {
  10999. var _this = this;
  11000. var adapter = {
  11001. hasClass: function hasClass(className) {
  11002. return _this.root_.classList.contains(className);
  11003. },
  11004. removeChip: function removeChip(chipId) {
  11005. var index = _this.findChipIndex_(chipId);
  11006. if (index >= 0) {
  11007. _this.chips_[index].destroy();
  11008. _this.chips_.splice(index, 1);
  11009. }
  11010. },
  11011. setSelected: function setSelected(chipId, selected) {
  11012. var index = _this.findChipIndex_(chipId);
  11013. if (index >= 0) {
  11014. _this.chips_[index].selected = selected;
  11015. }
  11016. }
  11017. };
  11018. return new foundation_2.MDCChipSetFoundation(adapter);
  11019. };
  11020. MDCChipSet.prototype.instantiateChips_ = function(chipFactory) {
  11021. var chipElements = [].slice.call(this.root_.querySelectorAll(CHIP_SELECTOR));
  11022. return chipElements.map(function(el) {
  11023. el.id = el.id || "mdc-chip-" + ++idCounter;
  11024. return chipFactory(el);
  11025. });
  11026. };
  11027. MDCChipSet.prototype.findChipIndex_ = function(chipId) {
  11028. for (var i = 0; i < this.chips_.length; i++) {
  11029. if (this.chips_[i].id === chipId) {
  11030. return i;
  11031. }
  11032. }
  11033. return -1;
  11034. };
  11035. return MDCChipSet;
  11036. }(component_1.MDCComponent);
  11037. exports.MDCChipSet = MDCChipSet;
  11038. }, function(module, exports, __webpack_require__) {
  11039. "use strict";
  11040. Object.defineProperty(exports, "__esModule", {
  11041. value: true
  11042. });
  11043. exports.strings = {
  11044. CHIP_SELECTOR: ".mdc-chip"
  11045. };
  11046. exports.cssClasses = {
  11047. CHOICE: "mdc-chip-set--choice",
  11048. FILTER: "mdc-chip-set--filter"
  11049. };
  11050. }, function(module, exports, __webpack_require__) {
  11051. "use strict";
  11052. function __export(m) {
  11053. for (var p in m) {
  11054. if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  11055. }
  11056. }
  11057. var __importStar = this && this.__importStar || function(mod) {
  11058. if (mod && mod.__esModule) return mod;
  11059. var result = {};
  11060. if (mod != null) for (var k in mod) {
  11061. if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  11062. }
  11063. result["default"] = mod;
  11064. return result;
  11065. };
  11066. Object.defineProperty(exports, "__esModule", {
  11067. value: true
  11068. });
  11069. var util = __importStar(__webpack_require__(31));
  11070. exports.util = util;
  11071. __export(__webpack_require__(94));
  11072. __export(__webpack_require__(32));
  11073. }, function(module, exports, __webpack_require__) {
  11074. var tabbable = __webpack_require__(92);
  11075. var xtend = __webpack_require__(93);
  11076. var activeFocusTraps = function() {
  11077. var trapQueue = [];
  11078. return {
  11079. activateTrap: function(trap) {
  11080. if (trapQueue.length > 0) {
  11081. var activeTrap = trapQueue[trapQueue.length - 1];
  11082. if (activeTrap !== trap) {
  11083. activeTrap.pause();
  11084. }
  11085. }
  11086. var trapIndex = trapQueue.indexOf(trap);
  11087. if (trapIndex === -1) {
  11088. trapQueue.push(trap);
  11089. } else {
  11090. trapQueue.splice(trapIndex, 1);
  11091. trapQueue.push(trap);
  11092. }
  11093. },
  11094. deactivateTrap: function(trap) {
  11095. var trapIndex = trapQueue.indexOf(trap);
  11096. if (trapIndex !== -1) {
  11097. trapQueue.splice(trapIndex, 1);
  11098. }
  11099. if (trapQueue.length > 0) {
  11100. trapQueue[trapQueue.length - 1].unpause();
  11101. }
  11102. }
  11103. };
  11104. }();
  11105. function focusTrap(element, userOptions) {
  11106. var doc = document;
  11107. var container = typeof element === "string" ? doc.querySelector(element) : element;
  11108. var config = xtend({
  11109. returnFocusOnDeactivate: true,
  11110. escapeDeactivates: true
  11111. }, userOptions);
  11112. var state = {
  11113. firstTabbableNode: null,
  11114. lastTabbableNode: null,
  11115. nodeFocusedBeforeActivation: null,
  11116. mostRecentlyFocusedNode: null,
  11117. active: false,
  11118. paused: false
  11119. };
  11120. var trap = {
  11121. activate: activate,
  11122. deactivate: deactivate,
  11123. pause: pause,
  11124. unpause: unpause
  11125. };
  11126. return trap;
  11127. function activate(activateOptions) {
  11128. if (state.active) return;
  11129. updateTabbableNodes();
  11130. state.active = true;
  11131. state.paused = false;
  11132. state.nodeFocusedBeforeActivation = doc.activeElement;
  11133. var onActivate = activateOptions && activateOptions.onActivate ? activateOptions.onActivate : config.onActivate;
  11134. if (onActivate) {
  11135. onActivate();
  11136. }
  11137. addListeners();
  11138. return trap;
  11139. }
  11140. function deactivate(deactivateOptions) {
  11141. if (!state.active) return;
  11142. removeListeners();
  11143. state.active = false;
  11144. state.paused = false;
  11145. activeFocusTraps.deactivateTrap(trap);
  11146. var onDeactivate = deactivateOptions && deactivateOptions.onDeactivate !== undefined ? deactivateOptions.onDeactivate : config.onDeactivate;
  11147. if (onDeactivate) {
  11148. onDeactivate();
  11149. }
  11150. var returnFocus = deactivateOptions && deactivateOptions.returnFocus !== undefined ? deactivateOptions.returnFocus : config.returnFocusOnDeactivate;
  11151. if (returnFocus) {
  11152. delay(function() {
  11153. tryFocus(state.nodeFocusedBeforeActivation);
  11154. });
  11155. }
  11156. return trap;
  11157. }
  11158. function pause() {
  11159. if (state.paused || !state.active) return;
  11160. state.paused = true;
  11161. removeListeners();
  11162. }
  11163. function unpause() {
  11164. if (!state.paused || !state.active) return;
  11165. state.paused = false;
  11166. updateTabbableNodes();
  11167. addListeners();
  11168. }
  11169. function addListeners() {
  11170. if (!state.active) return;
  11171. activeFocusTraps.activateTrap(trap);
  11172. delay(function() {
  11173. tryFocus(getInitialFocusNode());
  11174. });
  11175. doc.addEventListener("focusin", checkFocusIn, true);
  11176. doc.addEventListener("mousedown", checkPointerDown, {
  11177. capture: true,
  11178. passive: false
  11179. });
  11180. doc.addEventListener("touchstart", checkPointerDown, {
  11181. capture: true,
  11182. passive: false
  11183. });
  11184. doc.addEventListener("click", checkClick, {
  11185. capture: true,
  11186. passive: false
  11187. });
  11188. doc.addEventListener("keydown", checkKey, {
  11189. capture: true,
  11190. passive: false
  11191. });
  11192. return trap;
  11193. }
  11194. function removeListeners() {
  11195. if (!state.active) return;
  11196. doc.removeEventListener("focusin", checkFocusIn, true);
  11197. doc.removeEventListener("mousedown", checkPointerDown, true);
  11198. doc.removeEventListener("touchstart", checkPointerDown, true);
  11199. doc.removeEventListener("click", checkClick, true);
  11200. doc.removeEventListener("keydown", checkKey, true);
  11201. return trap;
  11202. }
  11203. function getNodeForOption(optionName) {
  11204. var optionValue = config[optionName];
  11205. var node = optionValue;
  11206. if (!optionValue) {
  11207. return null;
  11208. }
  11209. if (typeof optionValue === "string") {
  11210. node = doc.querySelector(optionValue);
  11211. if (!node) {
  11212. throw new Error("`" + optionName + "` refers to no known node");
  11213. }
  11214. }
  11215. if (typeof optionValue === "function") {
  11216. node = optionValue();
  11217. if (!node) {
  11218. throw new Error("`" + optionName + "` did not return a node");
  11219. }
  11220. }
  11221. return node;
  11222. }
  11223. function getInitialFocusNode() {
  11224. var node;
  11225. if (getNodeForOption("initialFocus") !== null) {
  11226. node = getNodeForOption("initialFocus");
  11227. } else if (container.contains(doc.activeElement)) {
  11228. node = doc.activeElement;
  11229. } else {
  11230. node = state.firstTabbableNode || getNodeForOption("fallbackFocus");
  11231. }
  11232. if (!node) {
  11233. throw new Error("You can't have a focus-trap without at least one focusable element");
  11234. }
  11235. return node;
  11236. }
  11237. function checkPointerDown(e) {
  11238. if (container.contains(e.target)) return;
  11239. if (config.clickOutsideDeactivates) {
  11240. deactivate({
  11241. returnFocus: !tabbable.isFocusable(e.target)
  11242. });
  11243. } else {
  11244. e.preventDefault();
  11245. }
  11246. }
  11247. function checkFocusIn(e) {
  11248. if (container.contains(e.target) || e.target instanceof Document) {
  11249. return;
  11250. }
  11251. e.stopImmediatePropagation();
  11252. tryFocus(state.mostRecentlyFocusedNode || getInitialFocusNode());
  11253. }
  11254. function checkKey(e) {
  11255. if (config.escapeDeactivates !== false && isEscapeEvent(e)) {
  11256. e.preventDefault();
  11257. deactivate();
  11258. return;
  11259. }
  11260. if (isTabEvent(e)) {
  11261. checkTab(e);
  11262. return;
  11263. }
  11264. }
  11265. function checkTab(e) {
  11266. updateTabbableNodes();
  11267. if (e.shiftKey && e.target === state.firstTabbableNode) {
  11268. e.preventDefault();
  11269. tryFocus(state.lastTabbableNode);
  11270. return;
  11271. }
  11272. if (!e.shiftKey && e.target === state.lastTabbableNode) {
  11273. e.preventDefault();
  11274. tryFocus(state.firstTabbableNode);
  11275. return;
  11276. }
  11277. }
  11278. function checkClick(e) {
  11279. if (config.clickOutsideDeactivates) return;
  11280. if (container.contains(e.target)) return;
  11281. e.preventDefault();
  11282. e.stopImmediatePropagation();
  11283. }
  11284. function updateTabbableNodes() {
  11285. var tabbableNodes = tabbable(container);
  11286. state.firstTabbableNode = tabbableNodes[0] || getInitialFocusNode();
  11287. state.lastTabbableNode = tabbableNodes[tabbableNodes.length - 1] || getInitialFocusNode();
  11288. }
  11289. function tryFocus(node) {
  11290. if (node === doc.activeElement) return;
  11291. if (!node || !node.focus) {
  11292. tryFocus(getInitialFocusNode());
  11293. return;
  11294. }
  11295. node.focus();
  11296. state.mostRecentlyFocusedNode = node;
  11297. if (isSelectableInput(node)) {
  11298. node.select();
  11299. }
  11300. }
  11301. }
  11302. function isSelectableInput(node) {
  11303. return node.tagName && node.tagName.toLowerCase() === "input" && typeof node.select === "function";
  11304. }
  11305. function isEscapeEvent(e) {
  11306. return e.key === "Escape" || e.key === "Esc" || e.keyCode === 27;
  11307. }
  11308. function isTabEvent(e) {
  11309. return e.key === "Tab" || e.keyCode === 9;
  11310. }
  11311. function delay(fn) {
  11312. return setTimeout(fn, 0);
  11313. }
  11314. module.exports = focusTrap;
  11315. }, function(module, exports) {
  11316. var candidateSelectors = [ "input", "select", "textarea", "a[href]", "button", "[tabindex]", "audio[controls]", "video[controls]", '[contenteditable]:not([contenteditable="false"])' ];
  11317. var candidateSelector = candidateSelectors.join(",");
  11318. var matches = typeof Element === "undefined" ? function() {} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
  11319. function tabbable(el, options) {
  11320. options = options || {};
  11321. var regularTabbables = [];
  11322. var orderedTabbables = [];
  11323. var candidates = el.querySelectorAll(candidateSelector);
  11324. if (options.includeContainer) {
  11325. if (matches.call(el, candidateSelector)) {
  11326. candidates = Array.prototype.slice.apply(candidates);
  11327. candidates.unshift(el);
  11328. }
  11329. }
  11330. var i, candidate, candidateTabindex;
  11331. for (i = 0; i < candidates.length; i++) {
  11332. candidate = candidates[i];
  11333. if (!isNodeMatchingSelectorTabbable(candidate)) continue;
  11334. candidateTabindex = getTabindex(candidate);
  11335. if (candidateTabindex === 0) {
  11336. regularTabbables.push(candidate);
  11337. } else {
  11338. orderedTabbables.push({
  11339. documentOrder: i,
  11340. tabIndex: candidateTabindex,
  11341. node: candidate
  11342. });
  11343. }
  11344. }
  11345. var tabbableNodes = orderedTabbables.sort(sortOrderedTabbables).map(function(a) {
  11346. return a.node;
  11347. }).concat(regularTabbables);
  11348. return tabbableNodes;
  11349. }
  11350. tabbable.isTabbable = isTabbable;
  11351. tabbable.isFocusable = isFocusable;
  11352. function isNodeMatchingSelectorTabbable(node) {
  11353. if (!isNodeMatchingSelectorFocusable(node) || isNonTabbableRadio(node) || getTabindex(node) < 0) {
  11354. return false;
  11355. }
  11356. return true;
  11357. }
  11358. function isTabbable(node) {
  11359. if (!node) throw new Error("No node provided");
  11360. if (matches.call(node, candidateSelector) === false) return false;
  11361. return isNodeMatchingSelectorTabbable(node);
  11362. }
  11363. function isNodeMatchingSelectorFocusable(node) {
  11364. if (node.disabled || isHiddenInput(node) || isHidden(node)) {
  11365. return false;
  11366. }
  11367. return true;
  11368. }
  11369. var focusableCandidateSelector = candidateSelectors.concat("iframe").join(",");
  11370. function isFocusable(node) {
  11371. if (!node) throw new Error("No node provided");
  11372. if (matches.call(node, focusableCandidateSelector) === false) return false;
  11373. return isNodeMatchingSelectorFocusable(node);
  11374. }
  11375. function getTabindex(node) {
  11376. var tabindexAttr = parseInt(node.getAttribute("tabindex"), 10);
  11377. if (!isNaN(tabindexAttr)) return tabindexAttr;
  11378. if (isContentEditable(node)) return 0;
  11379. return node.tabIndex;
  11380. }
  11381. function sortOrderedTabbables(a, b) {
  11382. return a.tabIndex === b.tabIndex ? a.documentOrder - b.documentOrder : a.tabIndex - b.tabIndex;
  11383. }
  11384. function isContentEditable(node) {
  11385. return node.contentEditable === "true";
  11386. }
  11387. function isInput(node) {
  11388. return node.tagName === "INPUT";
  11389. }
  11390. function isHiddenInput(node) {
  11391. return isInput(node) && node.type === "hidden";
  11392. }
  11393. function isRadio(node) {
  11394. return isInput(node) && node.type === "radio";
  11395. }
  11396. function isNonTabbableRadio(node) {
  11397. return isRadio(node) && !isTabbableRadio(node);
  11398. }
  11399. function getCheckedRadio(nodes) {
  11400. for (var i = 0; i < nodes.length; i++) {
  11401. if (nodes[i].checked) {
  11402. return nodes[i];
  11403. }
  11404. }
  11405. }
  11406. function isTabbableRadio(node) {
  11407. if (!node.name) return true;
  11408. var radioSet = node.ownerDocument.querySelectorAll('input[type="radio"][name="' + node.name + '"]');
  11409. var checked = getCheckedRadio(radioSet);
  11410. return !checked || checked === node;
  11411. }
  11412. function isHidden(node) {
  11413. return node.offsetParent === null || getComputedStyle(node).visibility === "hidden";
  11414. }
  11415. module.exports = tabbable;
  11416. }, function(module, exports) {
  11417. module.exports = extend;
  11418. var hasOwnProperty = Object.prototype.hasOwnProperty;
  11419. function extend() {
  11420. var target = {};
  11421. for (var i = 0; i < arguments.length; i++) {
  11422. var source = arguments[i];
  11423. for (var key in source) {
  11424. if (hasOwnProperty.call(source, key)) {
  11425. target[key] = source[key];
  11426. }
  11427. }
  11428. }
  11429. return target;
  11430. }
  11431. }, function(module, exports, __webpack_require__) {
  11432. "use strict";
  11433. var __extends = this && this.__extends || function() {
  11434. var _extendStatics = function extendStatics(d, b) {
  11435. _extendStatics = Object.setPrototypeOf || {
  11436. __proto__: []
  11437. } instanceof Array && function(d, b) {
  11438. d.__proto__ = b;
  11439. } || function(d, b) {
  11440. for (var p in b) {
  11441. if (b.hasOwnProperty(p)) d[p] = b[p];
  11442. }
  11443. };
  11444. return _extendStatics(d, b);
  11445. };
  11446. return function(d, b) {
  11447. _extendStatics(d, b);
  11448. function __() {
  11449. this.constructor = d;
  11450. }
  11451. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  11452. };
  11453. }();
  11454. var __values = this && this.__values || function(o) {
  11455. var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
  11456. if (m) return m.call(o);
  11457. return {
  11458. next: function next() {
  11459. if (o && i >= o.length) o = void 0;
  11460. return {
  11461. value: o && o[i++],
  11462. done: !o
  11463. };
  11464. }
  11465. };
  11466. };
  11467. var __importStar = this && this.__importStar || function(mod) {
  11468. if (mod && mod.__esModule) return mod;
  11469. var result = {};
  11470. if (mod != null) for (var k in mod) {
  11471. if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  11472. }
  11473. result["default"] = mod;
  11474. return result;
  11475. };
  11476. Object.defineProperty(exports, "__esModule", {
  11477. value: true
  11478. });
  11479. var component_1 = __webpack_require__(1);
  11480. var ponyfill_1 = __webpack_require__(3);
  11481. var component_2 = __webpack_require__(2);
  11482. var foundation_1 = __webpack_require__(32);
  11483. var util = __importStar(__webpack_require__(31));
  11484. var strings = foundation_1.MDCDialogFoundation.strings;
  11485. var MDCDialog = function(_super) {
  11486. __extends(MDCDialog, _super);
  11487. function MDCDialog() {
  11488. return _super !== null && _super.apply(this, arguments) || this;
  11489. }
  11490. Object.defineProperty(MDCDialog.prototype, "isOpen", {
  11491. get: function get() {
  11492. return this.foundation_.isOpen();
  11493. },
  11494. enumerable: true,
  11495. configurable: true
  11496. });
  11497. Object.defineProperty(MDCDialog.prototype, "escapeKeyAction", {
  11498. get: function get() {
  11499. return this.foundation_.getEscapeKeyAction();
  11500. },
  11501. set: function set(action) {
  11502. this.foundation_.setEscapeKeyAction(action);
  11503. },
  11504. enumerable: true,
  11505. configurable: true
  11506. });
  11507. Object.defineProperty(MDCDialog.prototype, "scrimClickAction", {
  11508. get: function get() {
  11509. return this.foundation_.getScrimClickAction();
  11510. },
  11511. set: function set(action) {
  11512. this.foundation_.setScrimClickAction(action);
  11513. },
  11514. enumerable: true,
  11515. configurable: true
  11516. });
  11517. Object.defineProperty(MDCDialog.prototype, "autoStackButtons", {
  11518. get: function get() {
  11519. return this.foundation_.getAutoStackButtons();
  11520. },
  11521. set: function set(autoStack) {
  11522. this.foundation_.setAutoStackButtons(autoStack);
  11523. },
  11524. enumerable: true,
  11525. configurable: true
  11526. });
  11527. MDCDialog.attachTo = function(root) {
  11528. return new MDCDialog(root);
  11529. };
  11530. MDCDialog.prototype.initialize = function(focusTrapFactory, initialFocusEl) {
  11531. var e_1, _a;
  11532. var container = this.root_.querySelector(strings.CONTAINER_SELECTOR);
  11533. if (!container) {
  11534. throw new Error("Dialog component requires a " + strings.CONTAINER_SELECTOR + " container element");
  11535. }
  11536. this.container_ = container;
  11537. this.content_ = this.root_.querySelector(strings.CONTENT_SELECTOR);
  11538. this.buttons_ = [].slice.call(this.root_.querySelectorAll(strings.BUTTON_SELECTOR));
  11539. this.defaultButton_ = this.root_.querySelector(strings.DEFAULT_BUTTON_SELECTOR);
  11540. this.focusTrapFactory_ = focusTrapFactory;
  11541. this.initialFocusEl_ = initialFocusEl;
  11542. this.buttonRipples_ = [];
  11543. try {
  11544. for (var _b = __values(this.buttons_), _c = _b.next(); !_c.done; _c = _b.next()) {
  11545. var buttonEl = _c.value;
  11546. this.buttonRipples_.push(new component_2.MDCRipple(buttonEl));
  11547. }
  11548. } catch (e_1_1) {
  11549. e_1 = {
  11550. error: e_1_1
  11551. };
  11552. } finally {
  11553. try {
  11554. if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
  11555. } finally {
  11556. if (e_1) throw e_1.error;
  11557. }
  11558. }
  11559. };
  11560. MDCDialog.prototype.initialSyncWithDOM = function() {
  11561. var _this = this;
  11562. this.focusTrap_ = util.createFocusTrapInstance(this.container_, this.focusTrapFactory_, this.initialFocusEl_);
  11563. this.handleInteraction_ = this.foundation_.handleInteraction.bind(this.foundation_);
  11564. this.handleDocumentKeydown_ = this.foundation_.handleDocumentKeydown.bind(this.foundation_);
  11565. this.handleLayout_ = this.layout.bind(this);
  11566. var LAYOUT_EVENTS = [ "resize", "orientationchange" ];
  11567. this.handleOpening_ = function() {
  11568. LAYOUT_EVENTS.forEach(function(evtType) {
  11569. return window.addEventListener(evtType, _this.handleLayout_);
  11570. });
  11571. document.addEventListener("keydown", _this.handleDocumentKeydown_);
  11572. };
  11573. this.handleClosing_ = function() {
  11574. LAYOUT_EVENTS.forEach(function(evtType) {
  11575. return window.removeEventListener(evtType, _this.handleLayout_);
  11576. });
  11577. document.removeEventListener("keydown", _this.handleDocumentKeydown_);
  11578. };
  11579. this.listen("click", this.handleInteraction_);
  11580. this.listen("keydown", this.handleInteraction_);
  11581. this.listen(strings.OPENING_EVENT, this.handleOpening_);
  11582. this.listen(strings.CLOSING_EVENT, this.handleClosing_);
  11583. };
  11584. MDCDialog.prototype.destroy = function() {
  11585. this.unlisten("click", this.handleInteraction_);
  11586. this.unlisten("keydown", this.handleInteraction_);
  11587. this.unlisten(strings.OPENING_EVENT, this.handleOpening_);
  11588. this.unlisten(strings.CLOSING_EVENT, this.handleClosing_);
  11589. this.handleClosing_();
  11590. this.buttonRipples_.forEach(function(ripple) {
  11591. return ripple.destroy();
  11592. });
  11593. _super.prototype.destroy.call(this);
  11594. };
  11595. MDCDialog.prototype.layout = function() {
  11596. this.foundation_.layout();
  11597. };
  11598. MDCDialog.prototype.open = function() {
  11599. this.foundation_.open();
  11600. };
  11601. MDCDialog.prototype.close = function(action) {
  11602. if (action === void 0) {
  11603. action = "";
  11604. }
  11605. this.foundation_.close(action);
  11606. };
  11607. MDCDialog.prototype.getDefaultFoundation = function() {
  11608. var _this = this;
  11609. var adapter = {
  11610. addBodyClass: function addBodyClass(className) {
  11611. return document.body.classList.add(className);
  11612. },
  11613. addClass: function addClass(className) {
  11614. return _this.root_.classList.add(className);
  11615. },
  11616. areButtonsStacked: function areButtonsStacked() {
  11617. return util.areTopsMisaligned(_this.buttons_);
  11618. },
  11619. clickDefaultButton: function clickDefaultButton() {
  11620. return _this.defaultButton_ && _this.defaultButton_.click();
  11621. },
  11622. eventTargetMatches: function eventTargetMatches(target, selector) {
  11623. return target ? ponyfill_1.matches(target, selector) : false;
  11624. },
  11625. getActionFromEvent: function getActionFromEvent(evt) {
  11626. if (!evt.target) {
  11627. return "";
  11628. }
  11629. var element = ponyfill_1.closest(evt.target, "[" + strings.ACTION_ATTRIBUTE + "]");
  11630. return element && element.getAttribute(strings.ACTION_ATTRIBUTE);
  11631. },
  11632. hasClass: function hasClass(className) {
  11633. return _this.root_.classList.contains(className);
  11634. },
  11635. isContentScrollable: function isContentScrollable() {
  11636. return util.isScrollable(_this.content_);
  11637. },
  11638. notifyClosed: function notifyClosed(action) {
  11639. return _this.emit(strings.CLOSED_EVENT, action ? {
  11640. action: action
  11641. } : {});
  11642. },
  11643. notifyClosing: function notifyClosing(action) {
  11644. return _this.emit(strings.CLOSING_EVENT, action ? {
  11645. action: action
  11646. } : {});
  11647. },
  11648. notifyOpened: function notifyOpened() {
  11649. return _this.emit(strings.OPENED_EVENT, {});
  11650. },
  11651. notifyOpening: function notifyOpening() {
  11652. return _this.emit(strings.OPENING_EVENT, {});
  11653. },
  11654. releaseFocus: function releaseFocus() {
  11655. return _this.focusTrap_.deactivate();
  11656. },
  11657. removeBodyClass: function removeBodyClass(className) {
  11658. return document.body.classList.remove(className);
  11659. },
  11660. removeClass: function removeClass(className) {
  11661. return _this.root_.classList.remove(className);
  11662. },
  11663. reverseButtons: function reverseButtons() {
  11664. _this.buttons_.reverse();
  11665. _this.buttons_.forEach(function(button) {
  11666. button.parentElement.appendChild(button);
  11667. });
  11668. },
  11669. trapFocus: function trapFocus() {
  11670. return _this.focusTrap_.activate();
  11671. }
  11672. };
  11673. return new foundation_1.MDCDialogFoundation(adapter);
  11674. };
  11675. return MDCDialog;
  11676. }(component_1.MDCComponent);
  11677. exports.MDCDialog = MDCDialog;
  11678. }, function(module, exports, __webpack_require__) {
  11679. "use strict";
  11680. Object.defineProperty(exports, "__esModule", {
  11681. value: true
  11682. });
  11683. exports.cssClasses = {
  11684. CLOSING: "mdc-dialog--closing",
  11685. OPEN: "mdc-dialog--open",
  11686. OPENING: "mdc-dialog--opening",
  11687. SCROLLABLE: "mdc-dialog--scrollable",
  11688. SCROLL_LOCK: "mdc-dialog-scroll-lock",
  11689. STACKED: "mdc-dialog--stacked"
  11690. };
  11691. exports.strings = {
  11692. ACTION_ATTRIBUTE: "data-mdc-dialog-action",
  11693. BUTTON_SELECTOR: ".mdc-dialog__button",
  11694. CLOSED_EVENT: "MDCDialog:closed",
  11695. CLOSE_ACTION: "close",
  11696. CLOSING_EVENT: "MDCDialog:closing",
  11697. CONTAINER_SELECTOR: ".mdc-dialog__container",
  11698. CONTENT_SELECTOR: ".mdc-dialog__content",
  11699. DEFAULT_BUTTON_SELECTOR: ".mdc-dialog__button--default",
  11700. DESTROY_ACTION: "destroy",
  11701. OPENED_EVENT: "MDCDialog:opened",
  11702. OPENING_EVENT: "MDCDialog:opening",
  11703. SCRIM_SELECTOR: ".mdc-dialog__scrim",
  11704. SUPPRESS_DEFAULT_PRESS_SELECTOR: [ "textarea", ".mdc-menu .mdc-list-item" ].join(", "),
  11705. SURFACE_SELECTOR: ".mdc-dialog__surface"
  11706. };
  11707. exports.numbers = {
  11708. DIALOG_ANIMATION_CLOSE_TIME_MS: 75,
  11709. DIALOG_ANIMATION_OPEN_TIME_MS: 150
  11710. };
  11711. }, function(module, exports, __webpack_require__) {
  11712. "use strict";
  11713. var __importStar = this && this.__importStar || function(mod) {
  11714. if (mod && mod.__esModule) return mod;
  11715. var result = {};
  11716. if (mod != null) for (var k in mod) {
  11717. if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  11718. }
  11719. result["default"] = mod;
  11720. return result;
  11721. };
  11722. Object.defineProperty(exports, "__esModule", {
  11723. value: true
  11724. });
  11725. var ponyfill = __importStar(__webpack_require__(3));
  11726. exports.ponyfill = ponyfill;
  11727. }, function(module, exports, __webpack_require__) {
  11728. "use strict";
  11729. function __export(m) {
  11730. for (var p in m) {
  11731. if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  11732. }
  11733. }
  11734. var __importStar = this && this.__importStar || function(mod) {
  11735. if (mod && mod.__esModule) return mod;
  11736. var result = {};
  11737. if (mod != null) for (var k in mod) {
  11738. if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  11739. }
  11740. result["default"] = mod;
  11741. return result;
  11742. };
  11743. Object.defineProperty(exports, "__esModule", {
  11744. value: true
  11745. });
  11746. var util = __importStar(__webpack_require__(33));
  11747. exports.util = util;
  11748. __export(__webpack_require__(100));
  11749. __export(__webpack_require__(14));
  11750. __export(__webpack_require__(36));
  11751. }, function(module, exports) {
  11752. var candidateSelectors = [ "input", "select", "textarea", "a[href]", "button", "[tabindex]", "audio[controls]", "video[controls]", '[contenteditable]:not([contenteditable="false"])' ];
  11753. var candidateSelector = candidateSelectors.join(",");
  11754. var matches = typeof Element === "undefined" ? function() {} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
  11755. function tabbable(el, options) {
  11756. options = options || {};
  11757. var regularTabbables = [];
  11758. var orderedTabbables = [];
  11759. var candidates = el.querySelectorAll(candidateSelector);
  11760. if (options.includeContainer) {
  11761. if (matches.call(el, candidateSelector)) {
  11762. candidates = Array.prototype.slice.apply(candidates);
  11763. candidates.unshift(el);
  11764. }
  11765. }
  11766. var i, candidate, candidateTabindex;
  11767. for (i = 0; i < candidates.length; i++) {
  11768. candidate = candidates[i];
  11769. if (!isNodeMatchingSelectorTabbable(candidate)) continue;
  11770. candidateTabindex = getTabindex(candidate);
  11771. if (candidateTabindex === 0) {
  11772. regularTabbables.push(candidate);
  11773. } else {
  11774. orderedTabbables.push({
  11775. documentOrder: i,
  11776. tabIndex: candidateTabindex,
  11777. node: candidate
  11778. });
  11779. }
  11780. }
  11781. var tabbableNodes = orderedTabbables.sort(sortOrderedTabbables).map(function(a) {
  11782. return a.node;
  11783. }).concat(regularTabbables);
  11784. return tabbableNodes;
  11785. }
  11786. tabbable.isTabbable = isTabbable;
  11787. tabbable.isFocusable = isFocusable;
  11788. function isNodeMatchingSelectorTabbable(node) {
  11789. if (!isNodeMatchingSelectorFocusable(node) || isNonTabbableRadio(node) || getTabindex(node) < 0) {
  11790. return false;
  11791. }
  11792. return true;
  11793. }
  11794. function isTabbable(node) {
  11795. if (!node) throw new Error("No node provided");
  11796. if (matches.call(node, candidateSelector) === false) return false;
  11797. return isNodeMatchingSelectorTabbable(node);
  11798. }
  11799. function isNodeMatchingSelectorFocusable(node) {
  11800. if (node.disabled || isHiddenInput(node) || isHidden(node)) {
  11801. return false;
  11802. }
  11803. return true;
  11804. }
  11805. var focusableCandidateSelector = candidateSelectors.concat("iframe").join(",");
  11806. function isFocusable(node) {
  11807. if (!node) throw new Error("No node provided");
  11808. if (matches.call(node, focusableCandidateSelector) === false) return false;
  11809. return isNodeMatchingSelectorFocusable(node);
  11810. }
  11811. function getTabindex(node) {
  11812. var tabindexAttr = parseInt(node.getAttribute("tabindex"), 10);
  11813. if (!isNaN(tabindexAttr)) return tabindexAttr;
  11814. if (isContentEditable(node)) return 0;
  11815. return node.tabIndex;
  11816. }
  11817. function sortOrderedTabbables(a, b) {
  11818. return a.tabIndex === b.tabIndex ? a.documentOrder - b.documentOrder : a.tabIndex - b.tabIndex;
  11819. }
  11820. function isContentEditable(node) {
  11821. return node.contentEditable === "true";
  11822. }
  11823. function isInput(node) {
  11824. return node.tagName === "INPUT";
  11825. }
  11826. function isHiddenInput(node) {
  11827. return isInput(node) && node.type === "hidden";
  11828. }
  11829. function isRadio(node) {
  11830. return isInput(node) && node.type === "radio";
  11831. }
  11832. function isNonTabbableRadio(node) {
  11833. return isRadio(node) && !isTabbableRadio(node);
  11834. }
  11835. function getCheckedRadio(nodes) {
  11836. for (var i = 0; i < nodes.length; i++) {
  11837. if (nodes[i].checked) {
  11838. return nodes[i];
  11839. }
  11840. }
  11841. }
  11842. function isTabbableRadio(node) {
  11843. if (!node.name) return true;
  11844. var radioSet = node.ownerDocument.querySelectorAll('input[type="radio"][name="' + node.name + '"]');
  11845. var checked = getCheckedRadio(radioSet);
  11846. return !checked || checked === node;
  11847. }
  11848. function isHidden(node) {
  11849. return node.offsetParent === null || getComputedStyle(node).visibility === "hidden";
  11850. }
  11851. module.exports = tabbable;
  11852. }, function(module, exports) {
  11853. module.exports = extend;
  11854. var hasOwnProperty = Object.prototype.hasOwnProperty;
  11855. function extend() {
  11856. var target = {};
  11857. for (var i = 0; i < arguments.length; i++) {
  11858. var source = arguments[i];
  11859. for (var key in source) {
  11860. if (hasOwnProperty.call(source, key)) {
  11861. target[key] = source[key];
  11862. }
  11863. }
  11864. }
  11865. return target;
  11866. }
  11867. }, function(module, exports, __webpack_require__) {
  11868. "use strict";
  11869. var __extends = this && this.__extends || function() {
  11870. var _extendStatics = function extendStatics(d, b) {
  11871. _extendStatics = Object.setPrototypeOf || {
  11872. __proto__: []
  11873. } instanceof Array && function(d, b) {
  11874. d.__proto__ = b;
  11875. } || function(d, b) {
  11876. for (var p in b) {
  11877. if (b.hasOwnProperty(p)) d[p] = b[p];
  11878. }
  11879. };
  11880. return _extendStatics(d, b);
  11881. };
  11882. return function(d, b) {
  11883. _extendStatics(d, b);
  11884. function __() {
  11885. this.constructor = d;
  11886. }
  11887. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  11888. };
  11889. }();
  11890. var __importDefault = this && this.__importDefault || function(mod) {
  11891. return mod && mod.__esModule ? mod : {
  11892. default: mod
  11893. };
  11894. };
  11895. var __importStar = this && this.__importStar || function(mod) {
  11896. if (mod && mod.__esModule) return mod;
  11897. var result = {};
  11898. if (mod != null) for (var k in mod) {
  11899. if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  11900. }
  11901. result["default"] = mod;
  11902. return result;
  11903. };
  11904. Object.defineProperty(exports, "__esModule", {
  11905. value: true
  11906. });
  11907. var component_1 = __webpack_require__(1);
  11908. var component_2 = __webpack_require__(13);
  11909. var foundation_1 = __webpack_require__(5);
  11910. var focus_trap_1 = __importDefault(__webpack_require__(34));
  11911. var foundation_2 = __webpack_require__(14);
  11912. var foundation_3 = __webpack_require__(36);
  11913. var util = __importStar(__webpack_require__(33));
  11914. var cssClasses = foundation_2.MDCDismissibleDrawerFoundation.cssClasses, strings = foundation_2.MDCDismissibleDrawerFoundation.strings;
  11915. var MDCDrawer = function(_super) {
  11916. __extends(MDCDrawer, _super);
  11917. function MDCDrawer() {
  11918. return _super !== null && _super.apply(this, arguments) || this;
  11919. }
  11920. MDCDrawer.attachTo = function(root) {
  11921. return new MDCDrawer(root);
  11922. };
  11923. Object.defineProperty(MDCDrawer.prototype, "open", {
  11924. get: function get() {
  11925. return this.foundation_.isOpen();
  11926. },
  11927. set: function set(isOpen) {
  11928. if (isOpen) {
  11929. this.foundation_.open();
  11930. } else {
  11931. this.foundation_.close();
  11932. }
  11933. },
  11934. enumerable: true,
  11935. configurable: true
  11936. });
  11937. Object.defineProperty(MDCDrawer.prototype, "list", {
  11938. get: function get() {
  11939. return this.list_;
  11940. },
  11941. enumerable: true,
  11942. configurable: true
  11943. });
  11944. MDCDrawer.prototype.initialize = function(focusTrapFactory, listFactory) {
  11945. if (focusTrapFactory === void 0) {
  11946. focusTrapFactory = focus_trap_1.default;
  11947. }
  11948. if (listFactory === void 0) {
  11949. listFactory = function listFactory(el) {
  11950. return new component_2.MDCList(el);
  11951. };
  11952. }
  11953. var listEl = this.root_.querySelector("." + foundation_1.MDCListFoundation.cssClasses.ROOT);
  11954. if (listEl) {
  11955. this.list_ = listFactory(listEl);
  11956. this.list_.wrapFocus = true;
  11957. }
  11958. this.focusTrapFactory_ = focusTrapFactory;
  11959. };
  11960. MDCDrawer.prototype.initialSyncWithDOM = function() {
  11961. var _this = this;
  11962. var MODAL = cssClasses.MODAL;
  11963. var SCRIM_SELECTOR = strings.SCRIM_SELECTOR;
  11964. this.scrim_ = this.root_.parentNode.querySelector(SCRIM_SELECTOR);
  11965. if (this.scrim_ && this.root_.classList.contains(MODAL)) {
  11966. this.handleScrimClick_ = function() {
  11967. return _this.foundation_.handleScrimClick();
  11968. };
  11969. this.scrim_.addEventListener("click", this.handleScrimClick_);
  11970. this.focusTrap_ = util.createFocusTrapInstance(this.root_, this.focusTrapFactory_);
  11971. }
  11972. this.handleKeydown_ = function(evt) {
  11973. return _this.foundation_.handleKeydown(evt);
  11974. };
  11975. this.handleTransitionEnd_ = function(evt) {
  11976. return _this.foundation_.handleTransitionEnd(evt);
  11977. };
  11978. this.listen("keydown", this.handleKeydown_);
  11979. this.listen("transitionend", this.handleTransitionEnd_);
  11980. };
  11981. MDCDrawer.prototype.destroy = function() {
  11982. this.unlisten("keydown", this.handleKeydown_);
  11983. this.unlisten("transitionend", this.handleTransitionEnd_);
  11984. if (this.list_) {
  11985. this.list_.destroy();
  11986. }
  11987. var MODAL = cssClasses.MODAL;
  11988. if (this.scrim_ && this.handleScrimClick_ && this.root_.classList.contains(MODAL)) {
  11989. this.scrim_.removeEventListener("click", this.handleScrimClick_);
  11990. this.open = false;
  11991. }
  11992. };
  11993. MDCDrawer.prototype.getDefaultFoundation = function() {
  11994. var _this = this;
  11995. var adapter = {
  11996. addClass: function addClass(className) {
  11997. return _this.root_.classList.add(className);
  11998. },
  11999. removeClass: function removeClass(className) {
  12000. return _this.root_.classList.remove(className);
  12001. },
  12002. hasClass: function hasClass(className) {
  12003. return _this.root_.classList.contains(className);
  12004. },
  12005. elementHasClass: function elementHasClass(element, className) {
  12006. return element.classList.contains(className);
  12007. },
  12008. saveFocus: function saveFocus() {
  12009. return _this.previousFocus_ = document.activeElement;
  12010. },
  12011. restoreFocus: function restoreFocus() {
  12012. var previousFocus = _this.previousFocus_;
  12013. if (previousFocus && previousFocus.focus && _this.root_.contains(document.activeElement)) {
  12014. previousFocus.focus();
  12015. }
  12016. },
  12017. focusActiveNavigationItem: function focusActiveNavigationItem() {
  12018. var activeNavItemEl = _this.root_.querySelector("." + foundation_1.MDCListFoundation.cssClasses.LIST_ITEM_ACTIVATED_CLASS);
  12019. if (activeNavItemEl) {
  12020. activeNavItemEl.focus();
  12021. }
  12022. },
  12023. notifyClose: function notifyClose() {
  12024. return _this.emit(strings.CLOSE_EVENT, {}, true);
  12025. },
  12026. notifyOpen: function notifyOpen() {
  12027. return _this.emit(strings.OPEN_EVENT, {}, true);
  12028. },
  12029. trapFocus: function trapFocus() {
  12030. return _this.focusTrap_.activate();
  12031. },
  12032. releaseFocus: function releaseFocus() {
  12033. return _this.focusTrap_.deactivate();
  12034. }
  12035. };
  12036. var DISMISSIBLE = cssClasses.DISMISSIBLE, MODAL = cssClasses.MODAL;
  12037. if (this.root_.classList.contains(DISMISSIBLE)) {
  12038. return new foundation_2.MDCDismissibleDrawerFoundation(adapter);
  12039. } else if (this.root_.classList.contains(MODAL)) {
  12040. return new foundation_3.MDCModalDrawerFoundation(adapter);
  12041. } else {
  12042. throw new Error("MDCDrawer: Failed to instantiate component. Supported variants are " + DISMISSIBLE + " and " + MODAL + ".");
  12043. }
  12044. };
  12045. return MDCDrawer;
  12046. }(component_1.MDCComponent);
  12047. exports.MDCDrawer = MDCDrawer;
  12048. }, function(module, exports, __webpack_require__) {
  12049. "use strict";
  12050. Object.defineProperty(exports, "__esModule", {
  12051. value: true
  12052. });
  12053. var cssClasses = {
  12054. ANIMATE: "mdc-drawer--animate",
  12055. CLOSING: "mdc-drawer--closing",
  12056. DISMISSIBLE: "mdc-drawer--dismissible",
  12057. MODAL: "mdc-drawer--modal",
  12058. OPEN: "mdc-drawer--open",
  12059. OPENING: "mdc-drawer--opening",
  12060. ROOT: "mdc-drawer"
  12061. };
  12062. exports.cssClasses = cssClasses;
  12063. var strings = {
  12064. APP_CONTENT_SELECTOR: ".mdc-drawer-app-content",
  12065. CLOSE_EVENT: "MDCDrawer:closed",
  12066. OPEN_EVENT: "MDCDrawer:opened",
  12067. SCRIM_SELECTOR: ".mdc-drawer-scrim"
  12068. };
  12069. exports.strings = strings;
  12070. }, function(module, exports, __webpack_require__) {
  12071. "use strict";
  12072. function __export(m) {
  12073. for (var p in m) {
  12074. if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  12075. }
  12076. }
  12077. Object.defineProperty(exports, "__esModule", {
  12078. value: true
  12079. });
  12080. __export(__webpack_require__(15));
  12081. __export(__webpack_require__(16));
  12082. }, function(module, exports, __webpack_require__) {
  12083. "use strict";
  12084. Object.defineProperty(exports, "__esModule", {
  12085. value: true
  12086. });
  12087. exports.cssClasses = {
  12088. LABEL_FLOAT_ABOVE: "mdc-floating-label--float-above",
  12089. LABEL_SHAKE: "mdc-floating-label--shake",
  12090. ROOT: "mdc-floating-label"
  12091. };
  12092. }, function(module, exports, __webpack_require__) {
  12093. "use strict";
  12094. function __export(m) {
  12095. for (var p in m) {
  12096. if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  12097. }
  12098. }
  12099. Object.defineProperty(exports, "__esModule", {
  12100. value: true
  12101. });
  12102. __export(__webpack_require__(105));
  12103. __export(__webpack_require__(37));
  12104. }, function(module, exports, __webpack_require__) {
  12105. "use strict";
  12106. var __extends = this && this.__extends || function() {
  12107. var _extendStatics = function extendStatics(d, b) {
  12108. _extendStatics = Object.setPrototypeOf || {
  12109. __proto__: []
  12110. } instanceof Array && function(d, b) {
  12111. d.__proto__ = b;
  12112. } || function(d, b) {
  12113. for (var p in b) {
  12114. if (b.hasOwnProperty(p)) d[p] = b[p];
  12115. }
  12116. };
  12117. return _extendStatics(d, b);
  12118. };
  12119. return function(d, b) {
  12120. _extendStatics(d, b);
  12121. function __() {
  12122. this.constructor = d;
  12123. }
  12124. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  12125. };
  12126. }();
  12127. Object.defineProperty(exports, "__esModule", {
  12128. value: true
  12129. });
  12130. var component_1 = __webpack_require__(1);
  12131. var foundation_1 = __webpack_require__(37);
  12132. var MDCFormField = function(_super) {
  12133. __extends(MDCFormField, _super);
  12134. function MDCFormField() {
  12135. return _super !== null && _super.apply(this, arguments) || this;
  12136. }
  12137. MDCFormField.attachTo = function(root) {
  12138. return new MDCFormField(root);
  12139. };
  12140. Object.defineProperty(MDCFormField.prototype, "input", {
  12141. get: function get() {
  12142. return this.input_;
  12143. },
  12144. set: function set(input) {
  12145. this.input_ = input;
  12146. },
  12147. enumerable: true,
  12148. configurable: true
  12149. });
  12150. Object.defineProperty(MDCFormField.prototype, "label_", {
  12151. get: function get() {
  12152. var LABEL_SELECTOR = foundation_1.MDCFormFieldFoundation.strings.LABEL_SELECTOR;
  12153. return this.root_.querySelector(LABEL_SELECTOR);
  12154. },
  12155. enumerable: true,
  12156. configurable: true
  12157. });
  12158. MDCFormField.prototype.getDefaultFoundation = function() {
  12159. var _this = this;
  12160. var adapter = {
  12161. activateInputRipple: function activateInputRipple() {
  12162. if (_this.input_ && _this.input_.ripple) {
  12163. _this.input_.ripple.activate();
  12164. }
  12165. },
  12166. deactivateInputRipple: function deactivateInputRipple() {
  12167. if (_this.input_ && _this.input_.ripple) {
  12168. _this.input_.ripple.deactivate();
  12169. }
  12170. },
  12171. deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) {
  12172. if (_this.label_) {
  12173. _this.label_.removeEventListener(evtType, handler);
  12174. }
  12175. },
  12176. registerInteractionHandler: function registerInteractionHandler(evtType, handler) {
  12177. if (_this.label_) {
  12178. _this.label_.addEventListener(evtType, handler);
  12179. }
  12180. }
  12181. };
  12182. return new foundation_1.MDCFormFieldFoundation(adapter);
  12183. };
  12184. return MDCFormField;
  12185. }(component_1.MDCComponent);
  12186. exports.MDCFormField = MDCFormField;
  12187. }, function(module, exports, __webpack_require__) {
  12188. "use strict";
  12189. Object.defineProperty(exports, "__esModule", {
  12190. value: true
  12191. });
  12192. exports.cssClasses = {
  12193. ROOT: "mdc-form-field"
  12194. };
  12195. exports.strings = {
  12196. LABEL_SELECTOR: ".mdc-form-field > label"
  12197. };
  12198. }, function(module, exports, __webpack_require__) {
  12199. "use strict";
  12200. function __export(m) {
  12201. for (var p in m) {
  12202. if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  12203. }
  12204. }
  12205. Object.defineProperty(exports, "__esModule", {
  12206. value: true
  12207. });
  12208. __export(__webpack_require__(108));
  12209. __export(__webpack_require__(38));
  12210. }, function(module, exports, __webpack_require__) {
  12211. "use strict";
  12212. var __extends = this && this.__extends || function() {
  12213. var _extendStatics = function extendStatics(d, b) {
  12214. _extendStatics = Object.setPrototypeOf || {
  12215. __proto__: []
  12216. } instanceof Array && function(d, b) {
  12217. d.__proto__ = b;
  12218. } || function(d, b) {
  12219. for (var p in b) {
  12220. if (b.hasOwnProperty(p)) d[p] = b[p];
  12221. }
  12222. };
  12223. return _extendStatics(d, b);
  12224. };
  12225. return function(d, b) {
  12226. _extendStatics(d, b);
  12227. function __() {
  12228. this.constructor = d;
  12229. }
  12230. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  12231. };
  12232. }();
  12233. Object.defineProperty(exports, "__esModule", {
  12234. value: true
  12235. });
  12236. var component_1 = __webpack_require__(1);
  12237. var foundation_1 = __webpack_require__(38);
  12238. var MDCGridList = function(_super) {
  12239. __extends(MDCGridList, _super);
  12240. function MDCGridList() {
  12241. return _super !== null && _super.apply(this, arguments) || this;
  12242. }
  12243. MDCGridList.attachTo = function(root) {
  12244. return new MDCGridList(root);
  12245. };
  12246. MDCGridList.prototype.getDefaultFoundation = function() {
  12247. var _this = this;
  12248. var adapter = {
  12249. deregisterResizeHandler: function deregisterResizeHandler(handler) {
  12250. return window.removeEventListener("resize", handler);
  12251. },
  12252. getNumberOfTiles: function getNumberOfTiles() {
  12253. return _this.root_.querySelectorAll(foundation_1.MDCGridListFoundation.strings.TILE_SELECTOR).length;
  12254. },
  12255. getOffsetWidth: function getOffsetWidth() {
  12256. return _this.root_.offsetWidth;
  12257. },
  12258. getOffsetWidthForTileAtIndex: function getOffsetWidthForTileAtIndex(index) {
  12259. var tileEl = _this.root_.querySelectorAll(foundation_1.MDCGridListFoundation.strings.TILE_SELECTOR)[index];
  12260. return tileEl.offsetWidth;
  12261. },
  12262. registerResizeHandler: function registerResizeHandler(handler) {
  12263. return window.addEventListener("resize", handler);
  12264. },
  12265. setStyleForTilesElement: function setStyleForTilesElement(property, value) {
  12266. var tilesEl = _this.root_.querySelector(foundation_1.MDCGridListFoundation.strings.TILES_SELECTOR);
  12267. tilesEl.style[property] = value;
  12268. }
  12269. };
  12270. return new foundation_1.MDCGridListFoundation(adapter);
  12271. };
  12272. return MDCGridList;
  12273. }(component_1.MDCComponent);
  12274. exports.MDCGridList = MDCGridList;
  12275. }, function(module, exports, __webpack_require__) {
  12276. "use strict";
  12277. Object.defineProperty(exports, "__esModule", {
  12278. value: true
  12279. });
  12280. exports.strings = {
  12281. TILES_SELECTOR: ".mdc-grid-list__tiles",
  12282. TILE_SELECTOR: ".mdc-grid-tile"
  12283. };
  12284. }, function(module, exports, __webpack_require__) {
  12285. "use strict";
  12286. function __export(m) {
  12287. for (var p in m) {
  12288. if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  12289. }
  12290. }
  12291. Object.defineProperty(exports, "__esModule", {
  12292. value: true
  12293. });
  12294. __export(__webpack_require__(111));
  12295. __export(__webpack_require__(39));
  12296. }, function(module, exports, __webpack_require__) {
  12297. "use strict";
  12298. var __extends = this && this.__extends || function() {
  12299. var _extendStatics = function extendStatics(d, b) {
  12300. _extendStatics = Object.setPrototypeOf || {
  12301. __proto__: []
  12302. } instanceof Array && function(d, b) {
  12303. d.__proto__ = b;
  12304. } || function(d, b) {
  12305. for (var p in b) {
  12306. if (b.hasOwnProperty(p)) d[p] = b[p];
  12307. }
  12308. };
  12309. return _extendStatics(d, b);
  12310. };
  12311. return function(d, b) {
  12312. _extendStatics(d, b);
  12313. function __() {
  12314. this.constructor = d;
  12315. }
  12316. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  12317. };
  12318. }();
  12319. Object.defineProperty(exports, "__esModule", {
  12320. value: true
  12321. });
  12322. var component_1 = __webpack_require__(1);
  12323. var component_2 = __webpack_require__(2);
  12324. var foundation_1 = __webpack_require__(39);
  12325. var strings = foundation_1.MDCIconButtonToggleFoundation.strings;
  12326. var MDCIconButtonToggle = function(_super) {
  12327. __extends(MDCIconButtonToggle, _super);
  12328. function MDCIconButtonToggle() {
  12329. var _this = _super !== null && _super.apply(this, arguments) || this;
  12330. _this.ripple_ = _this.createRipple_();
  12331. return _this;
  12332. }
  12333. MDCIconButtonToggle.attachTo = function(root) {
  12334. return new MDCIconButtonToggle(root);
  12335. };
  12336. MDCIconButtonToggle.prototype.initialSyncWithDOM = function() {
  12337. var _this = this;
  12338. this.handleClick_ = function() {
  12339. return _this.foundation_.handleClick();
  12340. };
  12341. this.listen("click", this.handleClick_);
  12342. };
  12343. MDCIconButtonToggle.prototype.destroy = function() {
  12344. this.unlisten("click", this.handleClick_);
  12345. this.ripple_.destroy();
  12346. _super.prototype.destroy.call(this);
  12347. };
  12348. MDCIconButtonToggle.prototype.getDefaultFoundation = function() {
  12349. var _this = this;
  12350. var adapter = {
  12351. addClass: function addClass(className) {
  12352. return _this.root_.classList.add(className);
  12353. },
  12354. hasClass: function hasClass(className) {
  12355. return _this.root_.classList.contains(className);
  12356. },
  12357. notifyChange: function notifyChange(evtData) {
  12358. return _this.emit(strings.CHANGE_EVENT, evtData);
  12359. },
  12360. removeClass: function removeClass(className) {
  12361. return _this.root_.classList.remove(className);
  12362. },
  12363. setAttr: function setAttr(attrName, attrValue) {
  12364. return _this.root_.setAttribute(attrName, attrValue);
  12365. }
  12366. };
  12367. return new foundation_1.MDCIconButtonToggleFoundation(adapter);
  12368. };
  12369. Object.defineProperty(MDCIconButtonToggle.prototype, "ripple", {
  12370. get: function get() {
  12371. return this.ripple_;
  12372. },
  12373. enumerable: true,
  12374. configurable: true
  12375. });
  12376. Object.defineProperty(MDCIconButtonToggle.prototype, "on", {
  12377. get: function get() {
  12378. return this.foundation_.isOn();
  12379. },
  12380. set: function set(isOn) {
  12381. this.foundation_.toggle(isOn);
  12382. },
  12383. enumerable: true,
  12384. configurable: true
  12385. });
  12386. MDCIconButtonToggle.prototype.createRipple_ = function() {
  12387. var ripple = new component_2.MDCRipple(this.root_);
  12388. ripple.unbounded = true;
  12389. return ripple;
  12390. };
  12391. return MDCIconButtonToggle;
  12392. }(component_1.MDCComponent);
  12393. exports.MDCIconButtonToggle = MDCIconButtonToggle;
  12394. }, function(module, exports, __webpack_require__) {
  12395. "use strict";
  12396. Object.defineProperty(exports, "__esModule", {
  12397. value: true
  12398. });
  12399. exports.cssClasses = {
  12400. ICON_BUTTON_ON: "mdc-icon-button--on",
  12401. ROOT: "mdc-icon-button"
  12402. };
  12403. exports.strings = {
  12404. ARIA_PRESSED: "aria-pressed",
  12405. CHANGE_EVENT: "MDCIconButtonToggle:change"
  12406. };
  12407. }, function(module, exports, __webpack_require__) {
  12408. "use strict";
  12409. function __export(m) {
  12410. for (var p in m) {
  12411. if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  12412. }
  12413. }
  12414. Object.defineProperty(exports, "__esModule", {
  12415. value: true
  12416. });
  12417. __export(__webpack_require__(17));
  12418. __export(__webpack_require__(40));
  12419. }, function(module, exports, __webpack_require__) {
  12420. "use strict";
  12421. Object.defineProperty(exports, "__esModule", {
  12422. value: true
  12423. });
  12424. var cssClasses = {
  12425. LINE_RIPPLE_ACTIVE: "mdc-line-ripple--active",
  12426. LINE_RIPPLE_DEACTIVATING: "mdc-line-ripple--deactivating"
  12427. };
  12428. exports.cssClasses = cssClasses;
  12429. }, function(module, exports, __webpack_require__) {
  12430. "use strict";
  12431. function __export(m) {
  12432. for (var p in m) {
  12433. if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  12434. }
  12435. }
  12436. Object.defineProperty(exports, "__esModule", {
  12437. value: true
  12438. });
  12439. __export(__webpack_require__(116));
  12440. __export(__webpack_require__(41));
  12441. }, function(module, exports, __webpack_require__) {
  12442. "use strict";
  12443. var __extends = this && this.__extends || function() {
  12444. var _extendStatics = function extendStatics(d, b) {
  12445. _extendStatics = Object.setPrototypeOf || {
  12446. __proto__: []
  12447. } instanceof Array && function(d, b) {
  12448. d.__proto__ = b;
  12449. } || function(d, b) {
  12450. for (var p in b) {
  12451. if (b.hasOwnProperty(p)) d[p] = b[p];
  12452. }
  12453. };
  12454. return _extendStatics(d, b);
  12455. };
  12456. return function(d, b) {
  12457. _extendStatics(d, b);
  12458. function __() {
  12459. this.constructor = d;
  12460. }
  12461. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  12462. };
  12463. }();
  12464. Object.defineProperty(exports, "__esModule", {
  12465. value: true
  12466. });
  12467. var component_1 = __webpack_require__(1);
  12468. var foundation_1 = __webpack_require__(41);
  12469. var MDCLinearProgress = function(_super) {
  12470. __extends(MDCLinearProgress, _super);
  12471. function MDCLinearProgress() {
  12472. return _super !== null && _super.apply(this, arguments) || this;
  12473. }
  12474. MDCLinearProgress.attachTo = function(root) {
  12475. return new MDCLinearProgress(root);
  12476. };
  12477. Object.defineProperty(MDCLinearProgress.prototype, "determinate", {
  12478. set: function set(value) {
  12479. this.foundation_.setDeterminate(value);
  12480. },
  12481. enumerable: true,
  12482. configurable: true
  12483. });
  12484. Object.defineProperty(MDCLinearProgress.prototype, "progress", {
  12485. set: function set(value) {
  12486. this.foundation_.setProgress(value);
  12487. },
  12488. enumerable: true,
  12489. configurable: true
  12490. });
  12491. Object.defineProperty(MDCLinearProgress.prototype, "buffer", {
  12492. set: function set(value) {
  12493. this.foundation_.setBuffer(value);
  12494. },
  12495. enumerable: true,
  12496. configurable: true
  12497. });
  12498. Object.defineProperty(MDCLinearProgress.prototype, "reverse", {
  12499. set: function set(value) {
  12500. this.foundation_.setReverse(value);
  12501. },
  12502. enumerable: true,
  12503. configurable: true
  12504. });
  12505. MDCLinearProgress.prototype.open = function() {
  12506. this.foundation_.open();
  12507. };
  12508. MDCLinearProgress.prototype.close = function() {
  12509. this.foundation_.close();
  12510. };
  12511. MDCLinearProgress.prototype.getDefaultFoundation = function() {
  12512. var _this = this;
  12513. var adapter = {
  12514. addClass: function addClass(className) {
  12515. return _this.root_.classList.add(className);
  12516. },
  12517. getBuffer: function getBuffer() {
  12518. return _this.root_.querySelector(foundation_1.MDCLinearProgressFoundation.strings.BUFFER_SELECTOR);
  12519. },
  12520. getPrimaryBar: function getPrimaryBar() {
  12521. return _this.root_.querySelector(foundation_1.MDCLinearProgressFoundation.strings.PRIMARY_BAR_SELECTOR);
  12522. },
  12523. hasClass: function hasClass(className) {
  12524. return _this.root_.classList.contains(className);
  12525. },
  12526. removeClass: function removeClass(className) {
  12527. return _this.root_.classList.remove(className);
  12528. },
  12529. setStyle: function setStyle(el, styleProperty, value) {
  12530. return el.style.setProperty(styleProperty, value);
  12531. }
  12532. };
  12533. return new foundation_1.MDCLinearProgressFoundation(adapter);
  12534. };
  12535. return MDCLinearProgress;
  12536. }(component_1.MDCComponent);
  12537. exports.MDCLinearProgress = MDCLinearProgress;
  12538. }, function(module, exports, __webpack_require__) {
  12539. "use strict";
  12540. Object.defineProperty(exports, "__esModule", {
  12541. value: true
  12542. });
  12543. exports.cssClasses = {
  12544. CLOSED_CLASS: "mdc-linear-progress--closed",
  12545. INDETERMINATE_CLASS: "mdc-linear-progress--indeterminate",
  12546. REVERSED_CLASS: "mdc-linear-progress--reversed"
  12547. };
  12548. exports.strings = {
  12549. BUFFER_SELECTOR: ".mdc-linear-progress__buffer",
  12550. PRIMARY_BAR_SELECTOR: ".mdc-linear-progress__primary-bar"
  12551. };
  12552. }, function(module, exports, __webpack_require__) {
  12553. "use strict";
  12554. function __export(m) {
  12555. for (var p in m) {
  12556. if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  12557. }
  12558. }
  12559. Object.defineProperty(exports, "__esModule", {
  12560. value: true
  12561. });
  12562. __export(__webpack_require__(13));
  12563. __export(__webpack_require__(5));
  12564. }, function(module, exports, __webpack_require__) {
  12565. "use strict";
  12566. function __export(m) {
  12567. for (var p in m) {
  12568. if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  12569. }
  12570. }
  12571. var __importStar = this && this.__importStar || function(mod) {
  12572. if (mod && mod.__esModule) return mod;
  12573. var result = {};
  12574. if (mod != null) for (var k in mod) {
  12575. if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  12576. }
  12577. result["default"] = mod;
  12578. return result;
  12579. };
  12580. Object.defineProperty(exports, "__esModule", {
  12581. value: true
  12582. });
  12583. var util = __importStar(__webpack_require__(42));
  12584. exports.util = util;
  12585. var constants_1 = __webpack_require__(6);
  12586. exports.Corner = constants_1.Corner;
  12587. exports.CornerBit = constants_1.CornerBit;
  12588. __export(__webpack_require__(43));
  12589. __export(__webpack_require__(8));
  12590. }, function(module, exports, __webpack_require__) {
  12591. "use strict";
  12592. function __export(m) {
  12593. for (var p in m) {
  12594. if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  12595. }
  12596. }
  12597. Object.defineProperty(exports, "__esModule", {
  12598. value: true
  12599. });
  12600. var constants_1 = __webpack_require__(6);
  12601. exports.Corner = constants_1.Corner;
  12602. __export(__webpack_require__(44));
  12603. __export(__webpack_require__(45));
  12604. }, function(module, exports, __webpack_require__) {
  12605. "use strict";
  12606. function __export(m) {
  12607. for (var p in m) {
  12608. if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  12609. }
  12610. }
  12611. Object.defineProperty(exports, "__esModule", {
  12612. value: true
  12613. });
  12614. __export(__webpack_require__(19));
  12615. __export(__webpack_require__(47));
  12616. }, function(module, exports, __webpack_require__) {
  12617. "use strict";
  12618. function __export(m) {
  12619. for (var p in m) {
  12620. if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  12621. }
  12622. }
  12623. Object.defineProperty(exports, "__esModule", {
  12624. value: true
  12625. });
  12626. __export(__webpack_require__(123));
  12627. __export(__webpack_require__(48));
  12628. }, function(module, exports, __webpack_require__) {
  12629. "use strict";
  12630. var __extends = this && this.__extends || function() {
  12631. var _extendStatics = function extendStatics(d, b) {
  12632. _extendStatics = Object.setPrototypeOf || {
  12633. __proto__: []
  12634. } instanceof Array && function(d, b) {
  12635. d.__proto__ = b;
  12636. } || function(d, b) {
  12637. for (var p in b) {
  12638. if (b.hasOwnProperty(p)) d[p] = b[p];
  12639. }
  12640. };
  12641. return _extendStatics(d, b);
  12642. };
  12643. return function(d, b) {
  12644. _extendStatics(d, b);
  12645. function __() {
  12646. this.constructor = d;
  12647. }
  12648. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  12649. };
  12650. }();
  12651. var __assign = this && this.__assign || function() {
  12652. __assign = Object.assign || function(t) {
  12653. for (var s, i = 1, n = arguments.length; i < n; i++) {
  12654. s = arguments[i];
  12655. for (var p in s) {
  12656. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  12657. }
  12658. }
  12659. return t;
  12660. };
  12661. return __assign.apply(this, arguments);
  12662. };
  12663. Object.defineProperty(exports, "__esModule", {
  12664. value: true
  12665. });
  12666. var component_1 = __webpack_require__(1);
  12667. var component_2 = __webpack_require__(2);
  12668. var foundation_1 = __webpack_require__(4);
  12669. var foundation_2 = __webpack_require__(48);
  12670. var MDCRadio = function(_super) {
  12671. __extends(MDCRadio, _super);
  12672. function MDCRadio() {
  12673. var _this = _super !== null && _super.apply(this, arguments) || this;
  12674. _this.ripple_ = _this.createRipple_();
  12675. return _this;
  12676. }
  12677. MDCRadio.attachTo = function(root) {
  12678. return new MDCRadio(root);
  12679. };
  12680. Object.defineProperty(MDCRadio.prototype, "checked", {
  12681. get: function get() {
  12682. return this.nativeControl_.checked;
  12683. },
  12684. set: function set(checked) {
  12685. this.nativeControl_.checked = checked;
  12686. },
  12687. enumerable: true,
  12688. configurable: true
  12689. });
  12690. Object.defineProperty(MDCRadio.prototype, "disabled", {
  12691. get: function get() {
  12692. return this.nativeControl_.disabled;
  12693. },
  12694. set: function set(disabled) {
  12695. this.foundation_.setDisabled(disabled);
  12696. },
  12697. enumerable: true,
  12698. configurable: true
  12699. });
  12700. Object.defineProperty(MDCRadio.prototype, "value", {
  12701. get: function get() {
  12702. return this.nativeControl_.value;
  12703. },
  12704. set: function set(value) {
  12705. this.nativeControl_.value = value;
  12706. },
  12707. enumerable: true,
  12708. configurable: true
  12709. });
  12710. Object.defineProperty(MDCRadio.prototype, "ripple", {
  12711. get: function get() {
  12712. return this.ripple_;
  12713. },
  12714. enumerable: true,
  12715. configurable: true
  12716. });
  12717. MDCRadio.prototype.destroy = function() {
  12718. this.ripple_.destroy();
  12719. _super.prototype.destroy.call(this);
  12720. };
  12721. MDCRadio.prototype.getDefaultFoundation = function() {
  12722. var _this = this;
  12723. var adapter = {
  12724. addClass: function addClass(className) {
  12725. return _this.root_.classList.add(className);
  12726. },
  12727. removeClass: function removeClass(className) {
  12728. return _this.root_.classList.remove(className);
  12729. },
  12730. setNativeControlDisabled: function setNativeControlDisabled(disabled) {
  12731. return _this.nativeControl_.disabled = disabled;
  12732. }
  12733. };
  12734. return new foundation_2.MDCRadioFoundation(adapter);
  12735. };
  12736. MDCRadio.prototype.createRipple_ = function() {
  12737. var _this = this;
  12738. var adapter = __assign({}, component_2.MDCRipple.createAdapter(this), {
  12739. registerInteractionHandler: function registerInteractionHandler(evtType, handler) {
  12740. return _this.nativeControl_.addEventListener(evtType, handler);
  12741. },
  12742. deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) {
  12743. return _this.nativeControl_.removeEventListener(evtType, handler);
  12744. },
  12745. isSurfaceActive: function isSurfaceActive() {
  12746. return false;
  12747. },
  12748. isUnbounded: function isUnbounded() {
  12749. return true;
  12750. }
  12751. });
  12752. return new component_2.MDCRipple(this.root_, new foundation_1.MDCRippleFoundation(adapter));
  12753. };
  12754. Object.defineProperty(MDCRadio.prototype, "nativeControl_", {
  12755. get: function get() {
  12756. var NATIVE_CONTROL_SELECTOR = foundation_2.MDCRadioFoundation.strings.NATIVE_CONTROL_SELECTOR;
  12757. var el = this.root_.querySelector(NATIVE_CONTROL_SELECTOR);
  12758. if (!el) {
  12759. throw new Error("Radio component requires a " + NATIVE_CONTROL_SELECTOR + " element");
  12760. }
  12761. return el;
  12762. },
  12763. enumerable: true,
  12764. configurable: true
  12765. });
  12766. return MDCRadio;
  12767. }(component_1.MDCComponent);
  12768. exports.MDCRadio = MDCRadio;
  12769. }, function(module, exports, __webpack_require__) {
  12770. "use strict";
  12771. Object.defineProperty(exports, "__esModule", {
  12772. value: true
  12773. });
  12774. var strings = {
  12775. NATIVE_CONTROL_SELECTOR: ".mdc-radio__native-control"
  12776. };
  12777. exports.strings = strings;
  12778. var cssClasses = {
  12779. DISABLED: "mdc-radio--disabled",
  12780. ROOT: "mdc-radio"
  12781. };
  12782. exports.cssClasses = cssClasses;
  12783. }, function(module, exports, __webpack_require__) {
  12784. "use strict";
  12785. function __export(m) {
  12786. for (var p in m) {
  12787. if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  12788. }
  12789. }
  12790. var __importStar = this && this.__importStar || function(mod) {
  12791. if (mod && mod.__esModule) return mod;
  12792. var result = {};
  12793. if (mod != null) for (var k in mod) {
  12794. if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  12795. }
  12796. result["default"] = mod;
  12797. return result;
  12798. };
  12799. Object.defineProperty(exports, "__esModule", {
  12800. value: true
  12801. });
  12802. var util = __importStar(__webpack_require__(11));
  12803. exports.util = util;
  12804. __export(__webpack_require__(2));
  12805. __export(__webpack_require__(4));
  12806. }, function(module, exports, __webpack_require__) {
  12807. "use strict";
  12808. function __export(m) {
  12809. for (var p in m) {
  12810. if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  12811. }
  12812. }
  12813. Object.defineProperty(exports, "__esModule", {
  12814. value: true
  12815. });
  12816. __export(__webpack_require__(127));
  12817. __export(__webpack_require__(50));
  12818. __export(__webpack_require__(130));
  12819. __export(__webpack_require__(131));
  12820. }, function(module, exports, __webpack_require__) {
  12821. "use strict";
  12822. var __extends = this && this.__extends || function() {
  12823. var _extendStatics = function extendStatics(d, b) {
  12824. _extendStatics = Object.setPrototypeOf || {
  12825. __proto__: []
  12826. } instanceof Array && function(d, b) {
  12827. d.__proto__ = b;
  12828. } || function(d, b) {
  12829. for (var p in b) {
  12830. if (b.hasOwnProperty(p)) d[p] = b[p];
  12831. }
  12832. };
  12833. return _extendStatics(d, b);
  12834. };
  12835. return function(d, b) {
  12836. _extendStatics(d, b);
  12837. function __() {
  12838. this.constructor = d;
  12839. }
  12840. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  12841. };
  12842. }();
  12843. var __assign = this && this.__assign || function() {
  12844. __assign = Object.assign || function(t) {
  12845. for (var s, i = 1, n = arguments.length; i < n; i++) {
  12846. s = arguments[i];
  12847. for (var p in s) {
  12848. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  12849. }
  12850. }
  12851. return t;
  12852. };
  12853. return __assign.apply(this, arguments);
  12854. };
  12855. var __importStar = this && this.__importStar || function(mod) {
  12856. if (mod && mod.__esModule) return mod;
  12857. var result = {};
  12858. if (mod != null) for (var k in mod) {
  12859. if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  12860. }
  12861. result["default"] = mod;
  12862. return result;
  12863. };
  12864. Object.defineProperty(exports, "__esModule", {
  12865. value: true
  12866. });
  12867. var component_1 = __webpack_require__(1);
  12868. var component_2 = __webpack_require__(15);
  12869. var component_3 = __webpack_require__(17);
  12870. var menuSurfaceConstants = __importStar(__webpack_require__(6));
  12871. var component_4 = __webpack_require__(44);
  12872. var menuConstants = __importStar(__webpack_require__(18));
  12873. var component_5 = __webpack_require__(19);
  12874. var component_6 = __webpack_require__(2);
  12875. var foundation_1 = __webpack_require__(4);
  12876. var constants_1 = __webpack_require__(49);
  12877. var foundation_2 = __webpack_require__(50);
  12878. var component_7 = __webpack_require__(51);
  12879. var component_8 = __webpack_require__(53);
  12880. var VALIDATION_ATTR_WHITELIST = [ "required", "aria-required" ];
  12881. var MDCSelect = function(_super) {
  12882. __extends(MDCSelect, _super);
  12883. function MDCSelect() {
  12884. return _super !== null && _super.apply(this, arguments) || this;
  12885. }
  12886. MDCSelect.attachTo = function(root) {
  12887. return new MDCSelect(root);
  12888. };
  12889. MDCSelect.prototype.initialize = function(labelFactory, lineRippleFactory, outlineFactory, menuFactory, iconFactory, helperTextFactory) {
  12890. if (labelFactory === void 0) {
  12891. labelFactory = function labelFactory(el) {
  12892. return new component_2.MDCFloatingLabel(el);
  12893. };
  12894. }
  12895. if (lineRippleFactory === void 0) {
  12896. lineRippleFactory = function lineRippleFactory(el) {
  12897. return new component_3.MDCLineRipple(el);
  12898. };
  12899. }
  12900. if (outlineFactory === void 0) {
  12901. outlineFactory = function outlineFactory(el) {
  12902. return new component_5.MDCNotchedOutline(el);
  12903. };
  12904. }
  12905. if (menuFactory === void 0) {
  12906. menuFactory = function menuFactory(el) {
  12907. return new component_4.MDCMenu(el);
  12908. };
  12909. }
  12910. if (iconFactory === void 0) {
  12911. iconFactory = function iconFactory(el) {
  12912. return new component_8.MDCSelectIcon(el);
  12913. };
  12914. }
  12915. if (helperTextFactory === void 0) {
  12916. helperTextFactory = function helperTextFactory(el) {
  12917. return new component_7.MDCSelectHelperText(el);
  12918. };
  12919. }
  12920. this.isMenuOpen_ = false;
  12921. this.nativeControl_ = this.root_.querySelector(constants_1.strings.NATIVE_CONTROL_SELECTOR);
  12922. this.selectedText_ = this.root_.querySelector(constants_1.strings.SELECTED_TEXT_SELECTOR);
  12923. var targetElement = this.nativeControl_ || this.selectedText_;
  12924. if (!targetElement) {
  12925. throw new Error("MDCSelect: Missing required element: Exactly one of the following selectors must be present: " + ("'" + constants_1.strings.NATIVE_CONTROL_SELECTOR + "' or '" + constants_1.strings.SELECTED_TEXT_SELECTOR + "'"));
  12926. }
  12927. this.targetElement_ = targetElement;
  12928. if (this.targetElement_.hasAttribute(constants_1.strings.ARIA_CONTROLS)) {
  12929. var helperTextElement = document.getElementById(this.targetElement_.getAttribute(constants_1.strings.ARIA_CONTROLS));
  12930. if (helperTextElement) {
  12931. this.helperText_ = helperTextFactory(helperTextElement);
  12932. }
  12933. }
  12934. if (this.selectedText_) {
  12935. this.enhancedSelectSetup_(menuFactory);
  12936. }
  12937. var labelElement = this.root_.querySelector(constants_1.strings.LABEL_SELECTOR);
  12938. this.label_ = labelElement ? labelFactory(labelElement) : null;
  12939. var lineRippleElement = this.root_.querySelector(constants_1.strings.LINE_RIPPLE_SELECTOR);
  12940. this.lineRipple_ = lineRippleElement ? lineRippleFactory(lineRippleElement) : null;
  12941. var outlineElement = this.root_.querySelector(constants_1.strings.OUTLINE_SELECTOR);
  12942. this.outline_ = outlineElement ? outlineFactory(outlineElement) : null;
  12943. var leadingIcon = this.root_.querySelector(constants_1.strings.LEADING_ICON_SELECTOR);
  12944. if (leadingIcon) {
  12945. this.root_.classList.add(constants_1.cssClasses.WITH_LEADING_ICON);
  12946. this.leadingIcon_ = iconFactory(leadingIcon);
  12947. if (this.menuElement_) {
  12948. this.menuElement_.classList.add(constants_1.cssClasses.WITH_LEADING_ICON);
  12949. }
  12950. }
  12951. if (!this.root_.classList.contains(constants_1.cssClasses.OUTLINED)) {
  12952. this.ripple = this.createRipple_();
  12953. }
  12954. this.initialSyncRequiredState_();
  12955. this.addMutationObserverForRequired_();
  12956. };
  12957. MDCSelect.prototype.initialSyncWithDOM = function() {
  12958. var _this = this;
  12959. this.handleChange_ = function() {
  12960. return _this.foundation_.handleChange(true);
  12961. };
  12962. this.handleFocus_ = function() {
  12963. return _this.foundation_.handleFocus();
  12964. };
  12965. this.handleBlur_ = function() {
  12966. return _this.foundation_.handleBlur();
  12967. };
  12968. this.handleClick_ = function(evt) {
  12969. if (_this.selectedText_) {
  12970. _this.selectedText_.focus();
  12971. }
  12972. _this.foundation_.handleClick(_this.getNormalizedXCoordinate_(evt));
  12973. };
  12974. this.handleKeydown_ = function(evt) {
  12975. return _this.foundation_.handleKeydown(evt);
  12976. };
  12977. this.handleMenuSelected_ = function(evtData) {
  12978. return _this.selectedIndex = evtData.detail.index;
  12979. };
  12980. this.handleMenuOpened_ = function() {
  12981. if (_this.menu_.items.length === 0) {
  12982. return;
  12983. }
  12984. var focusItemIndex = _this.selectedIndex >= 0 ? _this.selectedIndex : 0;
  12985. var focusItemEl = _this.menu_.items[focusItemIndex];
  12986. focusItemEl.focus();
  12987. };
  12988. this.handleMenuClosed_ = function() {
  12989. _this.isMenuOpen_ = false;
  12990. _this.selectedText_.removeAttribute("aria-expanded");
  12991. if (document.activeElement !== _this.selectedText_) {
  12992. _this.foundation_.handleBlur();
  12993. }
  12994. };
  12995. this.targetElement_.addEventListener("change", this.handleChange_);
  12996. this.targetElement_.addEventListener("focus", this.handleFocus_);
  12997. this.targetElement_.addEventListener("blur", this.handleBlur_);
  12998. this.targetElement_.addEventListener("click", this.handleClick_);
  12999. if (this.menuElement_) {
  13000. this.selectedText_.addEventListener("keydown", this.handleKeydown_);
  13001. this.menu_.listen(menuSurfaceConstants.strings.CLOSED_EVENT, this.handleMenuClosed_);
  13002. this.menu_.listen(menuSurfaceConstants.strings.OPENED_EVENT, this.handleMenuOpened_);
  13003. this.menu_.listen(menuConstants.strings.SELECTED_EVENT, this.handleMenuSelected_);
  13004. if (this.hiddenInput_ && this.hiddenInput_.value) {
  13005. var enhancedAdapterMethods = this.getEnhancedSelectAdapterMethods_();
  13006. enhancedAdapterMethods.setValue(this.hiddenInput_.value);
  13007. } else if (this.menuElement_.querySelector(constants_1.strings.SELECTED_ITEM_SELECTOR)) {
  13008. var enhancedAdapterMethods = this.getEnhancedSelectAdapterMethods_();
  13009. enhancedAdapterMethods.setValue(enhancedAdapterMethods.getValue());
  13010. }
  13011. }
  13012. this.foundation_.handleChange(false);
  13013. if (this.root_.classList.contains(constants_1.cssClasses.DISABLED) || this.nativeControl_ && this.nativeControl_.disabled) {
  13014. this.disabled = true;
  13015. }
  13016. };
  13017. MDCSelect.prototype.destroy = function() {
  13018. this.targetElement_.removeEventListener("change", this.handleChange_);
  13019. this.targetElement_.removeEventListener("focus", this.handleFocus_);
  13020. this.targetElement_.removeEventListener("blur", this.handleBlur_);
  13021. this.targetElement_.removeEventListener("keydown", this.handleKeydown_);
  13022. this.targetElement_.removeEventListener("click", this.handleClick_);
  13023. if (this.menu_) {
  13024. this.menu_.unlisten(menuSurfaceConstants.strings.CLOSED_EVENT, this.handleMenuClosed_);
  13025. this.menu_.unlisten(menuSurfaceConstants.strings.OPENED_EVENT, this.handleMenuOpened_);
  13026. this.menu_.unlisten(menuConstants.strings.SELECTED_EVENT, this.handleMenuSelected_);
  13027. this.menu_.destroy();
  13028. }
  13029. if (this.ripple) {
  13030. this.ripple.destroy();
  13031. }
  13032. if (this.outline_) {
  13033. this.outline_.destroy();
  13034. }
  13035. if (this.leadingIcon_) {
  13036. this.leadingIcon_.destroy();
  13037. }
  13038. if (this.helperText_) {
  13039. this.helperText_.destroy();
  13040. }
  13041. if (this.validationObserver_) {
  13042. this.validationObserver_.disconnect();
  13043. }
  13044. _super.prototype.destroy.call(this);
  13045. };
  13046. Object.defineProperty(MDCSelect.prototype, "value", {
  13047. get: function get() {
  13048. return this.foundation_.getValue();
  13049. },
  13050. set: function set(value) {
  13051. this.foundation_.setValue(value);
  13052. },
  13053. enumerable: true,
  13054. configurable: true
  13055. });
  13056. Object.defineProperty(MDCSelect.prototype, "selectedIndex", {
  13057. get: function get() {
  13058. var selectedIndex = -1;
  13059. if (this.menuElement_ && this.menu_) {
  13060. var selectedEl = this.menuElement_.querySelector(constants_1.strings.SELECTED_ITEM_SELECTOR);
  13061. selectedIndex = this.menu_.items.indexOf(selectedEl);
  13062. } else if (this.nativeControl_) {
  13063. selectedIndex = this.nativeControl_.selectedIndex;
  13064. }
  13065. return selectedIndex;
  13066. },
  13067. set: function set(selectedIndex) {
  13068. this.foundation_.setSelectedIndex(selectedIndex);
  13069. },
  13070. enumerable: true,
  13071. configurable: true
  13072. });
  13073. Object.defineProperty(MDCSelect.prototype, "disabled", {
  13074. get: function get() {
  13075. return this.root_.classList.contains(constants_1.cssClasses.DISABLED) || (this.nativeControl_ ? this.nativeControl_.disabled : false);
  13076. },
  13077. set: function set(disabled) {
  13078. this.foundation_.setDisabled(disabled);
  13079. },
  13080. enumerable: true,
  13081. configurable: true
  13082. });
  13083. Object.defineProperty(MDCSelect.prototype, "leadingIconAriaLabel", {
  13084. set: function set(label) {
  13085. this.foundation_.setLeadingIconAriaLabel(label);
  13086. },
  13087. enumerable: true,
  13088. configurable: true
  13089. });
  13090. Object.defineProperty(MDCSelect.prototype, "leadingIconContent", {
  13091. set: function set(content) {
  13092. this.foundation_.setLeadingIconContent(content);
  13093. },
  13094. enumerable: true,
  13095. configurable: true
  13096. });
  13097. Object.defineProperty(MDCSelect.prototype, "helperTextContent", {
  13098. set: function set(content) {
  13099. this.foundation_.setHelperTextContent(content);
  13100. },
  13101. enumerable: true,
  13102. configurable: true
  13103. });
  13104. Object.defineProperty(MDCSelect.prototype, "valid", {
  13105. get: function get() {
  13106. return this.foundation_.isValid();
  13107. },
  13108. set: function set(isValid) {
  13109. this.foundation_.setValid(isValid);
  13110. },
  13111. enumerable: true,
  13112. configurable: true
  13113. });
  13114. Object.defineProperty(MDCSelect.prototype, "required", {
  13115. get: function get() {
  13116. if (this.nativeControl_) {
  13117. return this.nativeControl_.required;
  13118. } else {
  13119. return this.selectedText_.getAttribute("aria-required") === "true";
  13120. }
  13121. },
  13122. set: function set(isRequired) {
  13123. if (this.nativeControl_) {
  13124. this.nativeControl_.required = isRequired;
  13125. } else {
  13126. if (isRequired) {
  13127. this.selectedText_.setAttribute("aria-required", isRequired.toString());
  13128. } else {
  13129. this.selectedText_.removeAttribute("aria-required");
  13130. }
  13131. }
  13132. },
  13133. enumerable: true,
  13134. configurable: true
  13135. });
  13136. MDCSelect.prototype.layout = function() {
  13137. this.foundation_.layout();
  13138. };
  13139. MDCSelect.prototype.getDefaultFoundation = function() {
  13140. var adapter = __assign({}, this.nativeControl_ ? this.getNativeSelectAdapterMethods_() : this.getEnhancedSelectAdapterMethods_(), this.getCommonAdapterMethods_(), this.getOutlineAdapterMethods_(), this.getLabelAdapterMethods_());
  13141. return new foundation_2.MDCSelectFoundation(adapter, this.getFoundationMap_());
  13142. };
  13143. MDCSelect.prototype.enhancedSelectSetup_ = function(menuFactory) {
  13144. var isDisabled = this.root_.classList.contains(constants_1.cssClasses.DISABLED);
  13145. this.selectedText_.setAttribute("tabindex", isDisabled ? "-1" : "0");
  13146. this.hiddenInput_ = this.root_.querySelector(constants_1.strings.HIDDEN_INPUT_SELECTOR);
  13147. this.menuElement_ = this.root_.querySelector(constants_1.strings.MENU_SELECTOR);
  13148. this.menu_ = menuFactory(this.menuElement_);
  13149. this.menu_.hoistMenuToBody();
  13150. this.menu_.setAnchorElement(this.root_);
  13151. this.menu_.setAnchorCorner(menuSurfaceConstants.Corner.BOTTOM_START);
  13152. this.menu_.wrapFocus = false;
  13153. };
  13154. MDCSelect.prototype.createRipple_ = function() {
  13155. var _this = this;
  13156. var adapter = __assign({}, component_6.MDCRipple.createAdapter(this), {
  13157. registerInteractionHandler: function registerInteractionHandler(evtType, handler) {
  13158. return _this.targetElement_.addEventListener(evtType, handler);
  13159. },
  13160. deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) {
  13161. return _this.targetElement_.removeEventListener(evtType, handler);
  13162. }
  13163. });
  13164. return new component_6.MDCRipple(this.root_, new foundation_1.MDCRippleFoundation(adapter));
  13165. };
  13166. MDCSelect.prototype.getNativeSelectAdapterMethods_ = function() {
  13167. var _this = this;
  13168. return {
  13169. getValue: function getValue() {
  13170. return _this.nativeControl_.value;
  13171. },
  13172. setValue: function setValue(value) {
  13173. _this.nativeControl_.value = value;
  13174. },
  13175. openMenu: function openMenu() {
  13176. return undefined;
  13177. },
  13178. closeMenu: function closeMenu() {
  13179. return undefined;
  13180. },
  13181. isMenuOpen: function isMenuOpen() {
  13182. return false;
  13183. },
  13184. setSelectedIndex: function setSelectedIndex(index) {
  13185. _this.nativeControl_.selectedIndex = index;
  13186. },
  13187. setDisabled: function setDisabled(isDisabled) {
  13188. _this.nativeControl_.disabled = isDisabled;
  13189. },
  13190. setValid: function setValid(isValid) {
  13191. if (isValid) {
  13192. _this.root_.classList.remove(constants_1.cssClasses.INVALID);
  13193. } else {
  13194. _this.root_.classList.add(constants_1.cssClasses.INVALID);
  13195. }
  13196. },
  13197. checkValidity: function checkValidity() {
  13198. return _this.nativeControl_.checkValidity();
  13199. }
  13200. };
  13201. };
  13202. MDCSelect.prototype.getEnhancedSelectAdapterMethods_ = function() {
  13203. var _this = this;
  13204. return {
  13205. getValue: function getValue() {
  13206. var listItem = _this.menuElement_.querySelector(constants_1.strings.SELECTED_ITEM_SELECTOR);
  13207. if (listItem && listItem.hasAttribute(constants_1.strings.ENHANCED_VALUE_ATTR)) {
  13208. return listItem.getAttribute(constants_1.strings.ENHANCED_VALUE_ATTR) || "";
  13209. }
  13210. return "";
  13211. },
  13212. setValue: function setValue(value) {
  13213. var element = _this.menuElement_.querySelector("[" + constants_1.strings.ENHANCED_VALUE_ATTR + '="' + value + '"]');
  13214. _this.setEnhancedSelectedIndex_(element ? _this.menu_.items.indexOf(element) : -1);
  13215. },
  13216. openMenu: function openMenu() {
  13217. if (_this.menu_ && !_this.menu_.open) {
  13218. _this.menu_.open = true;
  13219. _this.isMenuOpen_ = true;
  13220. _this.selectedText_.setAttribute("aria-expanded", "true");
  13221. }
  13222. },
  13223. closeMenu: function closeMenu() {
  13224. if (_this.menu_ && _this.menu_.open) {
  13225. _this.menu_.open = false;
  13226. }
  13227. },
  13228. isMenuOpen: function isMenuOpen() {
  13229. return Boolean(_this.menu_) && _this.isMenuOpen_;
  13230. },
  13231. setSelectedIndex: function setSelectedIndex(index) {
  13232. return _this.setEnhancedSelectedIndex_(index);
  13233. },
  13234. setDisabled: function setDisabled(isDisabled) {
  13235. _this.selectedText_.setAttribute("tabindex", isDisabled ? "-1" : "0");
  13236. _this.selectedText_.setAttribute("aria-disabled", isDisabled.toString());
  13237. if (_this.hiddenInput_) {
  13238. _this.hiddenInput_.disabled = isDisabled;
  13239. }
  13240. },
  13241. checkValidity: function checkValidity() {
  13242. var classList = _this.root_.classList;
  13243. if (classList.contains(constants_1.cssClasses.REQUIRED) && !classList.contains(constants_1.cssClasses.DISABLED)) {
  13244. return _this.selectedIndex !== -1 && (_this.selectedIndex !== 0 || Boolean(_this.value));
  13245. } else {
  13246. return true;
  13247. }
  13248. },
  13249. setValid: function setValid(isValid) {
  13250. _this.selectedText_.setAttribute("aria-invalid", (!isValid).toString());
  13251. if (isValid) {
  13252. _this.root_.classList.remove(constants_1.cssClasses.INVALID);
  13253. } else {
  13254. _this.root_.classList.add(constants_1.cssClasses.INVALID);
  13255. }
  13256. }
  13257. };
  13258. };
  13259. MDCSelect.prototype.getCommonAdapterMethods_ = function() {
  13260. var _this = this;
  13261. return {
  13262. addClass: function addClass(className) {
  13263. return _this.root_.classList.add(className);
  13264. },
  13265. removeClass: function removeClass(className) {
  13266. return _this.root_.classList.remove(className);
  13267. },
  13268. hasClass: function hasClass(className) {
  13269. return _this.root_.classList.contains(className);
  13270. },
  13271. setRippleCenter: function setRippleCenter(normalizedX) {
  13272. return _this.lineRipple_ && _this.lineRipple_.setRippleCenter(normalizedX);
  13273. },
  13274. activateBottomLine: function activateBottomLine() {
  13275. return _this.lineRipple_ && _this.lineRipple_.activate();
  13276. },
  13277. deactivateBottomLine: function deactivateBottomLine() {
  13278. return _this.lineRipple_ && _this.lineRipple_.deactivate();
  13279. },
  13280. notifyChange: function notifyChange(value) {
  13281. var index = _this.selectedIndex;
  13282. _this.emit(constants_1.strings.CHANGE_EVENT, {
  13283. value: value,
  13284. index: index
  13285. }, true);
  13286. }
  13287. };
  13288. };
  13289. MDCSelect.prototype.getOutlineAdapterMethods_ = function() {
  13290. var _this = this;
  13291. return {
  13292. hasOutline: function hasOutline() {
  13293. return Boolean(_this.outline_);
  13294. },
  13295. notchOutline: function notchOutline(labelWidth) {
  13296. return _this.outline_ && _this.outline_.notch(labelWidth);
  13297. },
  13298. closeOutline: function closeOutline() {
  13299. return _this.outline_ && _this.outline_.closeNotch();
  13300. }
  13301. };
  13302. };
  13303. MDCSelect.prototype.getLabelAdapterMethods_ = function() {
  13304. var _this = this;
  13305. return {
  13306. floatLabel: function floatLabel(shouldFloat) {
  13307. return _this.label_ && _this.label_.float(shouldFloat);
  13308. },
  13309. getLabelWidth: function getLabelWidth() {
  13310. return _this.label_ ? _this.label_.getWidth() : 0;
  13311. }
  13312. };
  13313. };
  13314. MDCSelect.prototype.getNormalizedXCoordinate_ = function(evt) {
  13315. var targetClientRect = evt.target.getBoundingClientRect();
  13316. var xCoordinate = this.isTouchEvent_(evt) ? evt.touches[0].clientX : evt.clientX;
  13317. return xCoordinate - targetClientRect.left;
  13318. };
  13319. MDCSelect.prototype.isTouchEvent_ = function(evt) {
  13320. return Boolean(evt.touches);
  13321. };
  13322. MDCSelect.prototype.getFoundationMap_ = function() {
  13323. return {
  13324. helperText: this.helperText_ ? this.helperText_.foundation : undefined,
  13325. leadingIcon: this.leadingIcon_ ? this.leadingIcon_.foundation : undefined
  13326. };
  13327. };
  13328. MDCSelect.prototype.setEnhancedSelectedIndex_ = function(index) {
  13329. var selectedItem = this.menu_.items[index];
  13330. this.selectedText_.textContent = selectedItem ? selectedItem.textContent.trim() : "";
  13331. var previouslySelected = this.menuElement_.querySelector(constants_1.strings.SELECTED_ITEM_SELECTOR);
  13332. if (previouslySelected) {
  13333. previouslySelected.classList.remove(constants_1.cssClasses.SELECTED_ITEM_CLASS);
  13334. previouslySelected.removeAttribute(constants_1.strings.ARIA_SELECTED_ATTR);
  13335. }
  13336. if (selectedItem) {
  13337. selectedItem.classList.add(constants_1.cssClasses.SELECTED_ITEM_CLASS);
  13338. selectedItem.setAttribute(constants_1.strings.ARIA_SELECTED_ATTR, "true");
  13339. }
  13340. if (this.hiddenInput_) {
  13341. this.hiddenInput_.value = selectedItem ? selectedItem.getAttribute(constants_1.strings.ENHANCED_VALUE_ATTR) || "" : "";
  13342. }
  13343. this.layout();
  13344. };
  13345. MDCSelect.prototype.initialSyncRequiredState_ = function() {
  13346. var isRequired = this.targetElement_.required || this.targetElement_.getAttribute("aria-required") === "true" || this.root_.classList.contains(constants_1.cssClasses.REQUIRED);
  13347. if (isRequired) {
  13348. if (this.nativeControl_) {
  13349. this.nativeControl_.required = true;
  13350. } else {
  13351. this.selectedText_.setAttribute("aria-required", "true");
  13352. }
  13353. this.root_.classList.add(constants_1.cssClasses.REQUIRED);
  13354. }
  13355. };
  13356. MDCSelect.prototype.addMutationObserverForRequired_ = function() {
  13357. var _this = this;
  13358. var observerHandler = function observerHandler(attributesList) {
  13359. attributesList.some(function(attributeName) {
  13360. if (VALIDATION_ATTR_WHITELIST.indexOf(attributeName) === -1) {
  13361. return false;
  13362. }
  13363. if (_this.selectedText_) {
  13364. if (_this.selectedText_.getAttribute("aria-required") === "true") {
  13365. _this.root_.classList.add(constants_1.cssClasses.REQUIRED);
  13366. } else {
  13367. _this.root_.classList.remove(constants_1.cssClasses.REQUIRED);
  13368. }
  13369. } else {
  13370. if (_this.nativeControl_.required) {
  13371. _this.root_.classList.add(constants_1.cssClasses.REQUIRED);
  13372. } else {
  13373. _this.root_.classList.remove(constants_1.cssClasses.REQUIRED);
  13374. }
  13375. }
  13376. return true;
  13377. });
  13378. };
  13379. var getAttributesList = function getAttributesList(mutationsList) {
  13380. return mutationsList.map(function(mutation) {
  13381. return mutation.attributeName;
  13382. }).filter(function(attributeName) {
  13383. return attributeName;
  13384. });
  13385. };
  13386. var observer = new MutationObserver(function(mutationsList) {
  13387. return observerHandler(getAttributesList(mutationsList));
  13388. });
  13389. observer.observe(this.targetElement_, {
  13390. attributes: true
  13391. });
  13392. this.validationObserver_ = observer;
  13393. };
  13394. return MDCSelect;
  13395. }(component_1.MDCComponent);
  13396. exports.MDCSelect = MDCSelect;
  13397. }, function(module, exports, __webpack_require__) {
  13398. "use strict";
  13399. Object.defineProperty(exports, "__esModule", {
  13400. value: true
  13401. });
  13402. var strings = {
  13403. ARIA_HIDDEN: "aria-hidden",
  13404. ROLE: "role"
  13405. };
  13406. exports.strings = strings;
  13407. var cssClasses = {
  13408. HELPER_TEXT_PERSISTENT: "mdc-select-helper-text--persistent",
  13409. HELPER_TEXT_VALIDATION_MSG: "mdc-select-helper-text--validation-msg"
  13410. };
  13411. exports.cssClasses = cssClasses;
  13412. }, function(module, exports, __webpack_require__) {
  13413. "use strict";
  13414. Object.defineProperty(exports, "__esModule", {
  13415. value: true
  13416. });
  13417. var strings = {
  13418. ICON_EVENT: "MDCSelect:icon",
  13419. ICON_ROLE: "button"
  13420. };
  13421. exports.strings = strings;
  13422. }, function(module, exports, __webpack_require__) {
  13423. "use strict";
  13424. function __export(m) {
  13425. for (var p in m) {
  13426. if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  13427. }
  13428. }
  13429. Object.defineProperty(exports, "__esModule", {
  13430. value: true
  13431. });
  13432. __export(__webpack_require__(51));
  13433. __export(__webpack_require__(52));
  13434. }, function(module, exports, __webpack_require__) {
  13435. "use strict";
  13436. function __export(m) {
  13437. for (var p in m) {
  13438. if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  13439. }
  13440. }
  13441. Object.defineProperty(exports, "__esModule", {
  13442. value: true
  13443. });
  13444. __export(__webpack_require__(53));
  13445. __export(__webpack_require__(54));
  13446. }, function(module, exports, __webpack_require__) {
  13447. "use strict";
  13448. function __export(m) {
  13449. for (var p in m) {
  13450. if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  13451. }
  13452. }
  13453. Object.defineProperty(exports, "__esModule", {
  13454. value: true
  13455. });
  13456. __export(__webpack_require__(133));
  13457. __export(__webpack_require__(56));
  13458. }, function(module, exports, __webpack_require__) {
  13459. "use strict";
  13460. var __extends = this && this.__extends || function() {
  13461. var _extendStatics = function extendStatics(d, b) {
  13462. _extendStatics = Object.setPrototypeOf || {
  13463. __proto__: []
  13464. } instanceof Array && function(d, b) {
  13465. d.__proto__ = b;
  13466. } || function(d, b) {
  13467. for (var p in b) {
  13468. if (b.hasOwnProperty(p)) d[p] = b[p];
  13469. }
  13470. };
  13471. return _extendStatics(d, b);
  13472. };
  13473. return function(d, b) {
  13474. _extendStatics(d, b);
  13475. function __() {
  13476. this.constructor = d;
  13477. }
  13478. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  13479. };
  13480. }();
  13481. Object.defineProperty(exports, "__esModule", {
  13482. value: true
  13483. });
  13484. var component_1 = __webpack_require__(1);
  13485. var constants_1 = __webpack_require__(55);
  13486. var foundation_1 = __webpack_require__(56);
  13487. var MDCSlider = function(_super) {
  13488. __extends(MDCSlider, _super);
  13489. function MDCSlider() {
  13490. return _super !== null && _super.apply(this, arguments) || this;
  13491. }
  13492. MDCSlider.attachTo = function(root) {
  13493. return new MDCSlider(root);
  13494. };
  13495. Object.defineProperty(MDCSlider.prototype, "value", {
  13496. get: function get() {
  13497. return this.foundation_.getValue();
  13498. },
  13499. set: function set(value) {
  13500. this.foundation_.setValue(value);
  13501. },
  13502. enumerable: true,
  13503. configurable: true
  13504. });
  13505. Object.defineProperty(MDCSlider.prototype, "min", {
  13506. get: function get() {
  13507. return this.foundation_.getMin();
  13508. },
  13509. set: function set(min) {
  13510. this.foundation_.setMin(min);
  13511. },
  13512. enumerable: true,
  13513. configurable: true
  13514. });
  13515. Object.defineProperty(MDCSlider.prototype, "max", {
  13516. get: function get() {
  13517. return this.foundation_.getMax();
  13518. },
  13519. set: function set(max) {
  13520. this.foundation_.setMax(max);
  13521. },
  13522. enumerable: true,
  13523. configurable: true
  13524. });
  13525. Object.defineProperty(MDCSlider.prototype, "step", {
  13526. get: function get() {
  13527. return this.foundation_.getStep();
  13528. },
  13529. set: function set(step) {
  13530. this.foundation_.setStep(step);
  13531. },
  13532. enumerable: true,
  13533. configurable: true
  13534. });
  13535. Object.defineProperty(MDCSlider.prototype, "disabled", {
  13536. get: function get() {
  13537. return this.foundation_.isDisabled();
  13538. },
  13539. set: function set(disabled) {
  13540. this.foundation_.setDisabled(disabled);
  13541. },
  13542. enumerable: true,
  13543. configurable: true
  13544. });
  13545. MDCSlider.prototype.initialize = function() {
  13546. this.thumbContainer_ = this.root_.querySelector(constants_1.strings.THUMB_CONTAINER_SELECTOR);
  13547. this.track_ = this.root_.querySelector(constants_1.strings.TRACK_SELECTOR);
  13548. this.pinValueMarker_ = this.root_.querySelector(constants_1.strings.PIN_VALUE_MARKER_SELECTOR);
  13549. this.trackMarkerContainer_ = this.root_.querySelector(constants_1.strings.TRACK_MARKER_CONTAINER_SELECTOR);
  13550. };
  13551. MDCSlider.prototype.getDefaultFoundation = function() {
  13552. var _this = this;
  13553. var adapter = {
  13554. hasClass: function hasClass(className) {
  13555. return _this.root_.classList.contains(className);
  13556. },
  13557. addClass: function addClass(className) {
  13558. return _this.root_.classList.add(className);
  13559. },
  13560. removeClass: function removeClass(className) {
  13561. return _this.root_.classList.remove(className);
  13562. },
  13563. getAttribute: function getAttribute(name) {
  13564. return _this.root_.getAttribute(name);
  13565. },
  13566. setAttribute: function setAttribute(name, value) {
  13567. return _this.root_.setAttribute(name, value);
  13568. },
  13569. removeAttribute: function removeAttribute(name) {
  13570. return _this.root_.removeAttribute(name);
  13571. },
  13572. computeBoundingRect: function computeBoundingRect() {
  13573. return _this.root_.getBoundingClientRect();
  13574. },
  13575. getTabIndex: function getTabIndex() {
  13576. return _this.root_.tabIndex;
  13577. },
  13578. registerInteractionHandler: function registerInteractionHandler(evtType, handler) {
  13579. return _this.listen(evtType, handler);
  13580. },
  13581. deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) {
  13582. return _this.unlisten(evtType, handler);
  13583. },
  13584. registerThumbContainerInteractionHandler: function registerThumbContainerInteractionHandler(evtType, handler) {
  13585. _this.thumbContainer_.addEventListener(evtType, handler);
  13586. },
  13587. deregisterThumbContainerInteractionHandler: function deregisterThumbContainerInteractionHandler(evtType, handler) {
  13588. _this.thumbContainer_.removeEventListener(evtType, handler);
  13589. },
  13590. registerBodyInteractionHandler: function registerBodyInteractionHandler(evtType, handler) {
  13591. return document.body.addEventListener(evtType, handler);
  13592. },
  13593. deregisterBodyInteractionHandler: function deregisterBodyInteractionHandler(evtType, handler) {
  13594. return document.body.removeEventListener(evtType, handler);
  13595. },
  13596. registerResizeHandler: function registerResizeHandler(handler) {
  13597. return window.addEventListener("resize", handler);
  13598. },
  13599. deregisterResizeHandler: function deregisterResizeHandler(handler) {
  13600. return window.removeEventListener("resize", handler);
  13601. },
  13602. notifyInput: function notifyInput() {
  13603. return _this.emit(constants_1.strings.INPUT_EVENT, _this);
  13604. },
  13605. notifyChange: function notifyChange() {
  13606. return _this.emit(constants_1.strings.CHANGE_EVENT, _this);
  13607. },
  13608. setThumbContainerStyleProperty: function setThumbContainerStyleProperty(propertyName, value) {
  13609. _this.thumbContainer_.style.setProperty(propertyName, value);
  13610. },
  13611. setTrackStyleProperty: function setTrackStyleProperty(propertyName, value) {
  13612. return _this.track_.style.setProperty(propertyName, value);
  13613. },
  13614. setMarkerValue: function setMarkerValue(value) {
  13615. return _this.pinValueMarker_.innerText = value.toLocaleString();
  13616. },
  13617. appendTrackMarkers: function appendTrackMarkers(numMarkers) {
  13618. var frag = document.createDocumentFragment();
  13619. for (var i = 0; i < numMarkers; i++) {
  13620. var marker = document.createElement("div");
  13621. marker.classList.add("mdc-slider__track-marker");
  13622. frag.appendChild(marker);
  13623. }
  13624. _this.trackMarkerContainer_.appendChild(frag);
  13625. },
  13626. removeTrackMarkers: function removeTrackMarkers() {
  13627. while (_this.trackMarkerContainer_.firstChild) {
  13628. _this.trackMarkerContainer_.removeChild(_this.trackMarkerContainer_.firstChild);
  13629. }
  13630. },
  13631. setLastTrackMarkersStyleProperty: function setLastTrackMarkersStyleProperty(propertyName, value) {
  13632. var lastTrackMarker = _this.root_.querySelector(constants_1.strings.LAST_TRACK_MARKER_SELECTOR);
  13633. lastTrackMarker.style.setProperty(propertyName, value);
  13634. },
  13635. isRTL: function isRTL() {
  13636. return getComputedStyle(_this.root_).direction === "rtl";
  13637. }
  13638. };
  13639. return new foundation_1.MDCSliderFoundation(adapter);
  13640. };
  13641. MDCSlider.prototype.initialSyncWithDOM = function() {
  13642. var origValueNow = this.parseFloat_(this.root_.getAttribute(constants_1.strings.ARIA_VALUENOW), this.value);
  13643. var min = this.parseFloat_(this.root_.getAttribute(constants_1.strings.ARIA_VALUEMIN), this.min);
  13644. var max = this.parseFloat_(this.root_.getAttribute(constants_1.strings.ARIA_VALUEMAX), this.max);
  13645. if (min >= this.max) {
  13646. this.max = max;
  13647. this.min = min;
  13648. } else {
  13649. this.min = min;
  13650. this.max = max;
  13651. }
  13652. this.step = this.parseFloat_(this.root_.getAttribute(constants_1.strings.STEP_DATA_ATTR), this.step);
  13653. this.value = origValueNow;
  13654. this.disabled = this.root_.hasAttribute(constants_1.strings.ARIA_DISABLED) && this.root_.getAttribute(constants_1.strings.ARIA_DISABLED) !== "false";
  13655. this.foundation_.setupTrackMarker();
  13656. };
  13657. MDCSlider.prototype.layout = function() {
  13658. this.foundation_.layout();
  13659. };
  13660. MDCSlider.prototype.stepUp = function(amount) {
  13661. if (amount === void 0) {
  13662. amount = this.step || 1;
  13663. }
  13664. this.value += amount;
  13665. };
  13666. MDCSlider.prototype.stepDown = function(amount) {
  13667. if (amount === void 0) {
  13668. amount = this.step || 1;
  13669. }
  13670. this.value -= amount;
  13671. };
  13672. MDCSlider.prototype.parseFloat_ = function(str, defaultValue) {
  13673. var num = parseFloat(str);
  13674. var isNumeric = typeof num === "number" && isFinite(num);
  13675. return isNumeric ? num : defaultValue;
  13676. };
  13677. return MDCSlider;
  13678. }(component_1.MDCComponent);
  13679. exports.MDCSlider = MDCSlider;
  13680. }, function(module, exports, __webpack_require__) {
  13681. "use strict";
  13682. function __export(m) {
  13683. for (var p in m) {
  13684. if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  13685. }
  13686. }
  13687. var __importStar = this && this.__importStar || function(mod) {
  13688. if (mod && mod.__esModule) return mod;
  13689. var result = {};
  13690. if (mod != null) for (var k in mod) {
  13691. if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  13692. }
  13693. result["default"] = mod;
  13694. return result;
  13695. };
  13696. Object.defineProperty(exports, "__esModule", {
  13697. value: true
  13698. });
  13699. var util = __importStar(__webpack_require__(57));
  13700. exports.util = util;
  13701. __export(__webpack_require__(135));
  13702. __export(__webpack_require__(58));
  13703. }, function(module, exports, __webpack_require__) {
  13704. "use strict";
  13705. var __extends = this && this.__extends || function() {
  13706. var _extendStatics = function extendStatics(d, b) {
  13707. _extendStatics = Object.setPrototypeOf || {
  13708. __proto__: []
  13709. } instanceof Array && function(d, b) {
  13710. d.__proto__ = b;
  13711. } || function(d, b) {
  13712. for (var p in b) {
  13713. if (b.hasOwnProperty(p)) d[p] = b[p];
  13714. }
  13715. };
  13716. return _extendStatics(d, b);
  13717. };
  13718. return function(d, b) {
  13719. _extendStatics(d, b);
  13720. function __() {
  13721. this.constructor = d;
  13722. }
  13723. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  13724. };
  13725. }();
  13726. var __importStar = this && this.__importStar || function(mod) {
  13727. if (mod && mod.__esModule) return mod;
  13728. var result = {};
  13729. if (mod != null) for (var k in mod) {
  13730. if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  13731. }
  13732. result["default"] = mod;
  13733. return result;
  13734. };
  13735. Object.defineProperty(exports, "__esModule", {
  13736. value: true
  13737. });
  13738. var component_1 = __webpack_require__(1);
  13739. var ponyfill_1 = __webpack_require__(3);
  13740. var constants_1 = __webpack_require__(20);
  13741. var foundation_1 = __webpack_require__(58);
  13742. var util = __importStar(__webpack_require__(57));
  13743. var SURFACE_SELECTOR = constants_1.strings.SURFACE_SELECTOR, LABEL_SELECTOR = constants_1.strings.LABEL_SELECTOR, ACTION_SELECTOR = constants_1.strings.ACTION_SELECTOR, DISMISS_SELECTOR = constants_1.strings.DISMISS_SELECTOR, OPENING_EVENT = constants_1.strings.OPENING_EVENT, OPENED_EVENT = constants_1.strings.OPENED_EVENT, CLOSING_EVENT = constants_1.strings.CLOSING_EVENT, CLOSED_EVENT = constants_1.strings.CLOSED_EVENT;
  13744. var MDCSnackbar = function(_super) {
  13745. __extends(MDCSnackbar, _super);
  13746. function MDCSnackbar() {
  13747. return _super !== null && _super.apply(this, arguments) || this;
  13748. }
  13749. MDCSnackbar.attachTo = function(root) {
  13750. return new MDCSnackbar(root);
  13751. };
  13752. MDCSnackbar.prototype.initialize = function(announcerFactory) {
  13753. if (announcerFactory === void 0) {
  13754. announcerFactory = function announcerFactory() {
  13755. return util.announce;
  13756. };
  13757. }
  13758. this.announce_ = announcerFactory();
  13759. };
  13760. MDCSnackbar.prototype.initialSyncWithDOM = function() {
  13761. var _this = this;
  13762. this.surfaceEl_ = this.root_.querySelector(SURFACE_SELECTOR);
  13763. this.labelEl_ = this.root_.querySelector(LABEL_SELECTOR);
  13764. this.actionEl_ = this.root_.querySelector(ACTION_SELECTOR);
  13765. this.handleKeyDown_ = function(evt) {
  13766. return _this.foundation_.handleKeyDown(evt);
  13767. };
  13768. this.handleSurfaceClick_ = function(evt) {
  13769. var target = evt.target;
  13770. if (_this.isActionButton_(target)) {
  13771. _this.foundation_.handleActionButtonClick(evt);
  13772. } else if (_this.isActionIcon_(target)) {
  13773. _this.foundation_.handleActionIconClick(evt);
  13774. }
  13775. };
  13776. this.registerKeyDownHandler_(this.handleKeyDown_);
  13777. this.registerSurfaceClickHandler_(this.handleSurfaceClick_);
  13778. };
  13779. MDCSnackbar.prototype.destroy = function() {
  13780. _super.prototype.destroy.call(this);
  13781. this.deregisterKeyDownHandler_(this.handleKeyDown_);
  13782. this.deregisterSurfaceClickHandler_(this.handleSurfaceClick_);
  13783. };
  13784. MDCSnackbar.prototype.open = function() {
  13785. this.foundation_.open();
  13786. };
  13787. MDCSnackbar.prototype.close = function(reason) {
  13788. if (reason === void 0) {
  13789. reason = "";
  13790. }
  13791. this.foundation_.close(reason);
  13792. };
  13793. MDCSnackbar.prototype.getDefaultFoundation = function() {
  13794. var _this = this;
  13795. var adapter = {
  13796. addClass: function addClass(className) {
  13797. return _this.root_.classList.add(className);
  13798. },
  13799. announce: function announce() {
  13800. return _this.announce_(_this.labelEl_);
  13801. },
  13802. notifyClosed: function notifyClosed(reason) {
  13803. return _this.emit(CLOSED_EVENT, reason ? {
  13804. reason: reason
  13805. } : {});
  13806. },
  13807. notifyClosing: function notifyClosing(reason) {
  13808. return _this.emit(CLOSING_EVENT, reason ? {
  13809. reason: reason
  13810. } : {});
  13811. },
  13812. notifyOpened: function notifyOpened() {
  13813. return _this.emit(OPENED_EVENT, {});
  13814. },
  13815. notifyOpening: function notifyOpening() {
  13816. return _this.emit(OPENING_EVENT, {});
  13817. },
  13818. removeClass: function removeClass(className) {
  13819. return _this.root_.classList.remove(className);
  13820. }
  13821. };
  13822. return new foundation_1.MDCSnackbarFoundation(adapter);
  13823. };
  13824. Object.defineProperty(MDCSnackbar.prototype, "timeoutMs", {
  13825. get: function get() {
  13826. return this.foundation_.getTimeoutMs();
  13827. },
  13828. set: function set(timeoutMs) {
  13829. this.foundation_.setTimeoutMs(timeoutMs);
  13830. },
  13831. enumerable: true,
  13832. configurable: true
  13833. });
  13834. Object.defineProperty(MDCSnackbar.prototype, "closeOnEscape", {
  13835. get: function get() {
  13836. return this.foundation_.getCloseOnEscape();
  13837. },
  13838. set: function set(closeOnEscape) {
  13839. this.foundation_.setCloseOnEscape(closeOnEscape);
  13840. },
  13841. enumerable: true,
  13842. configurable: true
  13843. });
  13844. Object.defineProperty(MDCSnackbar.prototype, "isOpen", {
  13845. get: function get() {
  13846. return this.foundation_.isOpen();
  13847. },
  13848. enumerable: true,
  13849. configurable: true
  13850. });
  13851. Object.defineProperty(MDCSnackbar.prototype, "labelText", {
  13852. get: function get() {
  13853. return this.labelEl_.textContent;
  13854. },
  13855. set: function set(labelText) {
  13856. this.labelEl_.textContent = labelText;
  13857. },
  13858. enumerable: true,
  13859. configurable: true
  13860. });
  13861. Object.defineProperty(MDCSnackbar.prototype, "actionButtonText", {
  13862. get: function get() {
  13863. return this.actionEl_.textContent;
  13864. },
  13865. set: function set(actionButtonText) {
  13866. this.actionEl_.textContent = actionButtonText;
  13867. },
  13868. enumerable: true,
  13869. configurable: true
  13870. });
  13871. MDCSnackbar.prototype.registerKeyDownHandler_ = function(handler) {
  13872. this.listen("keydown", handler);
  13873. };
  13874. MDCSnackbar.prototype.deregisterKeyDownHandler_ = function(handler) {
  13875. this.unlisten("keydown", handler);
  13876. };
  13877. MDCSnackbar.prototype.registerSurfaceClickHandler_ = function(handler) {
  13878. this.surfaceEl_.addEventListener("click", handler);
  13879. };
  13880. MDCSnackbar.prototype.deregisterSurfaceClickHandler_ = function(handler) {
  13881. this.surfaceEl_.removeEventListener("click", handler);
  13882. };
  13883. MDCSnackbar.prototype.isActionButton_ = function(target) {
  13884. return Boolean(ponyfill_1.closest(target, ACTION_SELECTOR));
  13885. };
  13886. MDCSnackbar.prototype.isActionIcon_ = function(target) {
  13887. return Boolean(ponyfill_1.closest(target, DISMISS_SELECTOR));
  13888. };
  13889. return MDCSnackbar;
  13890. }(component_1.MDCComponent);
  13891. exports.MDCSnackbar = MDCSnackbar;
  13892. }, function(module, exports, __webpack_require__) {
  13893. "use strict";
  13894. function __export(m) {
  13895. for (var p in m) {
  13896. if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  13897. }
  13898. }
  13899. Object.defineProperty(exports, "__esModule", {
  13900. value: true
  13901. });
  13902. __export(__webpack_require__(137));
  13903. __export(__webpack_require__(59));
  13904. }, function(module, exports, __webpack_require__) {
  13905. "use strict";
  13906. var __extends = this && this.__extends || function() {
  13907. var _extendStatics = function extendStatics(d, b) {
  13908. _extendStatics = Object.setPrototypeOf || {
  13909. __proto__: []
  13910. } instanceof Array && function(d, b) {
  13911. d.__proto__ = b;
  13912. } || function(d, b) {
  13913. for (var p in b) {
  13914. if (b.hasOwnProperty(p)) d[p] = b[p];
  13915. }
  13916. };
  13917. return _extendStatics(d, b);
  13918. };
  13919. return function(d, b) {
  13920. _extendStatics(d, b);
  13921. function __() {
  13922. this.constructor = d;
  13923. }
  13924. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  13925. };
  13926. }();
  13927. var __assign = this && this.__assign || function() {
  13928. __assign = Object.assign || function(t) {
  13929. for (var s, i = 1, n = arguments.length; i < n; i++) {
  13930. s = arguments[i];
  13931. for (var p in s) {
  13932. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  13933. }
  13934. }
  13935. return t;
  13936. };
  13937. return __assign.apply(this, arguments);
  13938. };
  13939. var __read = this && this.__read || function(o, n) {
  13940. var m = typeof Symbol === "function" && o[Symbol.iterator];
  13941. if (!m) return o;
  13942. var i = m.call(o), r, ar = [], e;
  13943. try {
  13944. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
  13945. ar.push(r.value);
  13946. }
  13947. } catch (error) {
  13948. e = {
  13949. error: error
  13950. };
  13951. } finally {
  13952. try {
  13953. if (r && !r.done && (m = i["return"])) m.call(i);
  13954. } finally {
  13955. if (e) throw e.error;
  13956. }
  13957. }
  13958. return ar;
  13959. };
  13960. var __spread = this && this.__spread || function() {
  13961. for (var ar = [], i = 0; i < arguments.length; i++) {
  13962. ar = ar.concat(__read(arguments[i]));
  13963. }
  13964. return ar;
  13965. };
  13966. Object.defineProperty(exports, "__esModule", {
  13967. value: true
  13968. });
  13969. var component_1 = __webpack_require__(1);
  13970. var ponyfill_1 = __webpack_require__(3);
  13971. var component_2 = __webpack_require__(2);
  13972. var foundation_1 = __webpack_require__(4);
  13973. var foundation_2 = __webpack_require__(59);
  13974. var MDCSwitch = function(_super) {
  13975. __extends(MDCSwitch, _super);
  13976. function MDCSwitch() {
  13977. var _this = _super !== null && _super.apply(this, arguments) || this;
  13978. _this.ripple_ = _this.createRipple_();
  13979. return _this;
  13980. }
  13981. MDCSwitch.attachTo = function(root) {
  13982. return new MDCSwitch(root);
  13983. };
  13984. MDCSwitch.prototype.destroy = function() {
  13985. _super.prototype.destroy.call(this);
  13986. this.ripple_.destroy();
  13987. this.nativeControl_.removeEventListener("change", this.changeHandler_);
  13988. };
  13989. MDCSwitch.prototype.initialSyncWithDOM = function() {
  13990. var _this = this;
  13991. this.changeHandler_ = function() {
  13992. var args = [];
  13993. for (var _i = 0; _i < arguments.length; _i++) {
  13994. args[_i] = arguments[_i];
  13995. }
  13996. var _a;
  13997. return (_a = _this.foundation_).handleChange.apply(_a, __spread(args));
  13998. };
  13999. this.nativeControl_.addEventListener("change", this.changeHandler_);
  14000. this.checked = this.checked;
  14001. };
  14002. MDCSwitch.prototype.getDefaultFoundation = function() {
  14003. var _this = this;
  14004. var adapter = {
  14005. addClass: function addClass(className) {
  14006. return _this.root_.classList.add(className);
  14007. },
  14008. removeClass: function removeClass(className) {
  14009. return _this.root_.classList.remove(className);
  14010. },
  14011. setNativeControlChecked: function setNativeControlChecked(checked) {
  14012. return _this.nativeControl_.checked = checked;
  14013. },
  14014. setNativeControlDisabled: function setNativeControlDisabled(disabled) {
  14015. return _this.nativeControl_.disabled = disabled;
  14016. }
  14017. };
  14018. return new foundation_2.MDCSwitchFoundation(adapter);
  14019. };
  14020. Object.defineProperty(MDCSwitch.prototype, "ripple", {
  14021. get: function get() {
  14022. return this.ripple_;
  14023. },
  14024. enumerable: true,
  14025. configurable: true
  14026. });
  14027. Object.defineProperty(MDCSwitch.prototype, "checked", {
  14028. get: function get() {
  14029. return this.nativeControl_.checked;
  14030. },
  14031. set: function set(checked) {
  14032. this.foundation_.setChecked(checked);
  14033. },
  14034. enumerable: true,
  14035. configurable: true
  14036. });
  14037. Object.defineProperty(MDCSwitch.prototype, "disabled", {
  14038. get: function get() {
  14039. return this.nativeControl_.disabled;
  14040. },
  14041. set: function set(disabled) {
  14042. this.foundation_.setDisabled(disabled);
  14043. },
  14044. enumerable: true,
  14045. configurable: true
  14046. });
  14047. MDCSwitch.prototype.createRipple_ = function() {
  14048. var _this = this;
  14049. var RIPPLE_SURFACE_SELECTOR = foundation_2.MDCSwitchFoundation.strings.RIPPLE_SURFACE_SELECTOR;
  14050. var rippleSurface = this.root_.querySelector(RIPPLE_SURFACE_SELECTOR);
  14051. var adapter = __assign({}, component_2.MDCRipple.createAdapter(this), {
  14052. addClass: function addClass(className) {
  14053. return rippleSurface.classList.add(className);
  14054. },
  14055. computeBoundingRect: function computeBoundingRect() {
  14056. return rippleSurface.getBoundingClientRect();
  14057. },
  14058. deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) {
  14059. _this.nativeControl_.removeEventListener(evtType, handler);
  14060. },
  14061. isSurfaceActive: function isSurfaceActive() {
  14062. return ponyfill_1.matches(_this.nativeControl_, ":active");
  14063. },
  14064. isUnbounded: function isUnbounded() {
  14065. return true;
  14066. },
  14067. registerInteractionHandler: function registerInteractionHandler(evtType, handler) {
  14068. _this.nativeControl_.addEventListener(evtType, handler);
  14069. },
  14070. removeClass: function removeClass(className) {
  14071. return rippleSurface.classList.remove(className);
  14072. },
  14073. updateCssVariable: function updateCssVariable(varName, value) {
  14074. rippleSurface.style.setProperty(varName, value);
  14075. }
  14076. });
  14077. return new component_2.MDCRipple(this.root_, new foundation_1.MDCRippleFoundation(adapter));
  14078. };
  14079. Object.defineProperty(MDCSwitch.prototype, "nativeControl_", {
  14080. get: function get() {
  14081. var NATIVE_CONTROL_SELECTOR = foundation_2.MDCSwitchFoundation.strings.NATIVE_CONTROL_SELECTOR;
  14082. return this.root_.querySelector(NATIVE_CONTROL_SELECTOR);
  14083. },
  14084. enumerable: true,
  14085. configurable: true
  14086. });
  14087. return MDCSwitch;
  14088. }(component_1.MDCComponent);
  14089. exports.MDCSwitch = MDCSwitch;
  14090. }, function(module, exports, __webpack_require__) {
  14091. "use strict";
  14092. Object.defineProperty(exports, "__esModule", {
  14093. value: true
  14094. });
  14095. var cssClasses = {
  14096. CHECKED: "mdc-switch--checked",
  14097. DISABLED: "mdc-switch--disabled"
  14098. };
  14099. exports.cssClasses = cssClasses;
  14100. var strings = {
  14101. NATIVE_CONTROL_SELECTOR: ".mdc-switch__native-control",
  14102. RIPPLE_SURFACE_SELECTOR: ".mdc-switch__thumb-underlay"
  14103. };
  14104. exports.strings = strings;
  14105. }, function(module, exports, __webpack_require__) {
  14106. "use strict";
  14107. function __export(m) {
  14108. for (var p in m) {
  14109. if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  14110. }
  14111. }
  14112. Object.defineProperty(exports, "__esModule", {
  14113. value: true
  14114. });
  14115. __export(__webpack_require__(140));
  14116. __export(__webpack_require__(68));
  14117. }, function(module, exports, __webpack_require__) {
  14118. "use strict";
  14119. var __extends = this && this.__extends || function() {
  14120. var _extendStatics = function extendStatics(d, b) {
  14121. _extendStatics = Object.setPrototypeOf || {
  14122. __proto__: []
  14123. } instanceof Array && function(d, b) {
  14124. d.__proto__ = b;
  14125. } || function(d, b) {
  14126. for (var p in b) {
  14127. if (b.hasOwnProperty(p)) d[p] = b[p];
  14128. }
  14129. };
  14130. return _extendStatics(d, b);
  14131. };
  14132. return function(d, b) {
  14133. _extendStatics(d, b);
  14134. function __() {
  14135. this.constructor = d;
  14136. }
  14137. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  14138. };
  14139. }();
  14140. Object.defineProperty(exports, "__esModule", {
  14141. value: true
  14142. });
  14143. var component_1 = __webpack_require__(1);
  14144. var component_2 = __webpack_require__(60);
  14145. var component_3 = __webpack_require__(64);
  14146. var foundation_1 = __webpack_require__(22);
  14147. var foundation_2 = __webpack_require__(68);
  14148. var strings = foundation_2.MDCTabBarFoundation.strings;
  14149. var tabIdCounter = 0;
  14150. var MDCTabBar = function(_super) {
  14151. __extends(MDCTabBar, _super);
  14152. function MDCTabBar() {
  14153. return _super !== null && _super.apply(this, arguments) || this;
  14154. }
  14155. MDCTabBar.attachTo = function(root) {
  14156. return new MDCTabBar(root);
  14157. };
  14158. Object.defineProperty(MDCTabBar.prototype, "focusOnActivate", {
  14159. set: function set(focusOnActivate) {
  14160. this.tabList_.forEach(function(tab) {
  14161. return tab.focusOnActivate = focusOnActivate;
  14162. });
  14163. },
  14164. enumerable: true,
  14165. configurable: true
  14166. });
  14167. Object.defineProperty(MDCTabBar.prototype, "useAutomaticActivation", {
  14168. set: function set(useAutomaticActivation) {
  14169. this.foundation_.setUseAutomaticActivation(useAutomaticActivation);
  14170. },
  14171. enumerable: true,
  14172. configurable: true
  14173. });
  14174. MDCTabBar.prototype.initialize = function(tabFactory, tabScrollerFactory) {
  14175. if (tabFactory === void 0) {
  14176. tabFactory = function tabFactory(el) {
  14177. return new component_3.MDCTab(el);
  14178. };
  14179. }
  14180. if (tabScrollerFactory === void 0) {
  14181. tabScrollerFactory = function tabScrollerFactory(el) {
  14182. return new component_2.MDCTabScroller(el);
  14183. };
  14184. }
  14185. this.tabList_ = this.instantiateTabs_(tabFactory);
  14186. this.tabScroller_ = this.instantiateTabScroller_(tabScrollerFactory);
  14187. };
  14188. MDCTabBar.prototype.initialSyncWithDOM = function() {
  14189. var _this = this;
  14190. this.handleTabInteraction_ = function(evt) {
  14191. return _this.foundation_.handleTabInteraction(evt);
  14192. };
  14193. this.handleKeyDown_ = function(evt) {
  14194. return _this.foundation_.handleKeyDown(evt);
  14195. };
  14196. this.listen(foundation_1.MDCTabFoundation.strings.INTERACTED_EVENT, this.handleTabInteraction_);
  14197. this.listen("keydown", this.handleKeyDown_);
  14198. for (var i = 0; i < this.tabList_.length; i++) {
  14199. if (this.tabList_[i].active) {
  14200. this.scrollIntoView(i);
  14201. break;
  14202. }
  14203. }
  14204. };
  14205. MDCTabBar.prototype.destroy = function() {
  14206. _super.prototype.destroy.call(this);
  14207. this.unlisten(foundation_1.MDCTabFoundation.strings.INTERACTED_EVENT, this.handleTabInteraction_);
  14208. this.unlisten("keydown", this.handleKeyDown_);
  14209. this.tabList_.forEach(function(tab) {
  14210. return tab.destroy();
  14211. });
  14212. if (this.tabScroller_) {
  14213. this.tabScroller_.destroy();
  14214. }
  14215. };
  14216. MDCTabBar.prototype.getDefaultFoundation = function() {
  14217. var _this = this;
  14218. var adapter = {
  14219. scrollTo: function scrollTo(scrollX) {
  14220. return _this.tabScroller_.scrollTo(scrollX);
  14221. },
  14222. incrementScroll: function incrementScroll(scrollXIncrement) {
  14223. return _this.tabScroller_.incrementScroll(scrollXIncrement);
  14224. },
  14225. getScrollPosition: function getScrollPosition() {
  14226. return _this.tabScroller_.getScrollPosition();
  14227. },
  14228. getScrollContentWidth: function getScrollContentWidth() {
  14229. return _this.tabScroller_.getScrollContentWidth();
  14230. },
  14231. getOffsetWidth: function getOffsetWidth() {
  14232. return _this.root_.offsetWidth;
  14233. },
  14234. isRTL: function isRTL() {
  14235. return window.getComputedStyle(_this.root_).getPropertyValue("direction") === "rtl";
  14236. },
  14237. setActiveTab: function setActiveTab(index) {
  14238. return _this.foundation_.activateTab(index);
  14239. },
  14240. activateTabAtIndex: function activateTabAtIndex(index, clientRect) {
  14241. return _this.tabList_[index].activate(clientRect);
  14242. },
  14243. deactivateTabAtIndex: function deactivateTabAtIndex(index) {
  14244. return _this.tabList_[index].deactivate();
  14245. },
  14246. focusTabAtIndex: function focusTabAtIndex(index) {
  14247. return _this.tabList_[index].focus();
  14248. },
  14249. getTabIndicatorClientRectAtIndex: function getTabIndicatorClientRectAtIndex(index) {
  14250. return _this.tabList_[index].computeIndicatorClientRect();
  14251. },
  14252. getTabDimensionsAtIndex: function getTabDimensionsAtIndex(index) {
  14253. return _this.tabList_[index].computeDimensions();
  14254. },
  14255. getPreviousActiveTabIndex: function getPreviousActiveTabIndex() {
  14256. for (var i = 0; i < _this.tabList_.length; i++) {
  14257. if (_this.tabList_[i].active) {
  14258. return i;
  14259. }
  14260. }
  14261. return -1;
  14262. },
  14263. getFocusedTabIndex: function getFocusedTabIndex() {
  14264. var tabElements = _this.getTabElements_();
  14265. var activeElement = document.activeElement;
  14266. return tabElements.indexOf(activeElement);
  14267. },
  14268. getIndexOfTabById: function getIndexOfTabById(id) {
  14269. for (var i = 0; i < _this.tabList_.length; i++) {
  14270. if (_this.tabList_[i].id === id) {
  14271. return i;
  14272. }
  14273. }
  14274. return -1;
  14275. },
  14276. getTabListLength: function getTabListLength() {
  14277. return _this.tabList_.length;
  14278. },
  14279. notifyTabActivated: function notifyTabActivated(index) {
  14280. return _this.emit(strings.TAB_ACTIVATED_EVENT, {
  14281. index: index
  14282. }, true);
  14283. }
  14284. };
  14285. return new foundation_2.MDCTabBarFoundation(adapter);
  14286. };
  14287. MDCTabBar.prototype.activateTab = function(index) {
  14288. this.foundation_.activateTab(index);
  14289. };
  14290. MDCTabBar.prototype.scrollIntoView = function(index) {
  14291. this.foundation_.scrollIntoView(index);
  14292. };
  14293. MDCTabBar.prototype.getTabElements_ = function() {
  14294. return [].slice.call(this.root_.querySelectorAll(strings.TAB_SELECTOR));
  14295. };
  14296. MDCTabBar.prototype.instantiateTabs_ = function(tabFactory) {
  14297. return this.getTabElements_().map(function(el) {
  14298. el.id = el.id || "mdc-tab-" + ++tabIdCounter;
  14299. return tabFactory(el);
  14300. });
  14301. };
  14302. MDCTabBar.prototype.instantiateTabScroller_ = function(tabScrollerFactory) {
  14303. var tabScrollerElement = this.root_.querySelector(strings.TAB_SCROLLER_SELECTOR);
  14304. if (tabScrollerElement) {
  14305. return tabScrollerFactory(tabScrollerElement);
  14306. }
  14307. return null;
  14308. };
  14309. return MDCTabBar;
  14310. }(component_1.MDCComponent);
  14311. exports.MDCTabBar = MDCTabBar;
  14312. }, function(module, exports, __webpack_require__) {
  14313. "use strict";
  14314. var __extends = this && this.__extends || function() {
  14315. var _extendStatics = function extendStatics(d, b) {
  14316. _extendStatics = Object.setPrototypeOf || {
  14317. __proto__: []
  14318. } instanceof Array && function(d, b) {
  14319. d.__proto__ = b;
  14320. } || function(d, b) {
  14321. for (var p in b) {
  14322. if (b.hasOwnProperty(p)) d[p] = b[p];
  14323. }
  14324. };
  14325. return _extendStatics(d, b);
  14326. };
  14327. return function(d, b) {
  14328. _extendStatics(d, b);
  14329. function __() {
  14330. this.constructor = d;
  14331. }
  14332. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  14333. };
  14334. }();
  14335. Object.defineProperty(exports, "__esModule", {
  14336. value: true
  14337. });
  14338. var rtl_scroller_1 = __webpack_require__(21);
  14339. var MDCTabScrollerRTLDefault = function(_super) {
  14340. __extends(MDCTabScrollerRTLDefault, _super);
  14341. function MDCTabScrollerRTLDefault() {
  14342. return _super !== null && _super.apply(this, arguments) || this;
  14343. }
  14344. MDCTabScrollerRTLDefault.prototype.getScrollPositionRTL = function() {
  14345. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  14346. var right = this.calculateScrollEdges_().right;
  14347. return Math.round(right - currentScrollLeft);
  14348. };
  14349. MDCTabScrollerRTLDefault.prototype.scrollToRTL = function(scrollX) {
  14350. var edges = this.calculateScrollEdges_();
  14351. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  14352. var clampedScrollLeft = this.clampScrollValue_(edges.right - scrollX);
  14353. return {
  14354. finalScrollPosition: clampedScrollLeft,
  14355. scrollDelta: clampedScrollLeft - currentScrollLeft
  14356. };
  14357. };
  14358. MDCTabScrollerRTLDefault.prototype.incrementScrollRTL = function(scrollX) {
  14359. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  14360. var clampedScrollLeft = this.clampScrollValue_(currentScrollLeft - scrollX);
  14361. return {
  14362. finalScrollPosition: clampedScrollLeft,
  14363. scrollDelta: clampedScrollLeft - currentScrollLeft
  14364. };
  14365. };
  14366. MDCTabScrollerRTLDefault.prototype.getAnimatingScrollPosition = function(scrollX) {
  14367. return scrollX;
  14368. };
  14369. MDCTabScrollerRTLDefault.prototype.calculateScrollEdges_ = function() {
  14370. var contentWidth = this.adapter_.getScrollContentOffsetWidth();
  14371. var rootWidth = this.adapter_.getScrollAreaOffsetWidth();
  14372. return {
  14373. left: 0,
  14374. right: contentWidth - rootWidth
  14375. };
  14376. };
  14377. MDCTabScrollerRTLDefault.prototype.clampScrollValue_ = function(scrollX) {
  14378. var edges = this.calculateScrollEdges_();
  14379. return Math.min(Math.max(edges.left, scrollX), edges.right);
  14380. };
  14381. return MDCTabScrollerRTLDefault;
  14382. }(rtl_scroller_1.MDCTabScrollerRTL);
  14383. exports.MDCTabScrollerRTLDefault = MDCTabScrollerRTLDefault;
  14384. exports.default = MDCTabScrollerRTLDefault;
  14385. }, function(module, exports, __webpack_require__) {
  14386. "use strict";
  14387. var __extends = this && this.__extends || function() {
  14388. var _extendStatics = function extendStatics(d, b) {
  14389. _extendStatics = Object.setPrototypeOf || {
  14390. __proto__: []
  14391. } instanceof Array && function(d, b) {
  14392. d.__proto__ = b;
  14393. } || function(d, b) {
  14394. for (var p in b) {
  14395. if (b.hasOwnProperty(p)) d[p] = b[p];
  14396. }
  14397. };
  14398. return _extendStatics(d, b);
  14399. };
  14400. return function(d, b) {
  14401. _extendStatics(d, b);
  14402. function __() {
  14403. this.constructor = d;
  14404. }
  14405. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  14406. };
  14407. }();
  14408. Object.defineProperty(exports, "__esModule", {
  14409. value: true
  14410. });
  14411. var rtl_scroller_1 = __webpack_require__(21);
  14412. var MDCTabScrollerRTLNegative = function(_super) {
  14413. __extends(MDCTabScrollerRTLNegative, _super);
  14414. function MDCTabScrollerRTLNegative() {
  14415. return _super !== null && _super.apply(this, arguments) || this;
  14416. }
  14417. MDCTabScrollerRTLNegative.prototype.getScrollPositionRTL = function(translateX) {
  14418. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  14419. return Math.round(translateX - currentScrollLeft);
  14420. };
  14421. MDCTabScrollerRTLNegative.prototype.scrollToRTL = function(scrollX) {
  14422. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  14423. var clampedScrollLeft = this.clampScrollValue_(-scrollX);
  14424. return {
  14425. finalScrollPosition: clampedScrollLeft,
  14426. scrollDelta: clampedScrollLeft - currentScrollLeft
  14427. };
  14428. };
  14429. MDCTabScrollerRTLNegative.prototype.incrementScrollRTL = function(scrollX) {
  14430. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  14431. var clampedScrollLeft = this.clampScrollValue_(currentScrollLeft - scrollX);
  14432. return {
  14433. finalScrollPosition: clampedScrollLeft,
  14434. scrollDelta: clampedScrollLeft - currentScrollLeft
  14435. };
  14436. };
  14437. MDCTabScrollerRTLNegative.prototype.getAnimatingScrollPosition = function(scrollX, translateX) {
  14438. return scrollX - translateX;
  14439. };
  14440. MDCTabScrollerRTLNegative.prototype.calculateScrollEdges_ = function() {
  14441. var contentWidth = this.adapter_.getScrollContentOffsetWidth();
  14442. var rootWidth = this.adapter_.getScrollAreaOffsetWidth();
  14443. return {
  14444. left: rootWidth - contentWidth,
  14445. right: 0
  14446. };
  14447. };
  14448. MDCTabScrollerRTLNegative.prototype.clampScrollValue_ = function(scrollX) {
  14449. var edges = this.calculateScrollEdges_();
  14450. return Math.max(Math.min(edges.right, scrollX), edges.left);
  14451. };
  14452. return MDCTabScrollerRTLNegative;
  14453. }(rtl_scroller_1.MDCTabScrollerRTL);
  14454. exports.MDCTabScrollerRTLNegative = MDCTabScrollerRTLNegative;
  14455. exports.default = MDCTabScrollerRTLNegative;
  14456. }, function(module, exports, __webpack_require__) {
  14457. "use strict";
  14458. var __extends = this && this.__extends || function() {
  14459. var _extendStatics = function extendStatics(d, b) {
  14460. _extendStatics = Object.setPrototypeOf || {
  14461. __proto__: []
  14462. } instanceof Array && function(d, b) {
  14463. d.__proto__ = b;
  14464. } || function(d, b) {
  14465. for (var p in b) {
  14466. if (b.hasOwnProperty(p)) d[p] = b[p];
  14467. }
  14468. };
  14469. return _extendStatics(d, b);
  14470. };
  14471. return function(d, b) {
  14472. _extendStatics(d, b);
  14473. function __() {
  14474. this.constructor = d;
  14475. }
  14476. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  14477. };
  14478. }();
  14479. Object.defineProperty(exports, "__esModule", {
  14480. value: true
  14481. });
  14482. var rtl_scroller_1 = __webpack_require__(21);
  14483. var MDCTabScrollerRTLReverse = function(_super) {
  14484. __extends(MDCTabScrollerRTLReverse, _super);
  14485. function MDCTabScrollerRTLReverse() {
  14486. return _super !== null && _super.apply(this, arguments) || this;
  14487. }
  14488. MDCTabScrollerRTLReverse.prototype.getScrollPositionRTL = function(translateX) {
  14489. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  14490. return Math.round(currentScrollLeft - translateX);
  14491. };
  14492. MDCTabScrollerRTLReverse.prototype.scrollToRTL = function(scrollX) {
  14493. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  14494. var clampedScrollLeft = this.clampScrollValue_(scrollX);
  14495. return {
  14496. finalScrollPosition: clampedScrollLeft,
  14497. scrollDelta: currentScrollLeft - clampedScrollLeft
  14498. };
  14499. };
  14500. MDCTabScrollerRTLReverse.prototype.incrementScrollRTL = function(scrollX) {
  14501. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  14502. var clampedScrollLeft = this.clampScrollValue_(currentScrollLeft + scrollX);
  14503. return {
  14504. finalScrollPosition: clampedScrollLeft,
  14505. scrollDelta: currentScrollLeft - clampedScrollLeft
  14506. };
  14507. };
  14508. MDCTabScrollerRTLReverse.prototype.getAnimatingScrollPosition = function(scrollX, translateX) {
  14509. return scrollX + translateX;
  14510. };
  14511. MDCTabScrollerRTLReverse.prototype.calculateScrollEdges_ = function() {
  14512. var contentWidth = this.adapter_.getScrollContentOffsetWidth();
  14513. var rootWidth = this.adapter_.getScrollAreaOffsetWidth();
  14514. return {
  14515. left: contentWidth - rootWidth,
  14516. right: 0
  14517. };
  14518. };
  14519. MDCTabScrollerRTLReverse.prototype.clampScrollValue_ = function(scrollX) {
  14520. var edges = this.calculateScrollEdges_();
  14521. return Math.min(Math.max(edges.right, scrollX), edges.left);
  14522. };
  14523. return MDCTabScrollerRTLReverse;
  14524. }(rtl_scroller_1.MDCTabScrollerRTL);
  14525. exports.MDCTabScrollerRTLReverse = MDCTabScrollerRTLReverse;
  14526. exports.default = MDCTabScrollerRTLReverse;
  14527. }, function(module, exports, __webpack_require__) {
  14528. "use strict";
  14529. Object.defineProperty(exports, "__esModule", {
  14530. value: true
  14531. });
  14532. var cssClasses = {
  14533. ACTIVE: "mdc-tab-indicator--active",
  14534. FADE: "mdc-tab-indicator--fade",
  14535. NO_TRANSITION: "mdc-tab-indicator--no-transition"
  14536. };
  14537. exports.cssClasses = cssClasses;
  14538. var strings = {
  14539. CONTENT_SELECTOR: ".mdc-tab-indicator__content"
  14540. };
  14541. exports.strings = strings;
  14542. }, function(module, exports, __webpack_require__) {
  14543. "use strict";
  14544. Object.defineProperty(exports, "__esModule", {
  14545. value: true
  14546. });
  14547. var cssClasses = {
  14548. ACTIVE: "mdc-tab--active"
  14549. };
  14550. exports.cssClasses = cssClasses;
  14551. var strings = {
  14552. ARIA_SELECTED: "aria-selected",
  14553. CONTENT_SELECTOR: ".mdc-tab__content",
  14554. INTERACTED_EVENT: "MDCTab:interacted",
  14555. RIPPLE_SELECTOR: ".mdc-tab__ripple",
  14556. TABINDEX: "tabIndex",
  14557. TAB_INDICATOR_SELECTOR: ".mdc-tab-indicator"
  14558. };
  14559. exports.strings = strings;
  14560. }, function(module, exports, __webpack_require__) {
  14561. "use strict";
  14562. Object.defineProperty(exports, "__esModule", {
  14563. value: true
  14564. });
  14565. var strings = {
  14566. ARROW_LEFT_KEY: "ArrowLeft",
  14567. ARROW_RIGHT_KEY: "ArrowRight",
  14568. END_KEY: "End",
  14569. ENTER_KEY: "Enter",
  14570. HOME_KEY: "Home",
  14571. SPACE_KEY: "Space",
  14572. TAB_ACTIVATED_EVENT: "MDCTabBar:activated",
  14573. TAB_SCROLLER_SELECTOR: ".mdc-tab-scroller",
  14574. TAB_SELECTOR: ".mdc-tab"
  14575. };
  14576. exports.strings = strings;
  14577. var numbers = {
  14578. ARROW_LEFT_KEYCODE: 37,
  14579. ARROW_RIGHT_KEYCODE: 39,
  14580. END_KEYCODE: 35,
  14581. ENTER_KEYCODE: 13,
  14582. EXTRA_SCROLL_AMOUNT: 20,
  14583. HOME_KEYCODE: 36,
  14584. SPACE_KEYCODE: 32
  14585. };
  14586. exports.numbers = numbers;
  14587. }, function(module, exports, __webpack_require__) {
  14588. "use strict";
  14589. function __export(m) {
  14590. for (var p in m) {
  14591. if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  14592. }
  14593. }
  14594. Object.defineProperty(exports, "__esModule", {
  14595. value: true
  14596. });
  14597. __export(__webpack_require__(65));
  14598. __export(__webpack_require__(9));
  14599. __export(__webpack_require__(66));
  14600. __export(__webpack_require__(67));
  14601. }, function(module, exports, __webpack_require__) {
  14602. "use strict";
  14603. function __export(m) {
  14604. for (var p in m) {
  14605. if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  14606. }
  14607. }
  14608. var __importStar = this && this.__importStar || function(mod) {
  14609. if (mod && mod.__esModule) return mod;
  14610. var result = {};
  14611. if (mod != null) for (var k in mod) {
  14612. if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  14613. }
  14614. result["default"] = mod;
  14615. return result;
  14616. };
  14617. Object.defineProperty(exports, "__esModule", {
  14618. value: true
  14619. });
  14620. var util = __importStar(__webpack_require__(63));
  14621. exports.util = util;
  14622. __export(__webpack_require__(60));
  14623. __export(__webpack_require__(61));
  14624. }, function(module, exports, __webpack_require__) {
  14625. "use strict";
  14626. function __export(m) {
  14627. for (var p in m) {
  14628. if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  14629. }
  14630. }
  14631. Object.defineProperty(exports, "__esModule", {
  14632. value: true
  14633. });
  14634. __export(__webpack_require__(64));
  14635. __export(__webpack_require__(22));
  14636. }, function(module, exports, __webpack_require__) {
  14637. "use strict";
  14638. function __export(m) {
  14639. for (var p in m) {
  14640. if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  14641. }
  14642. }
  14643. Object.defineProperty(exports, "__esModule", {
  14644. value: true
  14645. });
  14646. __export(__webpack_require__(151));
  14647. __export(__webpack_require__(71));
  14648. __export(__webpack_require__(155));
  14649. __export(__webpack_require__(156));
  14650. __export(__webpack_require__(157));
  14651. }, function(module, exports, __webpack_require__) {
  14652. "use strict";
  14653. var __extends = this && this.__extends || function() {
  14654. var _extendStatics = function extendStatics(d, b) {
  14655. _extendStatics = Object.setPrototypeOf || {
  14656. __proto__: []
  14657. } instanceof Array && function(d, b) {
  14658. d.__proto__ = b;
  14659. } || function(d, b) {
  14660. for (var p in b) {
  14661. if (b.hasOwnProperty(p)) d[p] = b[p];
  14662. }
  14663. };
  14664. return _extendStatics(d, b);
  14665. };
  14666. return function(d, b) {
  14667. _extendStatics(d, b);
  14668. function __() {
  14669. this.constructor = d;
  14670. }
  14671. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  14672. };
  14673. }();
  14674. var __assign = this && this.__assign || function() {
  14675. __assign = Object.assign || function(t) {
  14676. for (var s, i = 1, n = arguments.length; i < n; i++) {
  14677. s = arguments[i];
  14678. for (var p in s) {
  14679. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  14680. }
  14681. }
  14682. return t;
  14683. };
  14684. return __assign.apply(this, arguments);
  14685. };
  14686. var __importStar = this && this.__importStar || function(mod) {
  14687. if (mod && mod.__esModule) return mod;
  14688. var result = {};
  14689. if (mod != null) for (var k in mod) {
  14690. if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  14691. }
  14692. result["default"] = mod;
  14693. return result;
  14694. };
  14695. Object.defineProperty(exports, "__esModule", {
  14696. value: true
  14697. });
  14698. var component_1 = __webpack_require__(1);
  14699. var ponyfill = __importStar(__webpack_require__(3));
  14700. var component_2 = __webpack_require__(15);
  14701. var component_3 = __webpack_require__(17);
  14702. var component_4 = __webpack_require__(19);
  14703. var component_5 = __webpack_require__(2);
  14704. var foundation_1 = __webpack_require__(4);
  14705. var component_6 = __webpack_require__(69);
  14706. var foundation_2 = __webpack_require__(23);
  14707. var constants_1 = __webpack_require__(70);
  14708. var foundation_3 = __webpack_require__(71);
  14709. var component_7 = __webpack_require__(72);
  14710. var foundation_4 = __webpack_require__(24);
  14711. var component_8 = __webpack_require__(73);
  14712. var MDCTextField = function(_super) {
  14713. __extends(MDCTextField, _super);
  14714. function MDCTextField() {
  14715. return _super !== null && _super.apply(this, arguments) || this;
  14716. }
  14717. MDCTextField.attachTo = function(root) {
  14718. return new MDCTextField(root);
  14719. };
  14720. MDCTextField.prototype.initialize = function(rippleFactory, lineRippleFactory, helperTextFactory, characterCounterFactory, iconFactory, labelFactory, outlineFactory) {
  14721. if (rippleFactory === void 0) {
  14722. rippleFactory = function rippleFactory(el, foundation) {
  14723. return new component_5.MDCRipple(el, foundation);
  14724. };
  14725. }
  14726. if (lineRippleFactory === void 0) {
  14727. lineRippleFactory = function lineRippleFactory(el) {
  14728. return new component_3.MDCLineRipple(el);
  14729. };
  14730. }
  14731. if (helperTextFactory === void 0) {
  14732. helperTextFactory = function helperTextFactory(el) {
  14733. return new component_7.MDCTextFieldHelperText(el);
  14734. };
  14735. }
  14736. if (characterCounterFactory === void 0) {
  14737. characterCounterFactory = function characterCounterFactory(el) {
  14738. return new component_6.MDCTextFieldCharacterCounter(el);
  14739. };
  14740. }
  14741. if (iconFactory === void 0) {
  14742. iconFactory = function iconFactory(el) {
  14743. return new component_8.MDCTextFieldIcon(el);
  14744. };
  14745. }
  14746. if (labelFactory === void 0) {
  14747. labelFactory = function labelFactory(el) {
  14748. return new component_2.MDCFloatingLabel(el);
  14749. };
  14750. }
  14751. if (outlineFactory === void 0) {
  14752. outlineFactory = function outlineFactory(el) {
  14753. return new component_4.MDCNotchedOutline(el);
  14754. };
  14755. }
  14756. this.input_ = this.root_.querySelector(constants_1.strings.INPUT_SELECTOR);
  14757. var labelElement = this.root_.querySelector(constants_1.strings.LABEL_SELECTOR);
  14758. this.label_ = labelElement ? labelFactory(labelElement) : null;
  14759. var lineRippleElement = this.root_.querySelector(constants_1.strings.LINE_RIPPLE_SELECTOR);
  14760. this.lineRipple_ = lineRippleElement ? lineRippleFactory(lineRippleElement) : null;
  14761. var outlineElement = this.root_.querySelector(constants_1.strings.OUTLINE_SELECTOR);
  14762. this.outline_ = outlineElement ? outlineFactory(outlineElement) : null;
  14763. var helperTextStrings = foundation_4.MDCTextFieldHelperTextFoundation.strings;
  14764. var nextElementSibling = this.root_.nextElementSibling;
  14765. var hasHelperLine = nextElementSibling && nextElementSibling.classList.contains(constants_1.cssClasses.HELPER_LINE);
  14766. var helperTextEl = hasHelperLine && nextElementSibling && nextElementSibling.querySelector(helperTextStrings.ROOT_SELECTOR);
  14767. this.helperText_ = helperTextEl ? helperTextFactory(helperTextEl) : null;
  14768. var characterCounterStrings = foundation_2.MDCTextFieldCharacterCounterFoundation.strings;
  14769. var characterCounterEl = this.root_.querySelector(characterCounterStrings.ROOT_SELECTOR);
  14770. if (!characterCounterEl && hasHelperLine && nextElementSibling) {
  14771. characterCounterEl = nextElementSibling.querySelector(characterCounterStrings.ROOT_SELECTOR);
  14772. }
  14773. this.characterCounter_ = characterCounterEl ? characterCounterFactory(characterCounterEl) : null;
  14774. this.leadingIcon_ = null;
  14775. this.trailingIcon_ = null;
  14776. var iconElements = this.root_.querySelectorAll(constants_1.strings.ICON_SELECTOR);
  14777. if (iconElements.length > 0) {
  14778. if (iconElements.length > 1) {
  14779. this.leadingIcon_ = iconFactory(iconElements[0]);
  14780. this.trailingIcon_ = iconFactory(iconElements[1]);
  14781. } else {
  14782. if (this.root_.classList.contains(constants_1.cssClasses.WITH_LEADING_ICON)) {
  14783. this.leadingIcon_ = iconFactory(iconElements[0]);
  14784. } else {
  14785. this.trailingIcon_ = iconFactory(iconElements[0]);
  14786. }
  14787. }
  14788. }
  14789. this.ripple = this.createRipple_(rippleFactory);
  14790. };
  14791. MDCTextField.prototype.destroy = function() {
  14792. if (this.ripple) {
  14793. this.ripple.destroy();
  14794. }
  14795. if (this.lineRipple_) {
  14796. this.lineRipple_.destroy();
  14797. }
  14798. if (this.helperText_) {
  14799. this.helperText_.destroy();
  14800. }
  14801. if (this.characterCounter_) {
  14802. this.characterCounter_.destroy();
  14803. }
  14804. if (this.leadingIcon_) {
  14805. this.leadingIcon_.destroy();
  14806. }
  14807. if (this.trailingIcon_) {
  14808. this.trailingIcon_.destroy();
  14809. }
  14810. if (this.label_) {
  14811. this.label_.destroy();
  14812. }
  14813. if (this.outline_) {
  14814. this.outline_.destroy();
  14815. }
  14816. _super.prototype.destroy.call(this);
  14817. };
  14818. MDCTextField.prototype.initialSyncWithDOM = function() {
  14819. this.disabled = this.input_.disabled;
  14820. };
  14821. Object.defineProperty(MDCTextField.prototype, "value", {
  14822. get: function get() {
  14823. return this.foundation_.getValue();
  14824. },
  14825. set: function set(value) {
  14826. this.foundation_.setValue(value);
  14827. },
  14828. enumerable: true,
  14829. configurable: true
  14830. });
  14831. Object.defineProperty(MDCTextField.prototype, "disabled", {
  14832. get: function get() {
  14833. return this.foundation_.isDisabled();
  14834. },
  14835. set: function set(disabled) {
  14836. this.foundation_.setDisabled(disabled);
  14837. },
  14838. enumerable: true,
  14839. configurable: true
  14840. });
  14841. Object.defineProperty(MDCTextField.prototype, "valid", {
  14842. get: function get() {
  14843. return this.foundation_.isValid();
  14844. },
  14845. set: function set(valid) {
  14846. this.foundation_.setValid(valid);
  14847. },
  14848. enumerable: true,
  14849. configurable: true
  14850. });
  14851. Object.defineProperty(MDCTextField.prototype, "required", {
  14852. get: function get() {
  14853. return this.input_.required;
  14854. },
  14855. set: function set(required) {
  14856. this.input_.required = required;
  14857. },
  14858. enumerable: true,
  14859. configurable: true
  14860. });
  14861. Object.defineProperty(MDCTextField.prototype, "pattern", {
  14862. get: function get() {
  14863. return this.input_.pattern;
  14864. },
  14865. set: function set(pattern) {
  14866. this.input_.pattern = pattern;
  14867. },
  14868. enumerable: true,
  14869. configurable: true
  14870. });
  14871. Object.defineProperty(MDCTextField.prototype, "minLength", {
  14872. get: function get() {
  14873. return this.input_.minLength;
  14874. },
  14875. set: function set(minLength) {
  14876. this.input_.minLength = minLength;
  14877. },
  14878. enumerable: true,
  14879. configurable: true
  14880. });
  14881. Object.defineProperty(MDCTextField.prototype, "maxLength", {
  14882. get: function get() {
  14883. return this.input_.maxLength;
  14884. },
  14885. set: function set(maxLength) {
  14886. if (maxLength < 0) {
  14887. this.input_.removeAttribute("maxLength");
  14888. } else {
  14889. this.input_.maxLength = maxLength;
  14890. }
  14891. },
  14892. enumerable: true,
  14893. configurable: true
  14894. });
  14895. Object.defineProperty(MDCTextField.prototype, "min", {
  14896. get: function get() {
  14897. return this.input_.min;
  14898. },
  14899. set: function set(min) {
  14900. this.input_.min = min;
  14901. },
  14902. enumerable: true,
  14903. configurable: true
  14904. });
  14905. Object.defineProperty(MDCTextField.prototype, "max", {
  14906. get: function get() {
  14907. return this.input_.max;
  14908. },
  14909. set: function set(max) {
  14910. this.input_.max = max;
  14911. },
  14912. enumerable: true,
  14913. configurable: true
  14914. });
  14915. Object.defineProperty(MDCTextField.prototype, "step", {
  14916. get: function get() {
  14917. return this.input_.step;
  14918. },
  14919. set: function set(step) {
  14920. this.input_.step = step;
  14921. },
  14922. enumerable: true,
  14923. configurable: true
  14924. });
  14925. Object.defineProperty(MDCTextField.prototype, "helperTextContent", {
  14926. set: function set(content) {
  14927. this.foundation_.setHelperTextContent(content);
  14928. },
  14929. enumerable: true,
  14930. configurable: true
  14931. });
  14932. Object.defineProperty(MDCTextField.prototype, "leadingIconAriaLabel", {
  14933. set: function set(label) {
  14934. this.foundation_.setLeadingIconAriaLabel(label);
  14935. },
  14936. enumerable: true,
  14937. configurable: true
  14938. });
  14939. Object.defineProperty(MDCTextField.prototype, "leadingIconContent", {
  14940. set: function set(content) {
  14941. this.foundation_.setLeadingIconContent(content);
  14942. },
  14943. enumerable: true,
  14944. configurable: true
  14945. });
  14946. Object.defineProperty(MDCTextField.prototype, "trailingIconAriaLabel", {
  14947. set: function set(label) {
  14948. this.foundation_.setTrailingIconAriaLabel(label);
  14949. },
  14950. enumerable: true,
  14951. configurable: true
  14952. });
  14953. Object.defineProperty(MDCTextField.prototype, "trailingIconContent", {
  14954. set: function set(content) {
  14955. this.foundation_.setTrailingIconContent(content);
  14956. },
  14957. enumerable: true,
  14958. configurable: true
  14959. });
  14960. Object.defineProperty(MDCTextField.prototype, "useNativeValidation", {
  14961. set: function set(useNativeValidation) {
  14962. this.foundation_.setUseNativeValidation(useNativeValidation);
  14963. },
  14964. enumerable: true,
  14965. configurable: true
  14966. });
  14967. MDCTextField.prototype.focus = function() {
  14968. this.input_.focus();
  14969. };
  14970. MDCTextField.prototype.layout = function() {
  14971. var openNotch = this.foundation_.shouldFloat;
  14972. this.foundation_.notchOutline(openNotch);
  14973. };
  14974. MDCTextField.prototype.getDefaultFoundation = function() {
  14975. var adapter = __assign({}, this.getRootAdapterMethods_(), this.getInputAdapterMethods_(), this.getLabelAdapterMethods_(), this.getLineRippleAdapterMethods_(), this.getOutlineAdapterMethods_());
  14976. return new foundation_3.MDCTextFieldFoundation(adapter, this.getFoundationMap_());
  14977. };
  14978. MDCTextField.prototype.getRootAdapterMethods_ = function() {
  14979. var _this = this;
  14980. return {
  14981. addClass: function addClass(className) {
  14982. return _this.root_.classList.add(className);
  14983. },
  14984. removeClass: function removeClass(className) {
  14985. return _this.root_.classList.remove(className);
  14986. },
  14987. hasClass: function hasClass(className) {
  14988. return _this.root_.classList.contains(className);
  14989. },
  14990. registerTextFieldInteractionHandler: function registerTextFieldInteractionHandler(evtType, handler) {
  14991. return _this.listen(evtType, handler);
  14992. },
  14993. deregisterTextFieldInteractionHandler: function deregisterTextFieldInteractionHandler(evtType, handler) {
  14994. return _this.unlisten(evtType, handler);
  14995. },
  14996. registerValidationAttributeChangeHandler: function registerValidationAttributeChangeHandler(handler) {
  14997. var getAttributesList = function getAttributesList(mutationsList) {
  14998. return mutationsList.map(function(mutation) {
  14999. return mutation.attributeName;
  15000. }).filter(function(attributeName) {
  15001. return attributeName;
  15002. });
  15003. };
  15004. var observer = new MutationObserver(function(mutationsList) {
  15005. return handler(getAttributesList(mutationsList));
  15006. });
  15007. var config = {
  15008. attributes: true
  15009. };
  15010. observer.observe(_this.input_, config);
  15011. return observer;
  15012. },
  15013. deregisterValidationAttributeChangeHandler: function deregisterValidationAttributeChangeHandler(observer) {
  15014. return observer.disconnect();
  15015. }
  15016. };
  15017. };
  15018. MDCTextField.prototype.getInputAdapterMethods_ = function() {
  15019. var _this = this;
  15020. return {
  15021. getNativeInput: function getNativeInput() {
  15022. return _this.input_;
  15023. },
  15024. isFocused: function isFocused() {
  15025. return document.activeElement === _this.input_;
  15026. },
  15027. registerInputInteractionHandler: function registerInputInteractionHandler(evtType, handler) {
  15028. return _this.input_.addEventListener(evtType, handler);
  15029. },
  15030. deregisterInputInteractionHandler: function deregisterInputInteractionHandler(evtType, handler) {
  15031. return _this.input_.removeEventListener(evtType, handler);
  15032. }
  15033. };
  15034. };
  15035. MDCTextField.prototype.getLabelAdapterMethods_ = function() {
  15036. var _this = this;
  15037. return {
  15038. floatLabel: function floatLabel(shouldFloat) {
  15039. return _this.label_ && _this.label_.float(shouldFloat);
  15040. },
  15041. getLabelWidth: function getLabelWidth() {
  15042. return _this.label_ ? _this.label_.getWidth() : 0;
  15043. },
  15044. hasLabel: function hasLabel() {
  15045. return Boolean(_this.label_);
  15046. },
  15047. shakeLabel: function shakeLabel(shouldShake) {
  15048. return _this.label_ && _this.label_.shake(shouldShake);
  15049. }
  15050. };
  15051. };
  15052. MDCTextField.prototype.getLineRippleAdapterMethods_ = function() {
  15053. var _this = this;
  15054. return {
  15055. activateLineRipple: function activateLineRipple() {
  15056. if (_this.lineRipple_) {
  15057. _this.lineRipple_.activate();
  15058. }
  15059. },
  15060. deactivateLineRipple: function deactivateLineRipple() {
  15061. if (_this.lineRipple_) {
  15062. _this.lineRipple_.deactivate();
  15063. }
  15064. },
  15065. setLineRippleTransformOrigin: function setLineRippleTransformOrigin(normalizedX) {
  15066. if (_this.lineRipple_) {
  15067. _this.lineRipple_.setRippleCenter(normalizedX);
  15068. }
  15069. }
  15070. };
  15071. };
  15072. MDCTextField.prototype.getOutlineAdapterMethods_ = function() {
  15073. var _this = this;
  15074. return {
  15075. closeOutline: function closeOutline() {
  15076. return _this.outline_ && _this.outline_.closeNotch();
  15077. },
  15078. hasOutline: function hasOutline() {
  15079. return Boolean(_this.outline_);
  15080. },
  15081. notchOutline: function notchOutline(labelWidth) {
  15082. return _this.outline_ && _this.outline_.notch(labelWidth);
  15083. }
  15084. };
  15085. };
  15086. MDCTextField.prototype.getFoundationMap_ = function() {
  15087. return {
  15088. characterCounter: this.characterCounter_ ? this.characterCounter_.foundation : undefined,
  15089. helperText: this.helperText_ ? this.helperText_.foundation : undefined,
  15090. leadingIcon: this.leadingIcon_ ? this.leadingIcon_.foundation : undefined,
  15091. trailingIcon: this.trailingIcon_ ? this.trailingIcon_.foundation : undefined
  15092. };
  15093. };
  15094. MDCTextField.prototype.createRipple_ = function(rippleFactory) {
  15095. var _this = this;
  15096. var isTextArea = this.root_.classList.contains(constants_1.cssClasses.TEXTAREA);
  15097. var isOutlined = this.root_.classList.contains(constants_1.cssClasses.OUTLINED);
  15098. if (isTextArea || isOutlined) {
  15099. return null;
  15100. }
  15101. var adapter = __assign({}, component_5.MDCRipple.createAdapter(this), {
  15102. isSurfaceActive: function isSurfaceActive() {
  15103. return ponyfill.matches(_this.input_, ":active");
  15104. },
  15105. registerInteractionHandler: function registerInteractionHandler(evtType, handler) {
  15106. return _this.input_.addEventListener(evtType, handler);
  15107. },
  15108. deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) {
  15109. return _this.input_.removeEventListener(evtType, handler);
  15110. }
  15111. });
  15112. return rippleFactory(this.root_, new foundation_1.MDCRippleFoundation(adapter));
  15113. };
  15114. return MDCTextField;
  15115. }(component_1.MDCComponent);
  15116. exports.MDCTextField = MDCTextField;
  15117. }, function(module, exports, __webpack_require__) {
  15118. "use strict";
  15119. Object.defineProperty(exports, "__esModule", {
  15120. value: true
  15121. });
  15122. var cssClasses = {
  15123. ROOT: "mdc-text-field-character-counter"
  15124. };
  15125. exports.cssClasses = cssClasses;
  15126. var strings = {
  15127. ROOT_SELECTOR: "." + cssClasses.ROOT
  15128. };
  15129. exports.strings = strings;
  15130. }, function(module, exports, __webpack_require__) {
  15131. "use strict";
  15132. Object.defineProperty(exports, "__esModule", {
  15133. value: true
  15134. });
  15135. var cssClasses = {
  15136. HELPER_TEXT_PERSISTENT: "mdc-text-field-helper-text--persistent",
  15137. HELPER_TEXT_VALIDATION_MSG: "mdc-text-field-helper-text--validation-msg",
  15138. ROOT: "mdc-text-field-helper-text"
  15139. };
  15140. exports.cssClasses = cssClasses;
  15141. var strings = {
  15142. ARIA_HIDDEN: "aria-hidden",
  15143. ROLE: "role",
  15144. ROOT_SELECTOR: "." + cssClasses.ROOT
  15145. };
  15146. exports.strings = strings;
  15147. }, function(module, exports, __webpack_require__) {
  15148. "use strict";
  15149. Object.defineProperty(exports, "__esModule", {
  15150. value: true
  15151. });
  15152. var strings = {
  15153. ICON_EVENT: "MDCTextField:icon",
  15154. ICON_ROLE: "button"
  15155. };
  15156. exports.strings = strings;
  15157. var cssClasses = {
  15158. ROOT: "mdc-text-field__icon"
  15159. };
  15160. exports.cssClasses = cssClasses;
  15161. }, function(module, exports, __webpack_require__) {
  15162. "use strict";
  15163. function __export(m) {
  15164. for (var p in m) {
  15165. if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  15166. }
  15167. }
  15168. Object.defineProperty(exports, "__esModule", {
  15169. value: true
  15170. });
  15171. __export(__webpack_require__(69));
  15172. __export(__webpack_require__(23));
  15173. }, function(module, exports, __webpack_require__) {
  15174. "use strict";
  15175. function __export(m) {
  15176. for (var p in m) {
  15177. if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  15178. }
  15179. }
  15180. Object.defineProperty(exports, "__esModule", {
  15181. value: true
  15182. });
  15183. __export(__webpack_require__(72));
  15184. __export(__webpack_require__(24));
  15185. }, function(module, exports, __webpack_require__) {
  15186. "use strict";
  15187. function __export(m) {
  15188. for (var p in m) {
  15189. if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  15190. }
  15191. }
  15192. Object.defineProperty(exports, "__esModule", {
  15193. value: true
  15194. });
  15195. __export(__webpack_require__(73));
  15196. __export(__webpack_require__(74));
  15197. }, function(module, exports, __webpack_require__) {
  15198. "use strict";
  15199. function __export(m) {
  15200. for (var p in m) {
  15201. if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  15202. }
  15203. }
  15204. Object.defineProperty(exports, "__esModule", {
  15205. value: true
  15206. });
  15207. __export(__webpack_require__(159));
  15208. __export(__webpack_require__(75));
  15209. }, function(module, exports, __webpack_require__) {
  15210. "use strict";
  15211. var __extends = this && this.__extends || function() {
  15212. var _extendStatics = function extendStatics(d, b) {
  15213. _extendStatics = Object.setPrototypeOf || {
  15214. __proto__: []
  15215. } instanceof Array && function(d, b) {
  15216. d.__proto__ = b;
  15217. } || function(d, b) {
  15218. for (var p in b) {
  15219. if (b.hasOwnProperty(p)) d[p] = b[p];
  15220. }
  15221. };
  15222. return _extendStatics(d, b);
  15223. };
  15224. return function(d, b) {
  15225. _extendStatics(d, b);
  15226. function __() {
  15227. this.constructor = d;
  15228. }
  15229. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  15230. };
  15231. }();
  15232. Object.defineProperty(exports, "__esModule", {
  15233. value: true
  15234. });
  15235. var component_1 = __webpack_require__(1);
  15236. var component_2 = __webpack_require__(2);
  15237. var foundation_1 = __webpack_require__(75);
  15238. var strings = foundation_1.MDCToolbarFoundation.strings;
  15239. var MDCToolbar = function(_super) {
  15240. __extends(MDCToolbar, _super);
  15241. function MDCToolbar() {
  15242. return _super !== null && _super.apply(this, arguments) || this;
  15243. }
  15244. MDCToolbar.attachTo = function(root) {
  15245. return new MDCToolbar(root);
  15246. };
  15247. MDCToolbar.prototype.initialize = function() {
  15248. var _this = this;
  15249. this.ripples_ = [];
  15250. this.fixedAdjustElement_ = null;
  15251. this.titleElement_ = this.root_.querySelector(strings.TITLE_SELECTOR);
  15252. var firstRowElement = this.root_.querySelector(strings.FIRST_ROW_SELECTOR);
  15253. if (!firstRowElement) {
  15254. throw new Error("MDCToolbar: Required sub-element '" + strings.FIRST_ROW_SELECTOR + "' is missing");
  15255. }
  15256. this.firstRowElement_ = firstRowElement;
  15257. [].forEach.call(this.root_.querySelectorAll(strings.ICON_SELECTOR), function(icon) {
  15258. var ripple = component_2.MDCRipple.attachTo(icon);
  15259. ripple.unbounded = true;
  15260. _this.ripples_.push(ripple);
  15261. });
  15262. };
  15263. MDCToolbar.prototype.destroy = function() {
  15264. this.ripples_.forEach(function(ripple) {
  15265. ripple.destroy();
  15266. });
  15267. _super.prototype.destroy.call(this);
  15268. };
  15269. Object.defineProperty(MDCToolbar.prototype, "fixedAdjustElement", {
  15270. get: function get() {
  15271. return this.fixedAdjustElement_;
  15272. },
  15273. set: function set(element) {
  15274. this.fixedAdjustElement_ = element;
  15275. this.foundation_.updateAdjustElementStyles();
  15276. },
  15277. enumerable: true,
  15278. configurable: true
  15279. });
  15280. MDCToolbar.prototype.getDefaultFoundation = function() {
  15281. var _this = this;
  15282. var adapter = {
  15283. hasClass: function hasClass(className) {
  15284. return _this.root_.classList.contains(className);
  15285. },
  15286. addClass: function addClass(className) {
  15287. return _this.root_.classList.add(className);
  15288. },
  15289. removeClass: function removeClass(className) {
  15290. return _this.root_.classList.remove(className);
  15291. },
  15292. registerScrollHandler: function registerScrollHandler(handler) {
  15293. return window.addEventListener("scroll", handler);
  15294. },
  15295. deregisterScrollHandler: function deregisterScrollHandler(handler) {
  15296. return window.removeEventListener("scroll", handler);
  15297. },
  15298. registerResizeHandler: function registerResizeHandler(handler) {
  15299. return window.addEventListener("resize", handler);
  15300. },
  15301. deregisterResizeHandler: function deregisterResizeHandler(handler) {
  15302. return window.removeEventListener("resize", handler);
  15303. },
  15304. getViewportWidth: function getViewportWidth() {
  15305. return window.innerWidth;
  15306. },
  15307. getViewportScrollY: function getViewportScrollY() {
  15308. return window.pageYOffset;
  15309. },
  15310. getOffsetHeight: function getOffsetHeight() {
  15311. return _this.root_.offsetHeight;
  15312. },
  15313. getFirstRowElementOffsetHeight: function getFirstRowElementOffsetHeight() {
  15314. return _this.firstRowElement_.offsetHeight;
  15315. },
  15316. notifyChange: function notifyChange(evtData) {
  15317. return _this.emit(strings.CHANGE_EVENT, evtData);
  15318. },
  15319. setStyle: function setStyle(property, value) {
  15320. return _this.root_.style.setProperty(property, value);
  15321. },
  15322. setStyleForTitleElement: function setStyleForTitleElement(property, value) {
  15323. if (_this.titleElement_) {
  15324. _this.titleElement_.style.setProperty(property, value);
  15325. }
  15326. },
  15327. setStyleForFlexibleRowElement: function setStyleForFlexibleRowElement(property, value) {
  15328. return _this.firstRowElement_.style.setProperty(property, value);
  15329. },
  15330. setStyleForFixedAdjustElement: function setStyleForFixedAdjustElement(property, value) {
  15331. if (_this.fixedAdjustElement) {
  15332. _this.fixedAdjustElement.style.setProperty(property, value);
  15333. }
  15334. }
  15335. };
  15336. return new foundation_1.MDCToolbarFoundation(adapter);
  15337. };
  15338. return MDCToolbar;
  15339. }(component_1.MDCComponent);
  15340. exports.MDCToolbar = MDCToolbar;
  15341. }, function(module, exports, __webpack_require__) {
  15342. "use strict";
  15343. Object.defineProperty(exports, "__esModule", {
  15344. value: true
  15345. });
  15346. exports.cssClasses = {
  15347. FIXED: "mdc-toolbar--fixed",
  15348. FIXED_AT_LAST_ROW: "mdc-toolbar--fixed-at-last-row",
  15349. FIXED_LASTROW: "mdc-toolbar--fixed-lastrow-only",
  15350. FLEXIBLE_DEFAULT_BEHAVIOR: "mdc-toolbar--flexible-default-behavior",
  15351. FLEXIBLE_MAX: "mdc-toolbar--flexible-space-maximized",
  15352. FLEXIBLE_MIN: "mdc-toolbar--flexible-space-minimized",
  15353. TOOLBAR_ROW_FLEXIBLE: "mdc-toolbar--flexible"
  15354. };
  15355. exports.strings = {
  15356. CHANGE_EVENT: "MDCToolbar:change",
  15357. FIRST_ROW_SELECTOR: ".mdc-toolbar__row:first-child",
  15358. ICON_SELECTOR: ".mdc-toolbar__icon",
  15359. TITLE_SELECTOR: ".mdc-toolbar__title"
  15360. };
  15361. exports.numbers = {
  15362. MAX_TITLE_SIZE: 2.125,
  15363. MIN_TITLE_SIZE: 1.25,
  15364. TOOLBAR_MOBILE_BREAKPOINT: 600,
  15365. TOOLBAR_ROW_HEIGHT: 64,
  15366. TOOLBAR_ROW_MOBILE_HEIGHT: 56
  15367. };
  15368. }, function(module, exports, __webpack_require__) {
  15369. "use strict";
  15370. function __export(m) {
  15371. for (var p in m) {
  15372. if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  15373. }
  15374. }
  15375. Object.defineProperty(exports, "__esModule", {
  15376. value: true
  15377. });
  15378. __export(__webpack_require__(162));
  15379. __export(__webpack_require__(26));
  15380. __export(__webpack_require__(76));
  15381. __export(__webpack_require__(77));
  15382. __export(__webpack_require__(25));
  15383. }, function(module, exports, __webpack_require__) {
  15384. "use strict";
  15385. var __extends = this && this.__extends || function() {
  15386. var _extendStatics = function extendStatics(d, b) {
  15387. _extendStatics = Object.setPrototypeOf || {
  15388. __proto__: []
  15389. } instanceof Array && function(d, b) {
  15390. d.__proto__ = b;
  15391. } || function(d, b) {
  15392. for (var p in b) {
  15393. if (b.hasOwnProperty(p)) d[p] = b[p];
  15394. }
  15395. };
  15396. return _extendStatics(d, b);
  15397. };
  15398. return function(d, b) {
  15399. _extendStatics(d, b);
  15400. function __() {
  15401. this.constructor = d;
  15402. }
  15403. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  15404. };
  15405. }();
  15406. Object.defineProperty(exports, "__esModule", {
  15407. value: true
  15408. });
  15409. var component_1 = __webpack_require__(1);
  15410. var component_2 = __webpack_require__(2);
  15411. var constants_1 = __webpack_require__(7);
  15412. var foundation_1 = __webpack_require__(76);
  15413. var foundation_2 = __webpack_require__(77);
  15414. var foundation_3 = __webpack_require__(25);
  15415. var MDCTopAppBar = function(_super) {
  15416. __extends(MDCTopAppBar, _super);
  15417. function MDCTopAppBar() {
  15418. return _super !== null && _super.apply(this, arguments) || this;
  15419. }
  15420. MDCTopAppBar.attachTo = function(root) {
  15421. return new MDCTopAppBar(root);
  15422. };
  15423. MDCTopAppBar.prototype.initialize = function(rippleFactory) {
  15424. if (rippleFactory === void 0) {
  15425. rippleFactory = function rippleFactory(el) {
  15426. return component_2.MDCRipple.attachTo(el);
  15427. };
  15428. }
  15429. this.navIcon_ = this.root_.querySelector(constants_1.strings.NAVIGATION_ICON_SELECTOR);
  15430. var icons = [].slice.call(this.root_.querySelectorAll(constants_1.strings.ACTION_ITEM_SELECTOR));
  15431. if (this.navIcon_) {
  15432. icons.push(this.navIcon_);
  15433. }
  15434. this.iconRipples_ = icons.map(function(icon) {
  15435. var ripple = rippleFactory(icon);
  15436. ripple.unbounded = true;
  15437. return ripple;
  15438. });
  15439. this.scrollTarget_ = window;
  15440. };
  15441. MDCTopAppBar.prototype.destroy = function() {
  15442. this.iconRipples_.forEach(function(iconRipple) {
  15443. return iconRipple.destroy();
  15444. });
  15445. _super.prototype.destroy.call(this);
  15446. };
  15447. MDCTopAppBar.prototype.setScrollTarget = function(target) {
  15448. this.foundation_.destroyScrollHandler();
  15449. this.scrollTarget_ = target;
  15450. this.foundation_.initScrollHandler();
  15451. };
  15452. MDCTopAppBar.prototype.getDefaultFoundation = function() {
  15453. var _this = this;
  15454. var adapter = {
  15455. hasClass: function hasClass(className) {
  15456. return _this.root_.classList.contains(className);
  15457. },
  15458. addClass: function addClass(className) {
  15459. return _this.root_.classList.add(className);
  15460. },
  15461. removeClass: function removeClass(className) {
  15462. return _this.root_.classList.remove(className);
  15463. },
  15464. setStyle: function setStyle(property, value) {
  15465. return _this.root_.style.setProperty(property, value);
  15466. },
  15467. getTopAppBarHeight: function getTopAppBarHeight() {
  15468. return _this.root_.clientHeight;
  15469. },
  15470. registerNavigationIconInteractionHandler: function registerNavigationIconInteractionHandler(evtType, handler) {
  15471. if (_this.navIcon_) {
  15472. _this.navIcon_.addEventListener(evtType, handler);
  15473. }
  15474. },
  15475. deregisterNavigationIconInteractionHandler: function deregisterNavigationIconInteractionHandler(evtType, handler) {
  15476. if (_this.navIcon_) {
  15477. _this.navIcon_.removeEventListener(evtType, handler);
  15478. }
  15479. },
  15480. notifyNavigationIconClicked: function notifyNavigationIconClicked() {
  15481. return _this.emit(constants_1.strings.NAVIGATION_EVENT, {});
  15482. },
  15483. registerScrollHandler: function registerScrollHandler(handler) {
  15484. return _this.scrollTarget_.addEventListener("scroll", handler);
  15485. },
  15486. deregisterScrollHandler: function deregisterScrollHandler(handler) {
  15487. return _this.scrollTarget_.removeEventListener("scroll", handler);
  15488. },
  15489. registerResizeHandler: function registerResizeHandler(handler) {
  15490. return window.addEventListener("resize", handler);
  15491. },
  15492. deregisterResizeHandler: function deregisterResizeHandler(handler) {
  15493. return window.removeEventListener("resize", handler);
  15494. },
  15495. getViewportScrollY: function getViewportScrollY() {
  15496. var win = _this.scrollTarget_;
  15497. var el = _this.scrollTarget_;
  15498. return win.pageYOffset !== undefined ? win.pageYOffset : el.scrollTop;
  15499. },
  15500. getTotalActionItems: function getTotalActionItems() {
  15501. return _this.root_.querySelectorAll(constants_1.strings.ACTION_ITEM_SELECTOR).length;
  15502. }
  15503. };
  15504. var foundation;
  15505. if (this.root_.classList.contains(constants_1.cssClasses.SHORT_CLASS)) {
  15506. foundation = new foundation_2.MDCShortTopAppBarFoundation(adapter);
  15507. } else if (this.root_.classList.contains(constants_1.cssClasses.FIXED_CLASS)) {
  15508. foundation = new foundation_1.MDCFixedTopAppBarFoundation(adapter);
  15509. } else {
  15510. foundation = new foundation_3.MDCTopAppBarFoundation(adapter);
  15511. }
  15512. return foundation;
  15513. };
  15514. return MDCTopAppBar;
  15515. }(component_1.MDCComponent);
  15516. exports.MDCTopAppBar = MDCTopAppBar;
  15517. } ]);
  15518. });
  15519. //# sourceMappingURL=material-components-web.js.map