material-components-web.js 1.1 MB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425
  1. /*!
  2. Material Components for the Web
  3. Copyright (c) 2019 Google Inc.
  4. License: MIT
  5. */
  6. (function webpackUniversalModuleDefinition(root, factory) {
  7. if(typeof exports === 'object' && typeof module === 'object')
  8. module.exports = factory();
  9. else if(typeof define === 'function' && define.amd)
  10. define([], factory);
  11. else if(typeof exports === 'object')
  12. exports["mdc"] = factory();
  13. else
  14. root["mdc"] = factory();
  15. })(this, function() {
  16. return /******/ (function(modules) { // webpackBootstrap
  17. /******/ // The module cache
  18. /******/ var installedModules = {};
  19. /******/
  20. /******/ // The require function
  21. /******/ function __webpack_require__(moduleId) {
  22. /******/
  23. /******/ // Check if module is in cache
  24. /******/ if(installedModules[moduleId]) {
  25. /******/ return installedModules[moduleId].exports;
  26. /******/ }
  27. /******/ // Create a new module (and put it into the cache)
  28. /******/ var module = installedModules[moduleId] = {
  29. /******/ i: moduleId,
  30. /******/ l: false,
  31. /******/ exports: {}
  32. /******/ };
  33. /******/
  34. /******/ // Execute the module function
  35. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  36. /******/
  37. /******/ // Flag the module as loaded
  38. /******/ module.l = true;
  39. /******/
  40. /******/ // Return the exports of the module
  41. /******/ return module.exports;
  42. /******/ }
  43. /******/
  44. /******/
  45. /******/ // expose the modules object (__webpack_modules__)
  46. /******/ __webpack_require__.m = modules;
  47. /******/
  48. /******/ // expose the module cache
  49. /******/ __webpack_require__.c = installedModules;
  50. /******/
  51. /******/ // define getter function for harmony exports
  52. /******/ __webpack_require__.d = function(exports, name, getter) {
  53. /******/ if(!__webpack_require__.o(exports, name)) {
  54. /******/ Object.defineProperty(exports, name, {
  55. /******/ configurable: false,
  56. /******/ enumerable: true,
  57. /******/ get: getter
  58. /******/ });
  59. /******/ }
  60. /******/ };
  61. /******/
  62. /******/ // getDefaultExport function for compatibility with non-harmony modules
  63. /******/ __webpack_require__.n = function(module) {
  64. /******/ var getter = module && module.__esModule ?
  65. /******/ function getDefault() { return module['default']; } :
  66. /******/ function getModuleExports() { return module; };
  67. /******/ __webpack_require__.d(getter, 'a', getter);
  68. /******/ return getter;
  69. /******/ };
  70. /******/
  71. /******/ // Object.prototype.hasOwnProperty.call
  72. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  73. /******/
  74. /******/ // __webpack_public_path__
  75. /******/ __webpack_require__.p = "";
  76. /******/
  77. /******/ // Load entry module and return exports
  78. /******/ return __webpack_require__(__webpack_require__.s = 65);
  79. /******/ })
  80. /************************************************************************/
  81. /******/ ([
  82. /* 0 */
  83. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  84. "use strict";
  85. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  86. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  87. /**
  88. * @license
  89. * Copyright 2016 Google Inc.
  90. *
  91. * Permission is hereby granted, free of charge, to any person obtaining a copy
  92. * of this software and associated documentation files (the "Software"), to deal
  93. * in the Software without restriction, including without limitation the rights
  94. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  95. * copies of the Software, and to permit persons to whom the Software is
  96. * furnished to do so, subject to the following conditions:
  97. *
  98. * The above copyright notice and this permission notice shall be included in
  99. * all copies or substantial portions of the Software.
  100. *
  101. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  102. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  103. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  104. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  105. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  106. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  107. * THE SOFTWARE.
  108. */
  109. /**
  110. * @template A
  111. */
  112. var MDCFoundation = function () {
  113. _createClass(MDCFoundation, null, [{
  114. key: "cssClasses",
  115. /** @return enum{cssClasses} */
  116. get: function get() {
  117. // Classes extending MDCFoundation should implement this method to return an object which exports every
  118. // CSS class the foundation class needs as a property. e.g. {ACTIVE: 'mdc-component--active'}
  119. return {};
  120. }
  121. /** @return enum{strings} */
  122. }, {
  123. key: "strings",
  124. get: function get() {
  125. // Classes extending MDCFoundation should implement this method to return an object which exports all
  126. // semantic strings as constants. e.g. {ARIA_ROLE: 'tablist'}
  127. return {};
  128. }
  129. /** @return enum{numbers} */
  130. }, {
  131. key: "numbers",
  132. get: function get() {
  133. // Classes extending MDCFoundation should implement this method to return an object which exports all
  134. // of its semantic numbers as constants. e.g. {ANIMATION_DELAY_MS: 350}
  135. return {};
  136. }
  137. /** @return {!Object} */
  138. }, {
  139. key: "defaultAdapter",
  140. get: function get() {
  141. // Classes extending MDCFoundation may choose to implement this getter in order to provide a convenient
  142. // way of viewing the necessary methods of an adapter. In the future, this could also be used for adapter
  143. // validation.
  144. return {};
  145. }
  146. /**
  147. * @param {A=} adapter
  148. */
  149. }]);
  150. function MDCFoundation() {
  151. var adapter = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  152. _classCallCheck(this, MDCFoundation);
  153. /** @protected {!A} */
  154. this.adapter_ = adapter;
  155. }
  156. _createClass(MDCFoundation, [{
  157. key: "init",
  158. value: function init() {
  159. // Subclasses should override this method to perform initialization routines (registering events, etc.)
  160. }
  161. }, {
  162. key: "destroy",
  163. value: function destroy() {
  164. // Subclasses should override this method to perform de-initialization routines (de-registering events, etc.)
  165. }
  166. }]);
  167. return MDCFoundation;
  168. }();
  169. /* harmony default export */ __webpack_exports__["a"] = (MDCFoundation);
  170. /***/ }),
  171. /* 1 */
  172. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  173. "use strict";
  174. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation__ = __webpack_require__(0);
  175. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  176. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  177. /**
  178. * @license
  179. * Copyright 2016 Google Inc.
  180. *
  181. * Permission is hereby granted, free of charge, to any person obtaining a copy
  182. * of this software and associated documentation files (the "Software"), to deal
  183. * in the Software without restriction, including without limitation the rights
  184. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  185. * copies of the Software, and to permit persons to whom the Software is
  186. * furnished to do so, subject to the following conditions:
  187. *
  188. * The above copyright notice and this permission notice shall be included in
  189. * all copies or substantial portions of the Software.
  190. *
  191. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  192. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  193. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  194. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  195. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  196. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  197. * THE SOFTWARE.
  198. */
  199. /**
  200. * @template F
  201. */
  202. var MDCComponent = function () {
  203. _createClass(MDCComponent, null, [{
  204. key: 'attachTo',
  205. /**
  206. * @param {!Element} root
  207. * @return {!MDCComponent}
  208. */
  209. value: function attachTo(root) {
  210. // Subclasses which extend MDCBase should provide an attachTo() method that takes a root element and
  211. // returns an instantiated component with its root set to that element. Also note that in the cases of
  212. // subclasses, an explicit foundation class will not have to be passed in; it will simply be initialized
  213. // from getDefaultFoundation().
  214. return new MDCComponent(root, new __WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */]());
  215. }
  216. /**
  217. * @param {!Element} root
  218. * @param {F=} foundation
  219. * @param {...?} args
  220. */
  221. }]);
  222. function MDCComponent(root) {
  223. var foundation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
  224. _classCallCheck(this, MDCComponent);
  225. /** @protected {!Element} */
  226. this.root_ = root;
  227. for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
  228. args[_key - 2] = arguments[_key];
  229. }
  230. this.initialize.apply(this, args);
  231. // Note that we initialize foundation here and not within the constructor's default param so that
  232. // this.root_ is defined and can be used within the foundation class.
  233. /** @protected {!F} */
  234. this.foundation_ = foundation === undefined ? this.getDefaultFoundation() : foundation;
  235. this.foundation_.init();
  236. this.initialSyncWithDOM();
  237. }
  238. _createClass(MDCComponent, [{
  239. key: 'initialize',
  240. value: function initialize() /* ...args */{}
  241. // Subclasses can override this to do any additional setup work that would be considered part of a
  242. // "constructor". Essentially, it is a hook into the parent constructor before the foundation is
  243. // initialized. Any additional arguments besides root and foundation will be passed in here.
  244. /**
  245. * @return {!F} foundation
  246. */
  247. }, {
  248. key: 'getDefaultFoundation',
  249. value: function getDefaultFoundation() {
  250. // Subclasses must override this method to return a properly configured foundation class for the
  251. // component.
  252. throw new Error('Subclasses must override getDefaultFoundation to return a properly configured ' + 'foundation class');
  253. }
  254. }, {
  255. key: 'initialSyncWithDOM',
  256. value: function initialSyncWithDOM() {
  257. // Subclasses should override this method if they need to perform work to synchronize with a host DOM
  258. // object. An example of this would be a form control wrapper that needs to synchronize its internal state
  259. // to some property or attribute of the host DOM. Please note: this is *not* the place to perform DOM
  260. // reads/writes that would cause layout / paint, as this is called synchronously from within the constructor.
  261. }
  262. }, {
  263. key: 'destroy',
  264. value: function destroy() {
  265. // Subclasses may implement this method to release any resources / deregister any listeners they have
  266. // attached. An example of this might be deregistering a resize event from the window object.
  267. this.foundation_.destroy();
  268. }
  269. /**
  270. * Wrapper method to add an event listener to the component's root element. This is most useful when
  271. * listening for custom events.
  272. * @param {string} evtType
  273. * @param {!Function} handler
  274. */
  275. }, {
  276. key: 'listen',
  277. value: function listen(evtType, handler) {
  278. this.root_.addEventListener(evtType, handler);
  279. }
  280. /**
  281. * Wrapper method to remove an event listener to the component's root element. This is most useful when
  282. * unlistening for custom events.
  283. * @param {string} evtType
  284. * @param {!Function} handler
  285. */
  286. }, {
  287. key: 'unlisten',
  288. value: function unlisten(evtType, handler) {
  289. this.root_.removeEventListener(evtType, handler);
  290. }
  291. /**
  292. * Fires a cross-browser-compatible custom event from the component root of the given type,
  293. * with the given data.
  294. * @param {string} evtType
  295. * @param {!Object} evtData
  296. * @param {boolean=} shouldBubble
  297. */
  298. }, {
  299. key: 'emit',
  300. value: function emit(evtType, evtData) {
  301. var shouldBubble = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  302. var evt = void 0;
  303. if (typeof CustomEvent === 'function') {
  304. evt = new CustomEvent(evtType, {
  305. detail: evtData,
  306. bubbles: shouldBubble
  307. });
  308. } else {
  309. evt = document.createEvent('CustomEvent');
  310. evt.initCustomEvent(evtType, shouldBubble, false, evtData);
  311. }
  312. this.root_.dispatchEvent(evt);
  313. }
  314. }]);
  315. return MDCComponent;
  316. }();
  317. /* harmony default export */ __webpack_exports__["a"] = (MDCComponent);
  318. /***/ }),
  319. /* 2 */
  320. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  321. "use strict";
  322. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  323. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCRipple", function() { return MDCRipple; });
  324. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RippleCapableSurface", function() { return RippleCapableSurface; });
  325. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  326. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(28);
  327. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(69);
  328. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util__ = __webpack_require__(5);
  329. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCRippleFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  330. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "util", function() { return __WEBPACK_IMPORTED_MODULE_3__util__; });
  331. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  332. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  333. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  334. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  335. /**
  336. * @license
  337. * Copyright 2016 Google Inc.
  338. *
  339. * Permission is hereby granted, free of charge, to any person obtaining a copy
  340. * of this software and associated documentation files (the "Software"), to deal
  341. * in the Software without restriction, including without limitation the rights
  342. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  343. * copies of the Software, and to permit persons to whom the Software is
  344. * furnished to do so, subject to the following conditions:
  345. *
  346. * The above copyright notice and this permission notice shall be included in
  347. * all copies or substantial portions of the Software.
  348. *
  349. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  350. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  351. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  352. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  353. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  354. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  355. * THE SOFTWARE.
  356. */
  357. /**
  358. * @extends MDCComponent<!MDCRippleFoundation>
  359. */
  360. var MDCRipple = function (_MDCComponent) {
  361. _inherits(MDCRipple, _MDCComponent);
  362. /** @param {...?} args */
  363. function MDCRipple() {
  364. var _ref;
  365. _classCallCheck(this, MDCRipple);
  366. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  367. args[_key] = arguments[_key];
  368. }
  369. /** @type {boolean} */
  370. var _this = _possibleConstructorReturn(this, (_ref = MDCRipple.__proto__ || Object.getPrototypeOf(MDCRipple)).call.apply(_ref, [this].concat(args)));
  371. _this.disabled = false;
  372. /** @private {boolean} */
  373. _this.unbounded_;
  374. return _this;
  375. }
  376. /**
  377. * @param {!Element} root
  378. * @param {{isUnbounded: (boolean|undefined)}=} options
  379. * @return {!MDCRipple}
  380. */
  381. _createClass(MDCRipple, [{
  382. key: 'setUnbounded_',
  383. /**
  384. * Closure Compiler throws an access control error when directly accessing a
  385. * protected or private property inside a getter/setter, like unbounded above.
  386. * By accessing the protected property inside a method, we solve that problem.
  387. * That's why this function exists.
  388. * @private
  389. */
  390. value: function setUnbounded_() {
  391. this.foundation_.setUnbounded(this.unbounded_);
  392. }
  393. }, {
  394. key: 'activate',
  395. value: function activate() {
  396. this.foundation_.activate();
  397. }
  398. }, {
  399. key: 'deactivate',
  400. value: function deactivate() {
  401. this.foundation_.deactivate();
  402. }
  403. }, {
  404. key: 'layout',
  405. value: function layout() {
  406. this.foundation_.layout();
  407. }
  408. /**
  409. * @return {!MDCRippleFoundation}
  410. * @override
  411. */
  412. }, {
  413. key: 'getDefaultFoundation',
  414. value: function getDefaultFoundation() {
  415. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */](MDCRipple.createAdapter(this));
  416. }
  417. /** @override */
  418. }, {
  419. key: 'initialSyncWithDOM',
  420. value: function initialSyncWithDOM() {
  421. this.unbounded = 'mdcRippleIsUnbounded' in this.root_.dataset;
  422. }
  423. }, {
  424. key: 'unbounded',
  425. /** @return {boolean} */
  426. get: function get() {
  427. return this.unbounded_;
  428. }
  429. /** @param {boolean} unbounded */
  430. ,
  431. set: function set(unbounded) {
  432. this.unbounded_ = Boolean(unbounded);
  433. this.setUnbounded_();
  434. }
  435. }], [{
  436. key: 'attachTo',
  437. value: function attachTo(root) {
  438. var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  439. _ref2$isUnbounded = _ref2.isUnbounded,
  440. isUnbounded = _ref2$isUnbounded === undefined ? undefined : _ref2$isUnbounded;
  441. var ripple = new MDCRipple(root);
  442. // Only override unbounded behavior if option is explicitly specified
  443. if (isUnbounded !== undefined) {
  444. ripple.unbounded = /** @type {boolean} */isUnbounded;
  445. }
  446. return ripple;
  447. }
  448. /**
  449. * @param {!RippleCapableSurface} instance
  450. * @return {!MDCRippleAdapter}
  451. */
  452. }, {
  453. key: 'createAdapter',
  454. value: function createAdapter(instance) {
  455. var MATCHES = __WEBPACK_IMPORTED_MODULE_3__util__["getMatchesProperty"](HTMLElement.prototype);
  456. return {
  457. browserSupportsCssVars: function browserSupportsCssVars() {
  458. return __WEBPACK_IMPORTED_MODULE_3__util__["supportsCssVariables"](window);
  459. },
  460. isUnbounded: function isUnbounded() {
  461. return instance.unbounded;
  462. },
  463. isSurfaceActive: function isSurfaceActive() {
  464. return instance.root_[MATCHES](':active');
  465. },
  466. isSurfaceDisabled: function isSurfaceDisabled() {
  467. return instance.disabled;
  468. },
  469. addClass: function addClass(className) {
  470. return instance.root_.classList.add(className);
  471. },
  472. removeClass: function removeClass(className) {
  473. return instance.root_.classList.remove(className);
  474. },
  475. containsEventTarget: function containsEventTarget(target) {
  476. return instance.root_.contains(target);
  477. },
  478. registerInteractionHandler: function registerInteractionHandler(evtType, handler) {
  479. return instance.root_.addEventListener(evtType, handler, __WEBPACK_IMPORTED_MODULE_3__util__["applyPassive"]());
  480. },
  481. deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) {
  482. return instance.root_.removeEventListener(evtType, handler, __WEBPACK_IMPORTED_MODULE_3__util__["applyPassive"]());
  483. },
  484. registerDocumentInteractionHandler: function registerDocumentInteractionHandler(evtType, handler) {
  485. return document.documentElement.addEventListener(evtType, handler, __WEBPACK_IMPORTED_MODULE_3__util__["applyPassive"]());
  486. },
  487. deregisterDocumentInteractionHandler: function deregisterDocumentInteractionHandler(evtType, handler) {
  488. return document.documentElement.removeEventListener(evtType, handler, __WEBPACK_IMPORTED_MODULE_3__util__["applyPassive"]());
  489. },
  490. registerResizeHandler: function registerResizeHandler(handler) {
  491. return window.addEventListener('resize', handler);
  492. },
  493. deregisterResizeHandler: function deregisterResizeHandler(handler) {
  494. return window.removeEventListener('resize', handler);
  495. },
  496. updateCssVariable: function updateCssVariable(varName, value) {
  497. return instance.root_.style.setProperty(varName, value);
  498. },
  499. computeBoundingRect: function computeBoundingRect() {
  500. return instance.root_.getBoundingClientRect();
  501. },
  502. getWindowPageOffset: function getWindowPageOffset() {
  503. return { x: window.pageXOffset, y: window.pageYOffset };
  504. }
  505. };
  506. }
  507. }]);
  508. return MDCRipple;
  509. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  510. /**
  511. * See Material Design spec for more details on when to use ripples.
  512. * https://material.io/guidelines/motion/choreography.html#choreography-creation
  513. * @record
  514. */
  515. var RippleCapableSurface = function RippleCapableSurface() {
  516. _classCallCheck(this, RippleCapableSurface);
  517. };
  518. /** @protected {!Element} */
  519. RippleCapableSurface.prototype.root_;
  520. /**
  521. * Whether or not the ripple bleeds out of the bounds of the element.
  522. * @type {boolean|undefined}
  523. */
  524. RippleCapableSurface.prototype.unbounded;
  525. /**
  526. * Whether or not the ripple is attached to a disabled component.
  527. * @type {boolean|undefined}
  528. */
  529. RippleCapableSurface.prototype.disabled;
  530. /***/ }),
  531. /* 3 */
  532. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  533. "use strict";
  534. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  535. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSelectionControlState", function() { return MDCSelectionControlState; });
  536. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSelectionControl", function() { return MDCSelectionControl; });
  537. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_ripple_index__ = __webpack_require__(2);
  538. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  539. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  540. /**
  541. * @license
  542. * Copyright 2017 Google Inc.
  543. *
  544. * Permission is hereby granted, free of charge, to any person obtaining a copy
  545. * of this software and associated documentation files (the "Software"), to deal
  546. * in the Software without restriction, including without limitation the rights
  547. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  548. * copies of the Software, and to permit persons to whom the Software is
  549. * furnished to do so, subject to the following conditions:
  550. *
  551. * The above copyright notice and this permission notice shall be included in
  552. * all copies or substantial portions of the Software.
  553. *
  554. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  555. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  556. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  557. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  558. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  559. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  560. * THE SOFTWARE.
  561. */
  562. /* eslint-disable no-unused-vars */
  563. /* eslint-enable no-unused-vars */
  564. /**
  565. * @typedef {{
  566. * checked: boolean,
  567. * indeterminate: boolean,
  568. * disabled: boolean,
  569. * value: ?string
  570. * }}
  571. */
  572. var MDCSelectionControlState = void 0;
  573. /**
  574. * @record
  575. */
  576. var MDCSelectionControl = function () {
  577. function MDCSelectionControl() {
  578. _classCallCheck(this, MDCSelectionControl);
  579. }
  580. _createClass(MDCSelectionControl, [{
  581. key: 'ripple',
  582. /** @return {?MDCRipple} */
  583. get: function get() {}
  584. }]);
  585. return MDCSelectionControl;
  586. }();
  587. /***/ }),
  588. /* 4 */
  589. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  590. "use strict";
  591. /* unused harmony export MDCTabScrollerAnimation */
  592. /* unused harmony export MDCTabScrollerHorizontalEdges */
  593. /* unused harmony export MDCTabScrollerAdapter */
  594. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  595. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  596. /**
  597. * @license
  598. * Copyright 2018 Google Inc.
  599. *
  600. * Permission is hereby granted, free of charge, to any person obtaining a copy
  601. * of this software and associated documentation files (the "Software"), to deal
  602. * in the Software without restriction, including without limitation the rights
  603. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  604. * copies of the Software, and to permit persons to whom the Software is
  605. * furnished to do so, subject to the following conditions:
  606. *
  607. * The above copyright notice and this permission notice shall be included in
  608. * all copies or substantial portions of the Software.
  609. *
  610. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  611. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  612. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  613. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  614. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  615. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  616. * THE SOFTWARE.
  617. */
  618. /* eslint no-unused-vars: [2, {"args": "none"}] */
  619. /**
  620. * MDCTabScrollerAnimation contains the values required for animating from the
  621. * current scroll position to the new scroll position. The "finalScrollPosition"
  622. * value represents the new scroll position while the "scrollDelta" value is the
  623. * corresponding transformation that is applied to the scroll content. Together,
  624. * they create the animation by first updating the scroll value then applying
  625. * the transformation and animating the transition. Both pieces are necessary
  626. * for the scroll animation to work. The values are used as-is by the tab
  627. * scroller animation method, ensuring that all logic for determining scroll
  628. * position or transformation is abstracted away from the animation method.
  629. * @typedef {{finalScrollPosition: number, scrollDelta: number}}
  630. */
  631. var MDCTabScrollerAnimation = void 0;
  632. /**
  633. * MDCTabScrollerHorizontalEdges represents the left and right edges of the
  634. * scroll content. These values vary depending on how scrolling in RTL is
  635. * implemented by the browser. One value is always 0 and one value is always
  636. * the max scrollable value as either a positive or negative integer.
  637. * @typedef {{left: number, right: number}}
  638. */
  639. var MDCTabScrollerHorizontalEdges = void 0;
  640. /**
  641. * Adapter for MDC Tab Scroller.
  642. *
  643. * Defines the shape of the adapter expected by the foundation. Implement this
  644. * adapter to integrate the Tab into your framework. See
  645. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  646. * for more information.
  647. *
  648. * @record
  649. */
  650. var MDCTabScrollerAdapter = function () {
  651. function MDCTabScrollerAdapter() {
  652. _classCallCheck(this, MDCTabScrollerAdapter);
  653. }
  654. _createClass(MDCTabScrollerAdapter, [{
  655. key: "addClass",
  656. /**
  657. * Adds the given className to the root element.
  658. * @param {string} className The className to add
  659. */
  660. value: function addClass(className) {}
  661. /**
  662. * Removes the given className from the root element.
  663. * @param {string} className The className to remove
  664. */
  665. }, {
  666. key: "removeClass",
  667. value: function removeClass(className) {}
  668. /**
  669. * Adds the given className to the scroll area element.
  670. * @param {string} className The className to add
  671. */
  672. }, {
  673. key: "addScrollAreaClass",
  674. value: function addScrollAreaClass(className) {}
  675. /**
  676. * Returns whether the event target matches given className.
  677. * @param {EventTarget} evtTarget The event target
  678. * @param {string} selector The selector to check
  679. * @return {boolean}
  680. */
  681. }, {
  682. key: "eventTargetMatchesSelector",
  683. value: function eventTargetMatchesSelector(evtTarget, selector) {}
  684. /**
  685. * Sets a style property of the area element to the passed value.
  686. * @param {string} propName The style property name to set
  687. * @param {string} value The style property value
  688. */
  689. }, {
  690. key: "setScrollAreaStyleProperty",
  691. value: function setScrollAreaStyleProperty(propName, value) {}
  692. /**
  693. * Sets a style property of the content element to the passed value.
  694. * @param {string} propName The style property name to set
  695. * @param {string} value The style property value
  696. */
  697. }, {
  698. key: "setScrollContentStyleProperty",
  699. value: function setScrollContentStyleProperty(propName, value) {}
  700. /**
  701. * Returns the scroll content element's computed style value of the given css property `propertyName`.
  702. * We achieve this via `getComputedStyle(...).getPropertyValue(propertyName)`.
  703. * @param {string} propertyName
  704. * @return {string}
  705. */
  706. }, {
  707. key: "getScrollContentStyleValue",
  708. value: function getScrollContentStyleValue(propertyName) {}
  709. /**
  710. * Sets the scrollLeft value of the scroll area element to the passed value.
  711. * @param {number} scrollLeft The new scrollLeft value
  712. */
  713. }, {
  714. key: "setScrollAreaScrollLeft",
  715. value: function setScrollAreaScrollLeft(scrollLeft) {}
  716. /**
  717. * Returns the scrollLeft value of the scroll area element.
  718. * @return {number}
  719. */
  720. }, {
  721. key: "getScrollAreaScrollLeft",
  722. value: function getScrollAreaScrollLeft() {}
  723. /**
  724. * Returns the offsetWidth of the scroll content element.
  725. * @return {number}
  726. */
  727. }, {
  728. key: "getScrollContentOffsetWidth",
  729. value: function getScrollContentOffsetWidth() {}
  730. /**
  731. * Returns the offsetWitdth of the scroll area element.
  732. * @return {number}
  733. */
  734. }, {
  735. key: "getScrollAreaOffsetWidth",
  736. value: function getScrollAreaOffsetWidth() {}
  737. /**
  738. * Returns the bounding client rect of the scroll area element.
  739. * @return {!ClientRect}
  740. */
  741. }, {
  742. key: "computeScrollAreaClientRect",
  743. value: function computeScrollAreaClientRect() {}
  744. /**
  745. * Returns the bounding client rect of the scroll content element.
  746. * @return {!ClientRect}
  747. */
  748. }, {
  749. key: "computeScrollContentClientRect",
  750. value: function computeScrollContentClientRect() {}
  751. /**
  752. * Returns the height of the browser's horizontal scrollbars (in px).
  753. * @return {number}
  754. */
  755. }, {
  756. key: "computeHorizontalScrollbarHeight",
  757. value: function computeHorizontalScrollbarHeight() {}
  758. }]);
  759. return MDCTabScrollerAdapter;
  760. }();
  761. /***/ }),
  762. /* 5 */
  763. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  764. "use strict";
  765. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  766. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "supportsCssVariables", function() { return supportsCssVariables; });
  767. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "applyPassive", function() { return applyPassive; });
  768. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getMatchesProperty", function() { return getMatchesProperty; });
  769. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNormalizedEventCoords", function() { return getNormalizedEventCoords; });
  770. /**
  771. * @license
  772. * Copyright 2016 Google Inc.
  773. *
  774. * Permission is hereby granted, free of charge, to any person obtaining a copy
  775. * of this software and associated documentation files (the "Software"), to deal
  776. * in the Software without restriction, including without limitation the rights
  777. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  778. * copies of the Software, and to permit persons to whom the Software is
  779. * furnished to do so, subject to the following conditions:
  780. *
  781. * The above copyright notice and this permission notice shall be included in
  782. * all copies or substantial portions of the Software.
  783. *
  784. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  785. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  786. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  787. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  788. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  789. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  790. * THE SOFTWARE.
  791. */
  792. /**
  793. * Stores result from supportsCssVariables to avoid redundant processing to detect CSS custom variable support.
  794. * @private {boolean|undefined}
  795. */
  796. var supportsCssVariables_ = void 0;
  797. /**
  798. * Stores result from applyPassive to avoid redundant processing to detect passive event listener support.
  799. * @private {boolean|undefined}
  800. */
  801. var supportsPassive_ = void 0;
  802. /**
  803. * @param {!Window} windowObj
  804. * @return {boolean}
  805. */
  806. function detectEdgePseudoVarBug(windowObj) {
  807. // Detect versions of Edge with buggy var() support
  808. // See: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/11495448/
  809. var document = windowObj.document;
  810. var node = document.createElement('div');
  811. node.className = 'mdc-ripple-surface--test-edge-var-bug';
  812. document.body.appendChild(node);
  813. // The bug exists if ::before style ends up propagating to the parent element.
  814. // Additionally, getComputedStyle returns null in iframes with display: "none" in Firefox,
  815. // but Firefox is known to support CSS custom properties correctly.
  816. // See: https://bugzilla.mozilla.org/show_bug.cgi?id=548397
  817. var computedStyle = windowObj.getComputedStyle(node);
  818. var hasPseudoVarBug = computedStyle !== null && computedStyle.borderTopStyle === 'solid';
  819. node.remove();
  820. return hasPseudoVarBug;
  821. }
  822. /**
  823. * @param {!Window} windowObj
  824. * @param {boolean=} forceRefresh
  825. * @return {boolean|undefined}
  826. */
  827. function supportsCssVariables(windowObj) {
  828. var forceRefresh = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  829. var supportsCssVariables = supportsCssVariables_;
  830. if (typeof supportsCssVariables_ === 'boolean' && !forceRefresh) {
  831. return supportsCssVariables;
  832. }
  833. var supportsFunctionPresent = windowObj.CSS && typeof windowObj.CSS.supports === 'function';
  834. if (!supportsFunctionPresent) {
  835. return;
  836. }
  837. var explicitlySupportsCssVars = windowObj.CSS.supports('--css-vars', 'yes');
  838. // See: https://bugs.webkit.org/show_bug.cgi?id=154669
  839. // See: README section on Safari
  840. var weAreFeatureDetectingSafari10plus = windowObj.CSS.supports('(--css-vars: yes)') && windowObj.CSS.supports('color', '#00000000');
  841. if (explicitlySupportsCssVars || weAreFeatureDetectingSafari10plus) {
  842. supportsCssVariables = !detectEdgePseudoVarBug(windowObj);
  843. } else {
  844. supportsCssVariables = false;
  845. }
  846. if (!forceRefresh) {
  847. supportsCssVariables_ = supportsCssVariables;
  848. }
  849. return supportsCssVariables;
  850. }
  851. //
  852. /**
  853. * Determine whether the current browser supports passive event listeners, and if so, use them.
  854. * @param {!Window=} globalObj
  855. * @param {boolean=} forceRefresh
  856. * @return {boolean|!EventListenerOptions}
  857. */
  858. function applyPassive() {
  859. var globalObj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window;
  860. var forceRefresh = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  861. if (supportsPassive_ === undefined || forceRefresh) {
  862. var isSupported = false;
  863. try {
  864. globalObj.document.addEventListener('test', null, { get passive() {
  865. isSupported = true;
  866. return isSupported;
  867. } });
  868. } catch (e) {}
  869. supportsPassive_ = isSupported;
  870. }
  871. return supportsPassive_ ? /** @type {!EventListenerOptions} */{ passive: true } : false;
  872. }
  873. /**
  874. * @param {!Object} HTMLElementPrototype
  875. * @return {string}
  876. */
  877. function getMatchesProperty(HTMLElementPrototype) {
  878. /**
  879. * Order is important because we return the first existing method we find.
  880. * Do not change the order of the items in the below array.
  881. */
  882. var matchesMethods = ['matches', 'webkitMatchesSelector', 'msMatchesSelector'];
  883. var method = 'matches';
  884. for (var i = 0; i < matchesMethods.length; i++) {
  885. var matchesMethod = matchesMethods[i];
  886. if (matchesMethod in HTMLElementPrototype) {
  887. method = matchesMethod;
  888. break;
  889. }
  890. }
  891. return method;
  892. }
  893. /**
  894. * @param {!Event} ev
  895. * @param {{x: number, y: number}} pageOffset
  896. * @param {!ClientRect} clientRect
  897. * @return {{x: number, y: number}}
  898. */
  899. function getNormalizedEventCoords(ev, pageOffset, clientRect) {
  900. var x = pageOffset.x,
  901. y = pageOffset.y;
  902. var documentX = x + clientRect.left;
  903. var documentY = y + clientRect.top;
  904. var normalizedX = void 0;
  905. var normalizedY = void 0;
  906. // Determine touch point relative to the ripple container.
  907. if (ev.type === 'touchstart') {
  908. ev = /** @type {!TouchEvent} */ev;
  909. normalizedX = ev.changedTouches[0].pageX - documentX;
  910. normalizedY = ev.changedTouches[0].pageY - documentY;
  911. } else {
  912. ev = /** @type {!MouseEvent} */ev;
  913. normalizedX = ev.pageX - documentX;
  914. normalizedY = ev.pageY - documentY;
  915. }
  916. return { x: normalizedX, y: normalizedY };
  917. }
  918. /***/ }),
  919. /* 6 */
  920. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  921. "use strict";
  922. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  923. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  924. /**
  925. * @license
  926. * Copyright 2018 Google Inc.
  927. *
  928. * Permission is hereby granted, free of charge, to any person obtaining a copy
  929. * of this software and associated documentation files (the "Software"), to deal
  930. * in the Software without restriction, including without limitation the rights
  931. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  932. * copies of the Software, and to permit persons to whom the Software is
  933. * furnished to do so, subject to the following conditions:
  934. *
  935. * The above copyright notice and this permission notice shall be included in
  936. * all copies or substantial portions of the Software.
  937. *
  938. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  939. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  940. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  941. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  942. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  943. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  944. * THE SOFTWARE.
  945. */
  946. /* eslint no-unused-vars: [2, {"args": "none"}] */
  947. /**
  948. * Adapter for MDC Top App Bar
  949. *
  950. * Defines the shape of the adapter expected by the foundation. Implement this
  951. * adapter to integrate the Top App Bar into your framework. See
  952. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  953. * for more information.
  954. *
  955. * @record
  956. */
  957. var MDCTopAppBarAdapter = function () {
  958. function MDCTopAppBarAdapter() {
  959. _classCallCheck(this, MDCTopAppBarAdapter);
  960. }
  961. _createClass(MDCTopAppBarAdapter, [{
  962. key: "addClass",
  963. /**
  964. * Adds a class to the root Element.
  965. * @param {string} className
  966. */
  967. value: function addClass(className) {}
  968. /**
  969. * Removes a class from the root Element.
  970. * @param {string} className
  971. */
  972. }, {
  973. key: "removeClass",
  974. value: function removeClass(className) {}
  975. /**
  976. * Returns true if the root Element contains the given class.
  977. * @param {string} className
  978. * @return {boolean}
  979. */
  980. }, {
  981. key: "hasClass",
  982. value: function hasClass(className) {}
  983. /**
  984. * Sets the specified inline style property on the root Element to the given value.
  985. * @param {string} property
  986. * @param {string} value
  987. */
  988. }, {
  989. key: "setStyle",
  990. value: function setStyle(property, value) {}
  991. /**
  992. * Gets the height of the top app bar.
  993. * @return {number}
  994. */
  995. }, {
  996. key: "getTopAppBarHeight",
  997. value: function getTopAppBarHeight() {}
  998. /**
  999. * Registers an event handler on the navigation icon element for a given event.
  1000. * @param {string} type
  1001. * @param {function(!Event): undefined} handler
  1002. */
  1003. }, {
  1004. key: "registerNavigationIconInteractionHandler",
  1005. value: function registerNavigationIconInteractionHandler(type, handler) {}
  1006. /**
  1007. * Deregisters an event handler on the navigation icon element for a given event.
  1008. * @param {string} type
  1009. * @param {function(!Event): undefined} handler
  1010. */
  1011. }, {
  1012. key: "deregisterNavigationIconInteractionHandler",
  1013. value: function deregisterNavigationIconInteractionHandler(type, handler) {}
  1014. /**
  1015. * Emits an event when the navigation icon is clicked.
  1016. */
  1017. }, {
  1018. key: "notifyNavigationIconClicked",
  1019. value: function notifyNavigationIconClicked() {}
  1020. /** @param {function(!Event)} handler */
  1021. }, {
  1022. key: "registerScrollHandler",
  1023. value: function registerScrollHandler(handler) {}
  1024. /** @param {function(!Event)} handler */
  1025. }, {
  1026. key: "deregisterScrollHandler",
  1027. value: function deregisterScrollHandler(handler) {}
  1028. /** @param {function(!Event)} handler */
  1029. }, {
  1030. key: "registerResizeHandler",
  1031. value: function registerResizeHandler(handler) {}
  1032. /** @param {function(!Event)} handler */
  1033. }, {
  1034. key: "deregisterResizeHandler",
  1035. value: function deregisterResizeHandler(handler) {}
  1036. /** @return {number} */
  1037. }, {
  1038. key: "getViewportScrollY",
  1039. value: function getViewportScrollY() {}
  1040. /** @return {number} */
  1041. }, {
  1042. key: "getTotalActionItems",
  1043. value: function getTotalActionItems() {}
  1044. }]);
  1045. return MDCTopAppBarAdapter;
  1046. }();
  1047. /* unused harmony default export */ var _unused_webpack_default_export = (MDCTopAppBarAdapter);
  1048. /***/ }),
  1049. /* 7 */
  1050. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1051. "use strict";
  1052. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; });
  1053. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  1054. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; });
  1055. /**
  1056. * @license
  1057. * Copyright 2018 Google Inc.
  1058. *
  1059. * Permission is hereby granted, free of charge, to any person obtaining a copy
  1060. * of this software and associated documentation files (the "Software"), to deal
  1061. * in the Software without restriction, including without limitation the rights
  1062. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  1063. * copies of the Software, and to permit persons to whom the Software is
  1064. * furnished to do so, subject to the following conditions:
  1065. *
  1066. * The above copyright notice and this permission notice shall be included in
  1067. * all copies or substantial portions of the Software.
  1068. *
  1069. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  1070. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  1071. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  1072. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  1073. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  1074. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  1075. * THE SOFTWARE.
  1076. */
  1077. /** @enum {string} */
  1078. var cssClasses = {
  1079. FIXED_CLASS: 'mdc-top-app-bar--fixed',
  1080. FIXED_SCROLLED_CLASS: 'mdc-top-app-bar--fixed-scrolled',
  1081. SHORT_CLASS: 'mdc-top-app-bar--short',
  1082. SHORT_HAS_ACTION_ITEM_CLASS: 'mdc-top-app-bar--short-has-action-item',
  1083. SHORT_COLLAPSED_CLASS: 'mdc-top-app-bar--short-collapsed'
  1084. };
  1085. /** @enum {number} */
  1086. var numbers = {
  1087. DEBOUNCE_THROTTLE_RESIZE_TIME_MS: 100,
  1088. MAX_TOP_APP_BAR_HEIGHT: 128
  1089. };
  1090. /** @enum {string} */
  1091. var strings = {
  1092. ACTION_ITEM_SELECTOR: '.mdc-top-app-bar__action-item',
  1093. NAVIGATION_EVENT: 'MDCTopAppBar:nav',
  1094. NAVIGATION_ICON_SELECTOR: '.mdc-top-app-bar__navigation-icon',
  1095. ROOT_SELECTOR: '.mdc-top-app-bar',
  1096. TITLE_SELECTOR: '.mdc-top-app-bar__title'
  1097. };
  1098. /***/ }),
  1099. /* 8 */
  1100. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1101. "use strict";
  1102. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  1103. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "closest", function() { return closest; });
  1104. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "matches", function() { return matches; });
  1105. /**
  1106. * @license
  1107. * Copyright 2018 Google Inc.
  1108. *
  1109. * Permission is hereby granted, free of charge, to any person obtaining a copy
  1110. * of this software and associated documentation files (the "Software"), to deal
  1111. * in the Software without restriction, including without limitation the rights
  1112. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  1113. * copies of the Software, and to permit persons to whom the Software is
  1114. * furnished to do so, subject to the following conditions:
  1115. *
  1116. * The above copyright notice and this permission notice shall be included in
  1117. * all copies or substantial portions of the Software.
  1118. *
  1119. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  1120. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  1121. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  1122. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  1123. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  1124. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  1125. * THE SOFTWARE.
  1126. */
  1127. /**
  1128. * @fileoverview A "ponyfill" is a polyfill that doesn't modify the global prototype chain.
  1129. * This makes ponyfills safer than traditional polyfills, especially for libraries like MDC.
  1130. */
  1131. /**
  1132. * @param {!Element} element
  1133. * @param {string} selector
  1134. * @return {?Element}
  1135. */
  1136. function closest(element, selector) {
  1137. if (element.closest) {
  1138. return element.closest(selector);
  1139. }
  1140. var el = element;
  1141. while (el) {
  1142. if (matches(el, selector)) {
  1143. return el;
  1144. }
  1145. el = el.parentElement;
  1146. }
  1147. return null;
  1148. }
  1149. /**
  1150. * @param {!Element} element
  1151. * @param {string} selector
  1152. * @return {boolean}
  1153. */
  1154. function matches(element, selector) {
  1155. var nativeMatches = element.matches || element.webkitMatchesSelector || element.msMatchesSelector;
  1156. return nativeMatches.call(element, selector);
  1157. }
  1158. /***/ }),
  1159. /* 9 */
  1160. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1161. "use strict";
  1162. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  1163. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCFloatingLabel", function() { return MDCFloatingLabel; });
  1164. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  1165. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(41);
  1166. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(91);
  1167. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCFloatingLabelFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  1168. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  1169. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1170. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  1171. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  1172. /**
  1173. * @license
  1174. * Copyright 2016 Google Inc.
  1175. *
  1176. * Permission is hereby granted, free of charge, to any person obtaining a copy
  1177. * of this software and associated documentation files (the "Software"), to deal
  1178. * in the Software without restriction, including without limitation the rights
  1179. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  1180. * copies of the Software, and to permit persons to whom the Software is
  1181. * furnished to do so, subject to the following conditions:
  1182. *
  1183. * The above copyright notice and this permission notice shall be included in
  1184. * all copies or substantial portions of the Software.
  1185. *
  1186. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  1187. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  1188. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  1189. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  1190. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  1191. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  1192. * THE SOFTWARE.
  1193. */
  1194. /**
  1195. * @extends {MDCComponent<!MDCFloatingLabelFoundation>}
  1196. * @final
  1197. */
  1198. var MDCFloatingLabel = function (_MDCComponent) {
  1199. _inherits(MDCFloatingLabel, _MDCComponent);
  1200. function MDCFloatingLabel() {
  1201. _classCallCheck(this, MDCFloatingLabel);
  1202. return _possibleConstructorReturn(this, (MDCFloatingLabel.__proto__ || Object.getPrototypeOf(MDCFloatingLabel)).apply(this, arguments));
  1203. }
  1204. _createClass(MDCFloatingLabel, [{
  1205. key: 'shake',
  1206. /**
  1207. * Styles the label to produce the label shake for errors.
  1208. * @param {boolean} shouldShake styles the label to shake by adding shake class
  1209. * if true, otherwise will stop shaking by removing shake class.
  1210. */
  1211. value: function shake(shouldShake) {
  1212. this.foundation_.shake(shouldShake);
  1213. }
  1214. /**
  1215. * Styles label to float/dock.
  1216. * @param {boolean} shouldFloat styles the label to float by adding float class
  1217. * if true, otherwise docks the label by removing the float class.
  1218. */
  1219. }, {
  1220. key: 'float',
  1221. value: function float(shouldFloat) {
  1222. this.foundation_.float(shouldFloat);
  1223. }
  1224. /**
  1225. * @return {number}
  1226. */
  1227. }, {
  1228. key: 'getWidth',
  1229. value: function getWidth() {
  1230. return this.foundation_.getWidth();
  1231. }
  1232. /**
  1233. * @return {!MDCFloatingLabelFoundation}
  1234. */
  1235. }, {
  1236. key: 'getDefaultFoundation',
  1237. value: function getDefaultFoundation() {
  1238. var _this2 = this;
  1239. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]({
  1240. addClass: function addClass(className) {
  1241. return _this2.root_.classList.add(className);
  1242. },
  1243. removeClass: function removeClass(className) {
  1244. return _this2.root_.classList.remove(className);
  1245. },
  1246. getWidth: function getWidth() {
  1247. return _this2.root_.scrollWidth;
  1248. },
  1249. registerInteractionHandler: function registerInteractionHandler(evtType, handler) {
  1250. return _this2.root_.addEventListener(evtType, handler);
  1251. },
  1252. deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) {
  1253. return _this2.root_.removeEventListener(evtType, handler);
  1254. }
  1255. });
  1256. }
  1257. }], [{
  1258. key: 'attachTo',
  1259. /**
  1260. * @param {!Element} root
  1261. * @return {!MDCFloatingLabel}
  1262. */
  1263. value: function attachTo(root) {
  1264. return new MDCFloatingLabel(root);
  1265. }
  1266. }]);
  1267. return MDCFloatingLabel;
  1268. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  1269. /***/ }),
  1270. /* 10 */
  1271. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1272. "use strict";
  1273. /* unused harmony export MDCTabDimensions */
  1274. /* unused harmony export MDCTabInteractionEventType */
  1275. /* unused harmony export MDCTabAdapter */
  1276. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  1277. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1278. /**
  1279. * @license
  1280. * Copyright 2018 Google Inc.
  1281. *
  1282. * Permission is hereby granted, free of charge, to any person obtaining a copy
  1283. * of this software and associated documentation files (the "Software"), to deal
  1284. * in the Software without restriction, including without limitation the rights
  1285. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  1286. * copies of the Software, and to permit persons to whom the Software is
  1287. * furnished to do so, subject to the following conditions:
  1288. *
  1289. * The above copyright notice and this permission notice shall be included in
  1290. * all copies or substantial portions of the Software.
  1291. *
  1292. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  1293. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  1294. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  1295. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  1296. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  1297. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  1298. * THE SOFTWARE.
  1299. */
  1300. /* eslint no-unused-vars: [2, {"args": "none"}] */
  1301. /**
  1302. * MDCTabDimensions provides details about the left and right edges of the Tab
  1303. * root element and the Tab content element. These values are used to determine
  1304. * the visual position of the Tab with respect it's parent container.
  1305. * @typedef {{rootLeft: number, rootRight: number, contentLeft: number, contentRight: number}}
  1306. */
  1307. var MDCTabDimensions = void 0;
  1308. /**
  1309. * @typedef {{
  1310. * detail: {
  1311. * tabId: string,
  1312. * },
  1313. * bubbles: boolean,
  1314. * }}
  1315. */
  1316. var MDCTabInteractionEventType = void 0;
  1317. /**
  1318. * Adapter for MDC Tab.
  1319. *
  1320. * Defines the shape of the adapter expected by the foundation. Implement this
  1321. * adapter to integrate the Tab into your framework. See
  1322. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  1323. * for more information.
  1324. *
  1325. * @record
  1326. */
  1327. var MDCTabAdapter = function () {
  1328. function MDCTabAdapter() {
  1329. _classCallCheck(this, MDCTabAdapter);
  1330. }
  1331. _createClass(MDCTabAdapter, [{
  1332. key: "addClass",
  1333. /**
  1334. * Adds the given className to the root element.
  1335. * @param {string} className The className to add
  1336. */
  1337. value: function addClass(className) {}
  1338. /**
  1339. * Removes the given className from the root element.
  1340. * @param {string} className The className to remove
  1341. */
  1342. }, {
  1343. key: "removeClass",
  1344. value: function removeClass(className) {}
  1345. /**
  1346. * Returns whether the root element has the given className.
  1347. * @param {string} className The className to remove
  1348. * @return {boolean}
  1349. */
  1350. }, {
  1351. key: "hasClass",
  1352. value: function hasClass(className) {}
  1353. /**
  1354. * Sets the given attrName of the root element to the given value.
  1355. * @param {string} attr The attribute name to set
  1356. * @param {string} value The value so give the attribute
  1357. */
  1358. }, {
  1359. key: "setAttr",
  1360. value: function setAttr(attr, value) {}
  1361. /**
  1362. * Activates the indicator element.
  1363. * @param {!ClientRect=} previousIndicatorClientRect The client rect of the previously activated indicator
  1364. */
  1365. }, {
  1366. key: "activateIndicator",
  1367. value: function activateIndicator(previousIndicatorClientRect) {}
  1368. /** Deactivates the indicator. */
  1369. }, {
  1370. key: "deactivateIndicator",
  1371. value: function deactivateIndicator() {}
  1372. /**
  1373. * Emits the MDCTab:interacted event for use by parent components
  1374. */
  1375. }, {
  1376. key: "notifyInteracted",
  1377. value: function notifyInteracted() {}
  1378. /**
  1379. * Returns the offsetLeft value of the root element.
  1380. * @return {number}
  1381. */
  1382. }, {
  1383. key: "getOffsetLeft",
  1384. value: function getOffsetLeft() {}
  1385. /**
  1386. * Returns the offsetWidth value of the root element.
  1387. * @return {number}
  1388. */
  1389. }, {
  1390. key: "getOffsetWidth",
  1391. value: function getOffsetWidth() {}
  1392. /**
  1393. * Returns the offsetLeft of the content element.
  1394. * @return {number}
  1395. */
  1396. }, {
  1397. key: "getContentOffsetLeft",
  1398. value: function getContentOffsetLeft() {}
  1399. /**
  1400. * Returns the offsetWidth of the content element.
  1401. * @return {number}
  1402. */
  1403. }, {
  1404. key: "getContentOffsetWidth",
  1405. value: function getContentOffsetWidth() {}
  1406. /**
  1407. * Applies focus to the root element
  1408. */
  1409. }, {
  1410. key: "focus",
  1411. value: function focus() {}
  1412. }]);
  1413. return MDCTabAdapter;
  1414. }();
  1415. /***/ }),
  1416. /* 11 */
  1417. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1418. "use strict";
  1419. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__adapter__ = __webpack_require__(4);
  1420. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  1421. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1422. /**
  1423. * @license
  1424. * Copyright 2018 Google Inc.
  1425. *
  1426. * Permission is hereby granted, free of charge, to any person obtaining a copy
  1427. * of this software and associated documentation files (the "Software"), to deal
  1428. * in the Software without restriction, including without limitation the rights
  1429. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  1430. * copies of the Software, and to permit persons to whom the Software is
  1431. * furnished to do so, subject to the following conditions:
  1432. *
  1433. * The above copyright notice and this permission notice shall be included in
  1434. * all copies or substantial portions of the Software.
  1435. *
  1436. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  1437. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  1438. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  1439. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  1440. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  1441. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  1442. * THE SOFTWARE.
  1443. */
  1444. /* eslint no-unused-vars: [2, {"args": "none"}] */
  1445. /* eslint-disable no-unused-vars */
  1446. /* eslint-enable no-unused-vars */
  1447. /**
  1448. * @abstract
  1449. */
  1450. var MDCTabScrollerRTL = function () {
  1451. /** @param {!MDCTabScrollerAdapter} adapter */
  1452. function MDCTabScrollerRTL(adapter) {
  1453. _classCallCheck(this, MDCTabScrollerRTL);
  1454. /** @private */
  1455. this.adapter_ = adapter;
  1456. }
  1457. /**
  1458. * @param {number} translateX The current translateX position
  1459. * @return {number}
  1460. * @abstract
  1461. */
  1462. _createClass(MDCTabScrollerRTL, [{
  1463. key: 'getScrollPositionRTL',
  1464. value: function getScrollPositionRTL(translateX) {}
  1465. /**
  1466. * @param {number} scrollX
  1467. * @return {!MDCTabScrollerAnimation}
  1468. * @abstract
  1469. */
  1470. }, {
  1471. key: 'scrollToRTL',
  1472. value: function scrollToRTL(scrollX) {}
  1473. /**
  1474. * @param {number} scrollX
  1475. * @return {!MDCTabScrollerAnimation}
  1476. * @abstract
  1477. */
  1478. }, {
  1479. key: 'incrementScrollRTL',
  1480. value: function incrementScrollRTL(scrollX) {}
  1481. /**
  1482. * @param {number} scrollX The current scrollX position
  1483. * @param {number} translateX The current translateX position
  1484. * @return {number}
  1485. * @abstract
  1486. */
  1487. }, {
  1488. key: 'getAnimatingScrollPosition',
  1489. value: function getAnimatingScrollPosition(scrollX, translateX) {}
  1490. }]);
  1491. return MDCTabScrollerRTL;
  1492. }();
  1493. /* harmony default export */ __webpack_exports__["a"] = (MDCTabScrollerRTL);
  1494. /***/ }),
  1495. /* 12 */
  1496. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1497. "use strict";
  1498. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__constants__ = __webpack_require__(7);
  1499. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(6);
  1500. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_base_foundation__ = __webpack_require__(0);
  1501. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  1502. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  1503. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1504. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  1505. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  1506. /**
  1507. * @license
  1508. * Copyright 2018 Google Inc.
  1509. *
  1510. * Permission is hereby granted, free of charge, to any person obtaining a copy
  1511. * of this software and associated documentation files (the "Software"), to deal
  1512. * in the Software without restriction, including without limitation the rights
  1513. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  1514. * copies of the Software, and to permit persons to whom the Software is
  1515. * furnished to do so, subject to the following conditions:
  1516. *
  1517. * The above copyright notice and this permission notice shall be included in
  1518. * all copies or substantial portions of the Software.
  1519. *
  1520. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  1521. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  1522. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  1523. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  1524. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  1525. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  1526. * THE SOFTWARE.
  1527. */
  1528. /**
  1529. * @extends {MDCFoundation<!MDCTopAppBarAdapter>}
  1530. */
  1531. var MDCTopAppBarBaseFoundation = function (_MDCFoundation) {
  1532. _inherits(MDCTopAppBarBaseFoundation, _MDCFoundation);
  1533. _createClass(MDCTopAppBarBaseFoundation, null, [{
  1534. key: 'strings',
  1535. /** @return enum {string} */
  1536. get: function get() {
  1537. return __WEBPACK_IMPORTED_MODULE_0__constants__["c" /* strings */];
  1538. }
  1539. /** @return enum {string} */
  1540. }, {
  1541. key: 'cssClasses',
  1542. get: function get() {
  1543. return __WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */];
  1544. }
  1545. /** @return enum {number} */
  1546. }, {
  1547. key: 'numbers',
  1548. get: function get() {
  1549. return __WEBPACK_IMPORTED_MODULE_0__constants__["b" /* numbers */];
  1550. }
  1551. /**
  1552. * {@see MDCTopAppBarAdapter} for typing information on parameters and return
  1553. * types.
  1554. * @return {!MDCTopAppBarAdapter}
  1555. */
  1556. }, {
  1557. key: 'defaultAdapter',
  1558. get: function get() {
  1559. return (/** @type {!MDCTopAppBarAdapter} */{
  1560. hasClass: function hasClass() /* className: string */{},
  1561. addClass: function addClass() /* className: string */{},
  1562. removeClass: function removeClass() /* className: string */{},
  1563. setStyle: function setStyle() /* property: string, value: string */{},
  1564. getTopAppBarHeight: function getTopAppBarHeight() {},
  1565. registerNavigationIconInteractionHandler: function registerNavigationIconInteractionHandler() /* type: string, handler: EventListener */{},
  1566. deregisterNavigationIconInteractionHandler: function deregisterNavigationIconInteractionHandler() /* type: string, handler: EventListener */{},
  1567. notifyNavigationIconClicked: function notifyNavigationIconClicked() {},
  1568. registerScrollHandler: function registerScrollHandler() /* handler: EventListener */{},
  1569. deregisterScrollHandler: function deregisterScrollHandler() /* handler: EventListener */{},
  1570. registerResizeHandler: function registerResizeHandler() /* handler: EventListener */{},
  1571. deregisterResizeHandler: function deregisterResizeHandler() /* handler: EventListener */{},
  1572. getViewportScrollY: function getViewportScrollY() {
  1573. return (/* number */0
  1574. );
  1575. },
  1576. getTotalActionItems: function getTotalActionItems() {
  1577. return (/* number */0
  1578. );
  1579. }
  1580. }
  1581. );
  1582. }
  1583. /**
  1584. * @param {!MDCTopAppBarAdapter} adapter
  1585. */
  1586. }]);
  1587. function MDCTopAppBarBaseFoundation( /** @type {!MDCTopAppBarAdapter} */adapter) {
  1588. _classCallCheck(this, MDCTopAppBarBaseFoundation);
  1589. var _this = _possibleConstructorReturn(this, (MDCTopAppBarBaseFoundation.__proto__ || Object.getPrototypeOf(MDCTopAppBarBaseFoundation)).call(this, _extends(MDCTopAppBarBaseFoundation.defaultAdapter, adapter)));
  1590. _this.navClickHandler_ = function () {
  1591. return _this.adapter_.notifyNavigationIconClicked();
  1592. };
  1593. _this.scrollHandler_ = function () {};
  1594. return _this;
  1595. }
  1596. _createClass(MDCTopAppBarBaseFoundation, [{
  1597. key: 'init',
  1598. value: function init() {
  1599. this.adapter_.registerNavigationIconInteractionHandler('click', this.navClickHandler_);
  1600. }
  1601. }, {
  1602. key: 'destroy',
  1603. value: function destroy() {
  1604. this.adapter_.deregisterNavigationIconInteractionHandler('click', this.navClickHandler_);
  1605. }
  1606. }, {
  1607. key: 'initScrollHandler',
  1608. value: function initScrollHandler() {
  1609. this.adapter_.registerScrollHandler(this.scrollHandler_);
  1610. }
  1611. }, {
  1612. key: 'destroyScrollHandler',
  1613. value: function destroyScrollHandler() {
  1614. this.adapter_.deregisterScrollHandler(this.scrollHandler_);
  1615. }
  1616. }]);
  1617. return MDCTopAppBarBaseFoundation;
  1618. }(__WEBPACK_IMPORTED_MODULE_2__material_base_foundation__["a" /* default */]);
  1619. /* harmony default export */ __webpack_exports__["a"] = (MDCTopAppBarBaseFoundation);
  1620. /***/ }),
  1621. /* 13 */
  1622. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1623. "use strict";
  1624. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return transformStyleProperties; });
  1625. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getCorrectEventName; });
  1626. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getCorrectPropertyName; });
  1627. /**
  1628. * @license
  1629. * Copyright 2016 Google Inc.
  1630. *
  1631. * Permission is hereby granted, free of charge, to any person obtaining a copy
  1632. * of this software and associated documentation files (the "Software"), to deal
  1633. * in the Software without restriction, including without limitation the rights
  1634. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  1635. * copies of the Software, and to permit persons to whom the Software is
  1636. * furnished to do so, subject to the following conditions:
  1637. *
  1638. * The above copyright notice and this permission notice shall be included in
  1639. * all copies or substantial portions of the Software.
  1640. *
  1641. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  1642. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  1643. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  1644. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  1645. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  1646. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  1647. * THE SOFTWARE.
  1648. */
  1649. /**
  1650. * @typedef {{
  1651. * noPrefix: string,
  1652. * webkitPrefix: string,
  1653. * styleProperty: string
  1654. * }}
  1655. */
  1656. var VendorPropertyMapType = void 0;
  1657. /** @const {Object<string, !VendorPropertyMapType>} */
  1658. var eventTypeMap = {
  1659. 'animationstart': {
  1660. noPrefix: 'animationstart',
  1661. webkitPrefix: 'webkitAnimationStart',
  1662. styleProperty: 'animation'
  1663. },
  1664. 'animationend': {
  1665. noPrefix: 'animationend',
  1666. webkitPrefix: 'webkitAnimationEnd',
  1667. styleProperty: 'animation'
  1668. },
  1669. 'animationiteration': {
  1670. noPrefix: 'animationiteration',
  1671. webkitPrefix: 'webkitAnimationIteration',
  1672. styleProperty: 'animation'
  1673. },
  1674. 'transitionend': {
  1675. noPrefix: 'transitionend',
  1676. webkitPrefix: 'webkitTransitionEnd',
  1677. styleProperty: 'transition'
  1678. }
  1679. };
  1680. /** @const {Object<string, !VendorPropertyMapType>} */
  1681. var cssPropertyMap = {
  1682. 'animation': {
  1683. noPrefix: 'animation',
  1684. webkitPrefix: '-webkit-animation'
  1685. },
  1686. 'transform': {
  1687. noPrefix: 'transform',
  1688. webkitPrefix: '-webkit-transform'
  1689. },
  1690. 'transition': {
  1691. noPrefix: 'transition',
  1692. webkitPrefix: '-webkit-transition'
  1693. }
  1694. };
  1695. /**
  1696. * @param {!Object} windowObj
  1697. * @return {boolean}
  1698. */
  1699. function hasProperShape(windowObj) {
  1700. return windowObj['document'] !== undefined && typeof windowObj['document']['createElement'] === 'function';
  1701. }
  1702. /**
  1703. * @param {string} eventType
  1704. * @return {boolean}
  1705. */
  1706. function eventFoundInMaps(eventType) {
  1707. return eventType in eventTypeMap || eventType in cssPropertyMap;
  1708. }
  1709. /**
  1710. * @param {string} eventType
  1711. * @param {!Object<string, !VendorPropertyMapType>} map
  1712. * @param {!Element} el
  1713. * @return {string}
  1714. */
  1715. function getJavaScriptEventName(eventType, map, el) {
  1716. return map[eventType].styleProperty in el.style ? map[eventType].noPrefix : map[eventType].webkitPrefix;
  1717. }
  1718. /**
  1719. * Helper function to determine browser prefix for CSS3 animation events
  1720. * and property names.
  1721. * @param {!Object} windowObj
  1722. * @param {string} eventType
  1723. * @return {string}
  1724. */
  1725. function getAnimationName(windowObj, eventType) {
  1726. if (!hasProperShape(windowObj) || !eventFoundInMaps(eventType)) {
  1727. return eventType;
  1728. }
  1729. var map = /** @type {!Object<string, !VendorPropertyMapType>} */eventType in eventTypeMap ? eventTypeMap : cssPropertyMap;
  1730. var el = windowObj['document']['createElement']('div');
  1731. var eventName = '';
  1732. if (map === eventTypeMap) {
  1733. eventName = getJavaScriptEventName(eventType, map, el);
  1734. } else {
  1735. eventName = map[eventType].noPrefix in el.style ? map[eventType].noPrefix : map[eventType].webkitPrefix;
  1736. }
  1737. return eventName;
  1738. }
  1739. // Public functions to access getAnimationName() for JavaScript events or CSS
  1740. // property names.
  1741. var transformStyleProperties = ['transform', 'WebkitTransform', 'MozTransform', 'OTransform', 'MSTransform'];
  1742. /**
  1743. * @param {!Object} windowObj
  1744. * @param {string} eventType
  1745. * @return {string}
  1746. */
  1747. function getCorrectEventName(windowObj, eventType) {
  1748. return getAnimationName(windowObj, eventType);
  1749. }
  1750. /**
  1751. * @param {!Object} windowObj
  1752. * @param {string} eventType
  1753. * @return {string}
  1754. */
  1755. function getCorrectPropertyName(windowObj, eventType) {
  1756. return getAnimationName(windowObj, eventType);
  1757. }
  1758. /***/ }),
  1759. /* 14 */
  1760. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1761. "use strict";
  1762. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  1763. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCList", function() { return MDCList; });
  1764. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  1765. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(15);
  1766. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__adapter__ = __webpack_require__(38);
  1767. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_dom_ponyfill__ = __webpack_require__(8);
  1768. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__constants__ = __webpack_require__(39);
  1769. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCListFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__foundation__["a"]; });
  1770. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  1771. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  1772. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1773. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  1774. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  1775. /**
  1776. * @license
  1777. * Copyright 2018 Google Inc.
  1778. *
  1779. * Permission is hereby granted, free of charge, to any person obtaining a copy
  1780. * of this software and associated documentation files (the "Software"), to deal
  1781. * in the Software without restriction, including without limitation the rights
  1782. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  1783. * copies of the Software, and to permit persons to whom the Software is
  1784. * furnished to do so, subject to the following conditions:
  1785. *
  1786. * The above copyright notice and this permission notice shall be included in
  1787. * all copies or substantial portions of the Software.
  1788. *
  1789. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  1790. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  1791. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  1792. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  1793. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  1794. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  1795. * THE SOFTWARE.
  1796. */
  1797. // eslint-disable-line no-unused-vars
  1798. /**
  1799. * @extends MDCComponent<!MDCListFoundation>
  1800. */
  1801. var MDCList = function (_MDCComponent) {
  1802. _inherits(MDCList, _MDCComponent);
  1803. /** @param {...?} args */
  1804. function MDCList() {
  1805. var _ref;
  1806. _classCallCheck(this, MDCList);
  1807. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  1808. args[_key] = arguments[_key];
  1809. }
  1810. /** @private {!Function} */
  1811. var _this = _possibleConstructorReturn(this, (_ref = MDCList.__proto__ || Object.getPrototypeOf(MDCList)).call.apply(_ref, [this].concat(args)));
  1812. _this.handleKeydown_;
  1813. /** @private {!Function} */
  1814. _this.handleClick_;
  1815. /** @private {!Function} */
  1816. _this.focusInEventListener_;
  1817. /** @private {!Function} */
  1818. _this.focusOutEventListener_;
  1819. return _this;
  1820. }
  1821. /**
  1822. * @param {!Element} root
  1823. * @return {!MDCList}
  1824. */
  1825. _createClass(MDCList, [{
  1826. key: 'destroy',
  1827. value: function destroy() {
  1828. this.root_.removeEventListener('keydown', this.handleKeydown_);
  1829. this.root_.removeEventListener('click', this.handleClick_);
  1830. this.root_.removeEventListener('focusin', this.focusInEventListener_);
  1831. this.root_.removeEventListener('focusout', this.focusOutEventListener_);
  1832. }
  1833. }, {
  1834. key: 'initialSyncWithDOM',
  1835. value: function initialSyncWithDOM() {
  1836. this.handleClick_ = this.handleClickEvent_.bind(this);
  1837. this.handleKeydown_ = this.handleKeydownEvent_.bind(this);
  1838. this.focusInEventListener_ = this.handleFocusInEvent_.bind(this);
  1839. this.focusOutEventListener_ = this.handleFocusOutEvent_.bind(this);
  1840. this.root_.addEventListener('keydown', this.handleKeydown_);
  1841. this.root_.addEventListener('focusin', this.focusInEventListener_);
  1842. this.root_.addEventListener('focusout', this.focusOutEventListener_);
  1843. this.root_.addEventListener('click', this.handleClick_);
  1844. this.layout();
  1845. this.initializeListType();
  1846. }
  1847. }, {
  1848. key: 'layout',
  1849. value: function layout() {
  1850. var direction = this.root_.getAttribute(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].ARIA_ORIENTATION);
  1851. this.vertical = direction !== __WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].ARIA_ORIENTATION_HORIZONTAL;
  1852. // List items need to have at least tabindex=-1 to be focusable.
  1853. [].slice.call(this.root_.querySelectorAll('.mdc-list-item:not([tabindex])')).forEach(function (ele) {
  1854. ele.setAttribute('tabindex', -1);
  1855. });
  1856. // Child button/a elements are not tabbable until the list item is focused.
  1857. [].slice.call(this.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].FOCUSABLE_CHILD_ELEMENTS)).forEach(function (ele) {
  1858. return ele.setAttribute('tabindex', -1);
  1859. });
  1860. this.foundation_.layout();
  1861. }
  1862. /**
  1863. * Used to figure out which list item this event is targetting. Or returns -1 if
  1864. * there is no list item
  1865. * @param {Event} evt
  1866. * @private
  1867. */
  1868. }, {
  1869. key: 'getListItemIndex_',
  1870. value: function getListItemIndex_(evt) {
  1871. var eventTarget = /** @type {HTMLElement} */evt.target;
  1872. var index = -1;
  1873. // Find the first ancestor that is a list item or the list.
  1874. while (!eventTarget.classList.contains(__WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */].LIST_ITEM_CLASS) && !eventTarget.classList.contains(__WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */].ROOT)) {
  1875. eventTarget = eventTarget.parentElement;
  1876. }
  1877. // Get the index of the element if it is a list item.
  1878. if (eventTarget.classList.contains(__WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */].LIST_ITEM_CLASS)) {
  1879. index = this.listElements.indexOf(eventTarget);
  1880. }
  1881. return index;
  1882. }
  1883. /**
  1884. * Used to figure out which element was clicked before sending the event to the foundation.
  1885. * @param {Event} evt
  1886. * @private
  1887. */
  1888. }, {
  1889. key: 'handleFocusInEvent_',
  1890. value: function handleFocusInEvent_(evt) {
  1891. var index = this.getListItemIndex_(evt);
  1892. this.foundation_.handleFocusIn(evt, index);
  1893. }
  1894. /**
  1895. * Used to figure out which element was clicked before sending the event to the foundation.
  1896. * @param {Event} evt
  1897. * @private
  1898. */
  1899. }, {
  1900. key: 'handleFocusOutEvent_',
  1901. value: function handleFocusOutEvent_(evt) {
  1902. var index = this.getListItemIndex_(evt);
  1903. this.foundation_.handleFocusOut(evt, index);
  1904. }
  1905. /**
  1906. * Used to figure out which element was focused when keydown event occurred before sending the event to the
  1907. * foundation.
  1908. * @param {Event} evt
  1909. * @private
  1910. */
  1911. }, {
  1912. key: 'handleKeydownEvent_',
  1913. value: function handleKeydownEvent_(evt) {
  1914. var index = this.getListItemIndex_(evt);
  1915. if (index >= 0) {
  1916. this.foundation_.handleKeydown(evt, evt.target.classList.contains(__WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */].LIST_ITEM_CLASS), index);
  1917. }
  1918. }
  1919. /**
  1920. * Used to figure out which element was clicked before sending the event to the foundation.
  1921. * @param {Event} evt
  1922. * @private
  1923. */
  1924. }, {
  1925. key: 'handleClickEvent_',
  1926. value: function handleClickEvent_(evt) {
  1927. var index = this.getListItemIndex_(evt);
  1928. // Toggle the checkbox only if it's not the target of the event, or the checkbox will have 2 change events.
  1929. var toggleCheckbox = !Object(__WEBPACK_IMPORTED_MODULE_3__material_dom_ponyfill__["matches"])( /** @type {!Element} */evt.target, __WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].CHECKBOX_RADIO_SELECTOR);
  1930. this.foundation_.handleClick(index, toggleCheckbox);
  1931. }
  1932. /**
  1933. * Initialize selectedIndex value based on pre-selected checkbox list items, single selection or radio.
  1934. */
  1935. }, {
  1936. key: 'initializeListType',
  1937. value: function initializeListType() {
  1938. var _this2 = this;
  1939. var checkboxListItems = this.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].ARIA_ROLE_CHECKBOX_SELECTOR);
  1940. var singleSelectedListItem = this.root_.querySelector('.' + __WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */].LIST_ITEM_ACTIVATED_CLASS + ',\n .' + __WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */].LIST_ITEM_SELECTED_CLASS);
  1941. var radioSelectedListItem = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].ARIA_CHECKED_RADIO_SELECTOR);
  1942. if (checkboxListItems.length) {
  1943. var preselectedItems = this.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].ARIA_CHECKED_CHECKBOX_SELECTOR);
  1944. this.selectedIndex = [].map.call(preselectedItems, function (listItem) {
  1945. return _this2.listElements.indexOf(listItem);
  1946. });
  1947. } else if (singleSelectedListItem) {
  1948. if (singleSelectedListItem.classList.contains(__WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */].LIST_ITEM_ACTIVATED_CLASS)) {
  1949. this.foundation_.setUseActivatedClass(true);
  1950. }
  1951. this.singleSelection = true;
  1952. this.selectedIndex = this.listElements.indexOf(singleSelectedListItem);
  1953. } else if (radioSelectedListItem) {
  1954. this.selectedIndex = this.listElements.indexOf(radioSelectedListItem);
  1955. }
  1956. }
  1957. /** @param {boolean} value */
  1958. }, {
  1959. key: 'getDefaultFoundation',
  1960. /** @return {!MDCListFoundation} */
  1961. value: function getDefaultFoundation() {
  1962. var _this3 = this;
  1963. return new __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]( /** @type {!MDCListAdapter} */_extends({
  1964. getListItemCount: function getListItemCount() {
  1965. return _this3.listElements.length;
  1966. },
  1967. getFocusedElementIndex: function getFocusedElementIndex() {
  1968. return _this3.listElements.indexOf(document.activeElement);
  1969. },
  1970. setAttributeForElementIndex: function setAttributeForElementIndex(index, attr, value) {
  1971. var element = _this3.listElements[index];
  1972. if (element) {
  1973. element.setAttribute(attr, value);
  1974. }
  1975. },
  1976. removeAttributeForElementIndex: function removeAttributeForElementIndex(index, attr) {
  1977. var element = _this3.listElements[index];
  1978. if (element) {
  1979. element.removeAttribute(attr);
  1980. }
  1981. },
  1982. addClassForElementIndex: function addClassForElementIndex(index, className) {
  1983. var element = _this3.listElements[index];
  1984. if (element) {
  1985. element.classList.add(className);
  1986. }
  1987. },
  1988. removeClassForElementIndex: function removeClassForElementIndex(index, className) {
  1989. var element = _this3.listElements[index];
  1990. if (element) {
  1991. element.classList.remove(className);
  1992. }
  1993. },
  1994. focusItemAtIndex: function focusItemAtIndex(index) {
  1995. var element = _this3.listElements[index];
  1996. if (element) {
  1997. element.focus();
  1998. }
  1999. },
  2000. setTabIndexForListItemChildren: function setTabIndexForListItemChildren(listItemIndex, tabIndexValue) {
  2001. var element = _this3.listElements[listItemIndex];
  2002. var listItemChildren = [].slice.call(element.querySelectorAll(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].CHILD_ELEMENTS_TO_TOGGLE_TABINDEX));
  2003. listItemChildren.forEach(function (ele) {
  2004. return ele.setAttribute('tabindex', tabIndexValue);
  2005. });
  2006. },
  2007. hasCheckboxAtIndex: function hasCheckboxAtIndex(index) {
  2008. var listItem = _this3.listElements[index];
  2009. return !!listItem.querySelector(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].CHECKBOX_SELECTOR);
  2010. },
  2011. hasRadioAtIndex: function hasRadioAtIndex(index) {
  2012. var listItem = _this3.listElements[index];
  2013. return !!listItem.querySelector(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].RADIO_SELECTOR);
  2014. },
  2015. isCheckboxCheckedAtIndex: function isCheckboxCheckedAtIndex(index) {
  2016. var listItem = _this3.listElements[index];
  2017. var toggleEl = listItem.querySelector(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].CHECKBOX_SELECTOR);
  2018. return toggleEl.checked;
  2019. },
  2020. setCheckedCheckboxOrRadioAtIndex: function setCheckedCheckboxOrRadioAtIndex(index, isChecked) {
  2021. var listItem = _this3.listElements[index];
  2022. var toggleEl = listItem.querySelector(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].CHECKBOX_RADIO_SELECTOR);
  2023. toggleEl.checked = isChecked;
  2024. var event = document.createEvent('Event');
  2025. event.initEvent('change', true, true);
  2026. toggleEl.dispatchEvent(event);
  2027. },
  2028. notifyAction: function notifyAction(index) {
  2029. _this3.emit(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].ACTION_EVENT, index, /** shouldBubble */true);
  2030. },
  2031. isFocusInsideList: function isFocusInsideList() {
  2032. return _this3.root_.contains(document.activeElement);
  2033. }
  2034. }));
  2035. }
  2036. }, {
  2037. key: 'vertical',
  2038. set: function set(value) {
  2039. this.foundation_.setVerticalOrientation(value);
  2040. }
  2041. /** @return Array<!Element>*/
  2042. }, {
  2043. key: 'listElements',
  2044. get: function get() {
  2045. return [].slice.call(this.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].ENABLED_ITEMS_SELECTOR));
  2046. }
  2047. /** @param {boolean} value */
  2048. }, {
  2049. key: 'wrapFocus',
  2050. set: function set(value) {
  2051. this.foundation_.setWrapFocus(value);
  2052. }
  2053. /** @param {boolean} isSingleSelectionList */
  2054. }, {
  2055. key: 'singleSelection',
  2056. set: function set(isSingleSelectionList) {
  2057. this.foundation_.setSingleSelection(isSingleSelectionList);
  2058. }
  2059. /** @return {!Index} */
  2060. }, {
  2061. key: 'selectedIndex',
  2062. get: function get() {
  2063. return this.foundation_.getSelectedIndex();
  2064. }
  2065. /** @param {!Index} index */
  2066. ,
  2067. set: function set(index) {
  2068. this.foundation_.setSelectedIndex(index);
  2069. }
  2070. }], [{
  2071. key: 'attachTo',
  2072. value: function attachTo(root) {
  2073. return new MDCList(root);
  2074. }
  2075. }]);
  2076. return MDCList;
  2077. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  2078. /***/ }),
  2079. /* 15 */
  2080. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2081. "use strict";
  2082. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  2083. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(38);
  2084. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(39);
  2085. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  2086. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  2087. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2088. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  2089. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  2090. /**
  2091. * @license
  2092. * Copyright 2018 Google Inc.
  2093. *
  2094. * Permission is hereby granted, free of charge, to any person obtaining a copy
  2095. * of this software and associated documentation files (the "Software"), to deal
  2096. * in the Software without restriction, including without limitation the rights
  2097. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  2098. * copies of the Software, and to permit persons to whom the Software is
  2099. * furnished to do so, subject to the following conditions:
  2100. *
  2101. * The above copyright notice and this permission notice shall be included in
  2102. * all copies or substantial portions of the Software.
  2103. *
  2104. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  2105. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  2106. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  2107. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  2108. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  2109. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  2110. * THE SOFTWARE.
  2111. */
  2112. // eslint-disable-line no-unused-vars
  2113. var ELEMENTS_KEY_ALLOWED_IN = ['input', 'button', 'textarea', 'select'];
  2114. var MDCListFoundation = function (_MDCFoundation) {
  2115. _inherits(MDCListFoundation, _MDCFoundation);
  2116. _createClass(MDCListFoundation, null, [{
  2117. key: 'strings',
  2118. /** @return enum {string} */
  2119. get: function get() {
  2120. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  2121. }
  2122. /** @return enum {string} */
  2123. }, {
  2124. key: 'cssClasses',
  2125. get: function get() {
  2126. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  2127. }
  2128. /**
  2129. * {@see MDCListAdapter} for typing information on parameters and return
  2130. * types.
  2131. * @return {!MDCListAdapter}
  2132. */
  2133. }, {
  2134. key: 'defaultAdapter',
  2135. get: function get() {
  2136. return (/** @type {!MDCListAdapter} */{
  2137. getListItemCount: function getListItemCount() {},
  2138. getFocusedElementIndex: function getFocusedElementIndex() {},
  2139. setAttributeForElementIndex: function setAttributeForElementIndex() {},
  2140. removeAttributeForElementIndex: function removeAttributeForElementIndex() {},
  2141. addClassForElementIndex: function addClassForElementIndex() {},
  2142. removeClassForElementIndex: function removeClassForElementIndex() {},
  2143. focusItemAtIndex: function focusItemAtIndex() {},
  2144. setTabIndexForListItemChildren: function setTabIndexForListItemChildren() {},
  2145. hasRadioAtIndex: function hasRadioAtIndex() {},
  2146. hasCheckboxAtIndex: function hasCheckboxAtIndex() {},
  2147. isCheckboxCheckedAtIndex: function isCheckboxCheckedAtIndex() {},
  2148. setCheckedCheckboxOrRadioAtIndex: function setCheckedCheckboxOrRadioAtIndex() {},
  2149. notifyAction: function notifyAction() {},
  2150. isFocusInsideList: function isFocusInsideList() {}
  2151. }
  2152. );
  2153. }
  2154. /**
  2155. * @param {!MDCListAdapter=} adapter
  2156. */
  2157. }]);
  2158. function MDCListFoundation(adapter) {
  2159. _classCallCheck(this, MDCListFoundation);
  2160. /** @private {boolean} */
  2161. var _this = _possibleConstructorReturn(this, (MDCListFoundation.__proto__ || Object.getPrototypeOf(MDCListFoundation)).call(this, _extends(MDCListFoundation.defaultAdapter, adapter)));
  2162. _this.wrapFocus_ = false;
  2163. /** @private {boolean} */
  2164. _this.isVertical_ = true;
  2165. /** @private {boolean} */
  2166. _this.isSingleSelectionList_ = false;
  2167. /** @private {!Index} */
  2168. _this.selectedIndex_ = -1;
  2169. /** @private {number} */
  2170. _this.focusedItemIndex_ = -1;
  2171. /** @private {boolean} */
  2172. _this.useActivatedClass_ = false;
  2173. /** @private {boolean} */
  2174. _this.isCheckboxList_ = false;
  2175. /** @private {boolean} */
  2176. _this.isRadioList_ = false;
  2177. return _this;
  2178. }
  2179. _createClass(MDCListFoundation, [{
  2180. key: 'layout',
  2181. value: function layout() {
  2182. if (this.adapter_.getListItemCount() === 0) return;
  2183. if (this.adapter_.hasCheckboxAtIndex(0)) {
  2184. this.isCheckboxList_ = true;
  2185. } else if (this.adapter_.hasRadioAtIndex(0)) {
  2186. this.isRadioList_ = true;
  2187. }
  2188. }
  2189. /**
  2190. * Sets the private wrapFocus_ variable.
  2191. * @param {boolean} value
  2192. */
  2193. }, {
  2194. key: 'setWrapFocus',
  2195. value: function setWrapFocus(value) {
  2196. this.wrapFocus_ = value;
  2197. }
  2198. /**
  2199. * Sets the isVertical_ private variable.
  2200. * @param {boolean} value
  2201. */
  2202. }, {
  2203. key: 'setVerticalOrientation',
  2204. value: function setVerticalOrientation(value) {
  2205. this.isVertical_ = value;
  2206. }
  2207. /**
  2208. * Sets the isSingleSelectionList_ private variable.
  2209. * @param {boolean} value
  2210. */
  2211. }, {
  2212. key: 'setSingleSelection',
  2213. value: function setSingleSelection(value) {
  2214. this.isSingleSelectionList_ = value;
  2215. }
  2216. /**
  2217. * Sets the useActivatedClass_ private variable.
  2218. * @param {boolean} useActivated
  2219. */
  2220. }, {
  2221. key: 'setUseActivatedClass',
  2222. value: function setUseActivatedClass(useActivated) {
  2223. this.useActivatedClass_ = useActivated;
  2224. }
  2225. /** @return {!Index} */
  2226. }, {
  2227. key: 'getSelectedIndex',
  2228. value: function getSelectedIndex() {
  2229. return this.selectedIndex_;
  2230. }
  2231. /** @param {!Index} index */
  2232. }, {
  2233. key: 'setSelectedIndex',
  2234. value: function setSelectedIndex(index) {
  2235. if (!this.isIndexValid_(index)) return;
  2236. if (this.isCheckboxList_) {
  2237. this.setCheckboxAtIndex_( /** @type {!Array<number>} */index);
  2238. } else if (this.isRadioList_) {
  2239. this.setRadioAtIndex_( /** @type {number} */index);
  2240. } else {
  2241. this.setSingleSelectionAtIndex_( /** @type {number} */index);
  2242. }
  2243. }
  2244. /**
  2245. * Focus in handler for the list items.
  2246. * @param evt
  2247. * @param {number} listItemIndex
  2248. */
  2249. }, {
  2250. key: 'handleFocusIn',
  2251. value: function handleFocusIn(evt, listItemIndex) {
  2252. if (listItemIndex >= 0) {
  2253. this.adapter_.setTabIndexForListItemChildren(listItemIndex, 0);
  2254. }
  2255. }
  2256. /**
  2257. * Focus out handler for the list items.
  2258. * @param {Event} evt
  2259. * @param {number} listItemIndex
  2260. */
  2261. }, {
  2262. key: 'handleFocusOut',
  2263. value: function handleFocusOut(evt, listItemIndex) {
  2264. var _this2 = this;
  2265. if (listItemIndex >= 0) {
  2266. this.adapter_.setTabIndexForListItemChildren(listItemIndex, -1);
  2267. }
  2268. /**
  2269. * Between Focusout & Focusin some browsers do not have focus on any element. Setting a delay to wait till the focus
  2270. * is moved to next element.
  2271. */
  2272. setTimeout(function () {
  2273. if (!_this2.adapter_.isFocusInsideList()) {
  2274. _this2.setTabindexToFirstSelectedItem_();
  2275. }
  2276. }, 0);
  2277. }
  2278. /**
  2279. * Key handler for the list.
  2280. * @param {Event} evt
  2281. * @param {boolean} isRootListItem
  2282. * @param {number} listItemIndex
  2283. */
  2284. }, {
  2285. key: 'handleKeydown',
  2286. value: function handleKeydown(evt, isRootListItem, listItemIndex) {
  2287. var arrowLeft = evt.key === 'ArrowLeft' || evt.keyCode === 37;
  2288. var arrowUp = evt.key === 'ArrowUp' || evt.keyCode === 38;
  2289. var arrowRight = evt.key === 'ArrowRight' || evt.keyCode === 39;
  2290. var arrowDown = evt.key === 'ArrowDown' || evt.keyCode === 40;
  2291. var isHome = evt.key === 'Home' || evt.keyCode === 36;
  2292. var isEnd = evt.key === 'End' || evt.keyCode === 35;
  2293. var isEnter = evt.key === 'Enter' || evt.keyCode === 13;
  2294. var isSpace = evt.key === 'Space' || evt.keyCode === 32;
  2295. var currentIndex = this.adapter_.getFocusedElementIndex();
  2296. var nextIndex = -1;
  2297. if (currentIndex === -1) {
  2298. currentIndex = listItemIndex;
  2299. if (currentIndex < 0) {
  2300. // If this event doesn't have a mdc-list-item ancestor from the
  2301. // current list (not from a sublist), return early.
  2302. return;
  2303. }
  2304. }
  2305. if (this.isVertical_ && arrowDown || !this.isVertical_ && arrowRight) {
  2306. this.preventDefaultEvent_(evt);
  2307. nextIndex = this.focusNextElement(currentIndex);
  2308. } else if (this.isVertical_ && arrowUp || !this.isVertical_ && arrowLeft) {
  2309. this.preventDefaultEvent_(evt);
  2310. nextIndex = this.focusPrevElement(currentIndex);
  2311. } else if (isHome) {
  2312. this.preventDefaultEvent_(evt);
  2313. nextIndex = this.focusFirstElement();
  2314. } else if (isEnd) {
  2315. this.preventDefaultEvent_(evt);
  2316. nextIndex = this.focusLastElement();
  2317. } else if (isEnter || isSpace) {
  2318. if (isRootListItem) {
  2319. // Return early if enter key is pressed on anchor element which triggers synthetic MouseEvent event.
  2320. if (evt.target.tagName === 'A' && isEnter) return;
  2321. this.preventDefaultEvent_(evt);
  2322. if (this.isSelectableList_()) {
  2323. this.setSelectedIndexOnAction_(currentIndex);
  2324. }
  2325. this.adapter_.notifyAction(currentIndex);
  2326. }
  2327. }
  2328. this.focusedItemIndex_ = currentIndex;
  2329. if (nextIndex >= 0) {
  2330. this.setTabindexAtIndex_(nextIndex);
  2331. this.focusedItemIndex_ = nextIndex;
  2332. }
  2333. }
  2334. /**
  2335. * Click handler for the list.
  2336. * @param {number} index
  2337. * @param {boolean} toggleCheckbox
  2338. */
  2339. }, {
  2340. key: 'handleClick',
  2341. value: function handleClick(index, toggleCheckbox) {
  2342. if (index === -1) return;
  2343. if (this.isSelectableList_()) {
  2344. this.setSelectedIndexOnAction_(index, toggleCheckbox);
  2345. }
  2346. this.adapter_.notifyAction(index);
  2347. this.setTabindexAtIndex_(index);
  2348. this.focusedItemIndex_ = index;
  2349. }
  2350. /**
  2351. * Ensures that preventDefault is only called if the containing element doesn't
  2352. * consume the event, and it will cause an unintended scroll.
  2353. * @param {Event} evt
  2354. * @private
  2355. */
  2356. }, {
  2357. key: 'preventDefaultEvent_',
  2358. value: function preventDefaultEvent_(evt) {
  2359. var tagName = ('' + evt.target.tagName).toLowerCase();
  2360. if (ELEMENTS_KEY_ALLOWED_IN.indexOf(tagName) === -1) {
  2361. evt.preventDefault();
  2362. }
  2363. }
  2364. /**
  2365. * Focuses the next element on the list.
  2366. * @param {number} index
  2367. * @return {number}
  2368. */
  2369. }, {
  2370. key: 'focusNextElement',
  2371. value: function focusNextElement(index) {
  2372. var count = this.adapter_.getListItemCount();
  2373. var nextIndex = index + 1;
  2374. if (nextIndex >= count) {
  2375. if (this.wrapFocus_) {
  2376. nextIndex = 0;
  2377. } else {
  2378. // Return early because last item is already focused.
  2379. return index;
  2380. }
  2381. }
  2382. this.adapter_.focusItemAtIndex(nextIndex);
  2383. return nextIndex;
  2384. }
  2385. /**
  2386. * Focuses the previous element on the list.
  2387. * @param {number} index
  2388. * @return {number}
  2389. */
  2390. }, {
  2391. key: 'focusPrevElement',
  2392. value: function focusPrevElement(index) {
  2393. var prevIndex = index - 1;
  2394. if (prevIndex < 0) {
  2395. if (this.wrapFocus_) {
  2396. prevIndex = this.adapter_.getListItemCount() - 1;
  2397. } else {
  2398. // Return early because first item is already focused.
  2399. return index;
  2400. }
  2401. }
  2402. this.adapter_.focusItemAtIndex(prevIndex);
  2403. return prevIndex;
  2404. }
  2405. /**
  2406. * @return {number}
  2407. */
  2408. }, {
  2409. key: 'focusFirstElement',
  2410. value: function focusFirstElement() {
  2411. this.adapter_.focusItemAtIndex(0);
  2412. return 0;
  2413. }
  2414. /**
  2415. * @return {number}
  2416. */
  2417. }, {
  2418. key: 'focusLastElement',
  2419. value: function focusLastElement() {
  2420. var lastIndex = this.adapter_.getListItemCount() - 1;
  2421. this.adapter_.focusItemAtIndex(lastIndex);
  2422. return lastIndex;
  2423. }
  2424. /**
  2425. * @param {number} index
  2426. * @private
  2427. */
  2428. }, {
  2429. key: 'setSingleSelectionAtIndex_',
  2430. value: function setSingleSelectionAtIndex_(index) {
  2431. var selectedClassName = __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LIST_ITEM_SELECTED_CLASS;
  2432. if (this.useActivatedClass_) {
  2433. selectedClassName = __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LIST_ITEM_ACTIVATED_CLASS;
  2434. }
  2435. if (this.selectedIndex_ >= 0 && this.selectedIndex_ !== index) {
  2436. this.adapter_.removeClassForElementIndex(this.selectedIndex_, selectedClassName);
  2437. this.adapter_.setAttributeForElementIndex(this.selectedIndex_, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_SELECTED, 'false');
  2438. }
  2439. this.adapter_.addClassForElementIndex(index, selectedClassName);
  2440. this.adapter_.setAttributeForElementIndex(index, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_SELECTED, 'true');
  2441. this.selectedIndex_ = index;
  2442. }
  2443. /**
  2444. * Toggles radio at give index. Radio doesn't change the checked state if it is already checked.
  2445. * @param {number} index
  2446. * @private
  2447. */
  2448. }, {
  2449. key: 'setRadioAtIndex_',
  2450. value: function setRadioAtIndex_(index) {
  2451. this.adapter_.setCheckedCheckboxOrRadioAtIndex(index, true);
  2452. if (this.selectedIndex_ >= 0) {
  2453. this.adapter_.setAttributeForElementIndex(this.selectedIndex_, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_CHECKED, 'false');
  2454. }
  2455. this.adapter_.setAttributeForElementIndex(index, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_CHECKED, 'true');
  2456. this.selectedIndex_ = index;
  2457. }
  2458. /**
  2459. * @param {!Array<number>} index
  2460. * @private
  2461. */
  2462. }, {
  2463. key: 'setCheckboxAtIndex_',
  2464. value: function setCheckboxAtIndex_(index) {
  2465. for (var i = 0; i < this.adapter_.getListItemCount(); i++) {
  2466. var isChecked = false;
  2467. if (index.indexOf(i) >= 0) {
  2468. isChecked = true;
  2469. }
  2470. this.adapter_.setCheckedCheckboxOrRadioAtIndex(i, isChecked);
  2471. this.adapter_.setAttributeForElementIndex(i, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_CHECKED, isChecked ? 'true' : 'false');
  2472. }
  2473. this.selectedIndex_ = index;
  2474. }
  2475. /**
  2476. * @param {number} index
  2477. * @private
  2478. */
  2479. }, {
  2480. key: 'setTabindexAtIndex_',
  2481. value: function setTabindexAtIndex_(index) {
  2482. if (this.focusedItemIndex_ === -1 && index !== 0) {
  2483. // If no list item was selected set first list item's tabindex to -1.
  2484. // Generally, tabindex is set to 0 on first list item of list that has no preselected items.
  2485. this.adapter_.setAttributeForElementIndex(0, 'tabindex', -1);
  2486. } else if (this.focusedItemIndex_ >= 0 && this.focusedItemIndex_ !== index) {
  2487. this.adapter_.setAttributeForElementIndex(this.focusedItemIndex_, 'tabindex', -1);
  2488. }
  2489. this.adapter_.setAttributeForElementIndex(index, 'tabindex', 0);
  2490. }
  2491. /**
  2492. * @return {boolean} Return true if it is single selectin list, checkbox list or radio list.
  2493. * @private
  2494. */
  2495. }, {
  2496. key: 'isSelectableList_',
  2497. value: function isSelectableList_() {
  2498. return this.isSingleSelectionList_ || this.isCheckboxList_ || this.isRadioList_;
  2499. }
  2500. /** @private */
  2501. }, {
  2502. key: 'setTabindexToFirstSelectedItem_',
  2503. value: function setTabindexToFirstSelectedItem_() {
  2504. var targetIndex = 0;
  2505. if (this.isSelectableList_()) {
  2506. if (typeof this.selectedIndex_ === 'number' && this.selectedIndex_ !== -1) {
  2507. targetIndex = this.selectedIndex_;
  2508. } else if (this.selectedIndex_ instanceof Array && this.selectedIndex_.length > 0) {
  2509. targetIndex = this.selectedIndex_.reduce(function (currentIndex, minIndex) {
  2510. return Math.min(currentIndex, minIndex);
  2511. });
  2512. }
  2513. }
  2514. this.setTabindexAtIndex_(targetIndex);
  2515. }
  2516. /**
  2517. * @param {!Index} index
  2518. * @return {boolean}
  2519. * @private
  2520. */
  2521. }, {
  2522. key: 'isIndexValid_',
  2523. value: function isIndexValid_(index) {
  2524. var _this3 = this;
  2525. if (index instanceof Array) {
  2526. if (!this.isCheckboxList_) {
  2527. throw new Error('MDCListFoundation: Array of index is only supported for checkbox based list');
  2528. }
  2529. if (index.length === 0) {
  2530. return true;
  2531. } else {
  2532. return index.some(function (i) {
  2533. return _this3.isIndexInRange_(i);
  2534. });
  2535. }
  2536. } else if (typeof index === 'number') {
  2537. if (this.isCheckboxList_) {
  2538. throw new Error('MDCListFoundation: Expected array of index for checkbox based list but got number: ' + index);
  2539. }
  2540. return this.isIndexInRange_(index);
  2541. } else {
  2542. return false;
  2543. }
  2544. }
  2545. /**
  2546. * @param {number} index
  2547. * @return {boolean}
  2548. * @private
  2549. */
  2550. }, {
  2551. key: 'isIndexInRange_',
  2552. value: function isIndexInRange_(index) {
  2553. var listSize = this.adapter_.getListItemCount();
  2554. return index >= 0 && index < listSize;
  2555. }
  2556. /**
  2557. * @param {number} index
  2558. * @param {boolean=} toggleCheckbox
  2559. * @private
  2560. */
  2561. }, {
  2562. key: 'setSelectedIndexOnAction_',
  2563. value: function setSelectedIndexOnAction_(index) {
  2564. var toggleCheckbox = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  2565. if (this.isCheckboxList_) {
  2566. this.toggleCheckboxAtIndex_(index, toggleCheckbox);
  2567. } else {
  2568. this.setSelectedIndex(index);
  2569. }
  2570. }
  2571. /**
  2572. * @param {number} index
  2573. * @param {boolean} toggleCheckbox
  2574. * @private
  2575. */
  2576. }, {
  2577. key: 'toggleCheckboxAtIndex_',
  2578. value: function toggleCheckboxAtIndex_(index, toggleCheckbox) {
  2579. var isChecked = this.adapter_.isCheckboxCheckedAtIndex(index);
  2580. if (toggleCheckbox) {
  2581. isChecked = !isChecked;
  2582. this.adapter_.setCheckedCheckboxOrRadioAtIndex(index, isChecked);
  2583. }
  2584. this.adapter_.setAttributeForElementIndex(index, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_CHECKED, isChecked ? 'true' : 'false');
  2585. // If none of the checkbox items are selected and selectedIndex is not initialized then provide a default value.
  2586. if (this.selectedIndex_ === -1) {
  2587. this.selectedIndex_ = [];
  2588. }
  2589. if (isChecked) {
  2590. this.selectedIndex_.push(index);
  2591. } else {
  2592. this.selectedIndex_ = this.selectedIndex_.filter(function (i) {
  2593. return i !== index;
  2594. });
  2595. }
  2596. }
  2597. }]);
  2598. return MDCListFoundation;
  2599. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  2600. /* harmony default export */ __webpack_exports__["a"] = (MDCListFoundation);
  2601. /***/ }),
  2602. /* 16 */
  2603. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2604. "use strict";
  2605. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  2606. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCLineRipple", function() { return MDCLineRipple; });
  2607. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  2608. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(42);
  2609. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(111);
  2610. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCLineRippleFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  2611. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  2612. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  2613. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2614. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  2615. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  2616. /**
  2617. * @license
  2618. * Copyright 2018 Google Inc.
  2619. *
  2620. * Permission is hereby granted, free of charge, to any person obtaining a copy
  2621. * of this software and associated documentation files (the "Software"), to deal
  2622. * in the Software without restriction, including without limitation the rights
  2623. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  2624. * copies of the Software, and to permit persons to whom the Software is
  2625. * furnished to do so, subject to the following conditions:
  2626. *
  2627. * The above copyright notice and this permission notice shall be included in
  2628. * all copies or substantial portions of the Software.
  2629. *
  2630. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  2631. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  2632. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  2633. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  2634. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  2635. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  2636. * THE SOFTWARE.
  2637. */
  2638. /**
  2639. * @extends {MDCComponent<!MDCLineRippleFoundation>}
  2640. * @final
  2641. */
  2642. var MDCLineRipple = function (_MDCComponent) {
  2643. _inherits(MDCLineRipple, _MDCComponent);
  2644. function MDCLineRipple() {
  2645. _classCallCheck(this, MDCLineRipple);
  2646. return _possibleConstructorReturn(this, (MDCLineRipple.__proto__ || Object.getPrototypeOf(MDCLineRipple)).apply(this, arguments));
  2647. }
  2648. _createClass(MDCLineRipple, [{
  2649. key: 'activate',
  2650. /**
  2651. * Activates the line ripple
  2652. */
  2653. value: function activate() {
  2654. this.foundation_.activate();
  2655. }
  2656. /**
  2657. * Deactivates the line ripple
  2658. */
  2659. }, {
  2660. key: 'deactivate',
  2661. value: function deactivate() {
  2662. this.foundation_.deactivate();
  2663. }
  2664. /**
  2665. * Sets the transform origin given a user's click location. The `rippleCenter` is the
  2666. * x-coordinate of the middle of the ripple.
  2667. * @param {number} xCoordinate
  2668. */
  2669. }, {
  2670. key: 'setRippleCenter',
  2671. value: function setRippleCenter(xCoordinate) {
  2672. this.foundation_.setRippleCenter(xCoordinate);
  2673. }
  2674. /**
  2675. * @return {!MDCLineRippleFoundation}
  2676. */
  2677. }, {
  2678. key: 'getDefaultFoundation',
  2679. value: function getDefaultFoundation() {
  2680. var _this2 = this;
  2681. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]( /** @type {!MDCLineRippleAdapter} */_extends({
  2682. addClass: function addClass(className) {
  2683. return _this2.root_.classList.add(className);
  2684. },
  2685. removeClass: function removeClass(className) {
  2686. return _this2.root_.classList.remove(className);
  2687. },
  2688. hasClass: function hasClass(className) {
  2689. return _this2.root_.classList.contains(className);
  2690. },
  2691. setStyle: function setStyle(propertyName, value) {
  2692. return _this2.root_.style[propertyName] = value;
  2693. },
  2694. registerEventHandler: function registerEventHandler(evtType, handler) {
  2695. return _this2.root_.addEventListener(evtType, handler);
  2696. },
  2697. deregisterEventHandler: function deregisterEventHandler(evtType, handler) {
  2698. return _this2.root_.removeEventListener(evtType, handler);
  2699. }
  2700. }));
  2701. }
  2702. }], [{
  2703. key: 'attachTo',
  2704. /**
  2705. * @param {!Element} root
  2706. * @return {!MDCLineRipple}
  2707. */
  2708. value: function attachTo(root) {
  2709. return new MDCLineRipple(root);
  2710. }
  2711. }]);
  2712. return MDCLineRipple;
  2713. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  2714. /***/ }),
  2715. /* 17 */
  2716. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2717. "use strict";
  2718. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  2719. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  2720. /**
  2721. * @license
  2722. * Copyright 2018 Google Inc.
  2723. *
  2724. * Permission is hereby granted, free of charge, to any person obtaining a copy
  2725. * of this software and associated documentation files (the "Software"), to deal
  2726. * in the Software without restriction, including without limitation the rights
  2727. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  2728. * copies of the Software, and to permit persons to whom the Software is
  2729. * furnished to do so, subject to the following conditions:
  2730. *
  2731. * The above copyright notice and this permission notice shall be included in
  2732. * all copies or substantial portions of the Software.
  2733. *
  2734. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  2735. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  2736. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  2737. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  2738. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  2739. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  2740. * THE SOFTWARE.
  2741. */
  2742. /** @enum {string} */
  2743. var cssClasses = {
  2744. ROOT: 'mdc-menu',
  2745. MENU_SELECTED_LIST_ITEM: 'mdc-menu-item--selected',
  2746. MENU_SELECTION_GROUP: 'mdc-menu__selection-group'
  2747. };
  2748. /** @enum {string} */
  2749. var strings = {
  2750. SELECTED_EVENT: 'MDCMenu:selected',
  2751. ARIA_SELECTED_ATTR: 'aria-selected',
  2752. LIST_SELECTOR: '.mdc-list',
  2753. CHECKBOX_SELECTOR: 'input[type="checkbox"]'
  2754. };
  2755. /***/ }),
  2756. /* 18 */
  2757. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2758. "use strict";
  2759. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return MDCMenuSurfaceFoundation; });
  2760. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AnchorMargin; });
  2761. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  2762. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(44);
  2763. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(19);
  2764. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  2765. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  2766. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  2767. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2768. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  2769. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  2770. /**
  2771. * @license
  2772. * Copyright 2018 Google Inc.
  2773. *
  2774. * Permission is hereby granted, free of charge, to any person obtaining a copy
  2775. * of this software and associated documentation files (the "Software"), to deal
  2776. * in the Software without restriction, including without limitation the rights
  2777. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  2778. * copies of the Software, and to permit persons to whom the Software is
  2779. * furnished to do so, subject to the following conditions:
  2780. *
  2781. * The above copyright notice and this permission notice shall be included in
  2782. * all copies or substantial portions of the Software.
  2783. *
  2784. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  2785. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  2786. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  2787. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  2788. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  2789. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  2790. * THE SOFTWARE.
  2791. */
  2792. /**
  2793. * @typedef {{
  2794. * top: number,
  2795. * right: number,
  2796. * bottom: number,
  2797. * left: number
  2798. * }}
  2799. */
  2800. var AnchorMargin = void 0;
  2801. /* eslint-disable no-unused-vars */
  2802. /**
  2803. * @typedef {{
  2804. * viewport: { width: number, height: number },
  2805. * viewportDistance: {top: number, right: number, bottom: number, left: number},
  2806. * anchorHeight: number,
  2807. * anchorWidth: number,
  2808. * surfaceHeight: number,
  2809. * surfaceWidth: number,
  2810. * bodyDimensions,
  2811. * windowScroll,
  2812. * }}
  2813. */
  2814. var AutoLayoutMeasurements = void 0;
  2815. /* eslint-enable no-unused-vars */
  2816. /**
  2817. * @extends {MDCFoundation<!MDCMenuSurfaceAdapter>}
  2818. */
  2819. var MDCMenuSurfaceFoundation = function (_MDCFoundation) {
  2820. _inherits(MDCMenuSurfaceFoundation, _MDCFoundation);
  2821. _createClass(MDCMenuSurfaceFoundation, null, [{
  2822. key: 'cssClasses',
  2823. /** @return enum{cssClasses} */
  2824. get: function get() {
  2825. return __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* cssClasses */];
  2826. }
  2827. /** @return enum{string} */
  2828. }, {
  2829. key: 'strings',
  2830. get: function get() {
  2831. return __WEBPACK_IMPORTED_MODULE_2__constants__["e" /* strings */];
  2832. }
  2833. /** @return enum {number} */
  2834. }, {
  2835. key: 'numbers',
  2836. get: function get() {
  2837. return __WEBPACK_IMPORTED_MODULE_2__constants__["d" /* numbers */];
  2838. }
  2839. /** @return enum{number} */
  2840. }, {
  2841. key: 'Corner',
  2842. get: function get() {
  2843. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* Corner */];
  2844. }
  2845. /**
  2846. * {@see MDCMenuSurfaceAdapter} for typing information on parameters and return
  2847. * types.
  2848. * @return {!MDCMenuSurfaceAdapter}
  2849. */
  2850. }, {
  2851. key: 'defaultAdapter',
  2852. get: function get() {
  2853. return (/** @type {!MDCMenuSurfaceAdapter} */{
  2854. addClass: function addClass() {},
  2855. removeClass: function removeClass() {},
  2856. hasClass: function hasClass() {
  2857. return false;
  2858. },
  2859. hasAnchor: function hasAnchor() {
  2860. return false;
  2861. },
  2862. notifyClose: function notifyClose() {},
  2863. notifyOpen: function notifyOpen() {},
  2864. isElementInContainer: function isElementInContainer() {
  2865. return false;
  2866. },
  2867. isRtl: function isRtl() {
  2868. return false;
  2869. },
  2870. setTransformOrigin: function setTransformOrigin() {},
  2871. isFocused: function isFocused() {
  2872. return false;
  2873. },
  2874. saveFocus: function saveFocus() {},
  2875. restoreFocus: function restoreFocus() {},
  2876. isFirstElementFocused: function isFirstElementFocused() {},
  2877. isLastElementFocused: function isLastElementFocused() {},
  2878. focusFirstElement: function focusFirstElement() {},
  2879. focusLastElement: function focusLastElement() {},
  2880. getInnerDimensions: function getInnerDimensions() {
  2881. return {};
  2882. },
  2883. getAnchorDimensions: function getAnchorDimensions() {
  2884. return {};
  2885. },
  2886. getWindowDimensions: function getWindowDimensions() {
  2887. return {};
  2888. },
  2889. getBodyDimensions: function getBodyDimensions() {
  2890. return {};
  2891. },
  2892. getWindowScroll: function getWindowScroll() {
  2893. return {};
  2894. },
  2895. setPosition: function setPosition() {},
  2896. setMaxHeight: function setMaxHeight() {}
  2897. }
  2898. );
  2899. }
  2900. /** @param {!MDCMenuSurfaceAdapter} adapter */
  2901. }]);
  2902. function MDCMenuSurfaceFoundation(adapter) {
  2903. _classCallCheck(this, MDCMenuSurfaceFoundation);
  2904. /** @private {boolean} */
  2905. var _this = _possibleConstructorReturn(this, (MDCMenuSurfaceFoundation.__proto__ || Object.getPrototypeOf(MDCMenuSurfaceFoundation)).call(this, _extends(MDCMenuSurfaceFoundation.defaultAdapter, adapter)));
  2906. _this.isOpen_ = false;
  2907. /** @private {number} */
  2908. _this.openAnimationEndTimerId_ = 0;
  2909. /** @private {number} */
  2910. _this.closeAnimationEndTimerId_ = 0;
  2911. /** @private {number} */
  2912. _this.animationRequestId_ = 0;
  2913. /** @private {!{ width: number, height: number }} */
  2914. _this.dimensions_;
  2915. /** @private {!Corner} */
  2916. _this.anchorCorner_ = __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* Corner */].TOP_START;
  2917. /** @private {!AnchorMargin} */
  2918. _this.anchorMargin_ = { top: 0, right: 0, bottom: 0, left: 0 };
  2919. /** @private {?AutoLayoutMeasurements} */
  2920. _this.measures_ = null;
  2921. /** @private {boolean} */
  2922. _this.quickOpen_ = false;
  2923. /** @private {boolean} */
  2924. _this.hoistedElement_ = false;
  2925. /** @private {boolean} */
  2926. _this.isFixedPosition_ = false;
  2927. /** @private {!{x: number, y: number}} */
  2928. _this.position_ = { x: 0, y: 0 };
  2929. return _this;
  2930. }
  2931. _createClass(MDCMenuSurfaceFoundation, [{
  2932. key: 'init',
  2933. value: function init() {
  2934. var _MDCMenuSurfaceFounda = MDCMenuSurfaceFoundation.cssClasses,
  2935. ROOT = _MDCMenuSurfaceFounda.ROOT,
  2936. OPEN = _MDCMenuSurfaceFounda.OPEN;
  2937. if (!this.adapter_.hasClass(ROOT)) {
  2938. throw new Error(ROOT + ' class required in root element.');
  2939. }
  2940. if (this.adapter_.hasClass(OPEN)) {
  2941. this.isOpen_ = true;
  2942. }
  2943. }
  2944. }, {
  2945. key: 'destroy',
  2946. value: function destroy() {
  2947. clearTimeout(this.openAnimationEndTimerId_);
  2948. clearTimeout(this.closeAnimationEndTimerId_);
  2949. // Cancel any currently running animations.
  2950. cancelAnimationFrame(this.animationRequestId_);
  2951. }
  2952. /**
  2953. * @param {!Corner} corner Default anchor corner alignment of top-left menu surface corner.
  2954. */
  2955. }, {
  2956. key: 'setAnchorCorner',
  2957. value: function setAnchorCorner(corner) {
  2958. this.anchorCorner_ = corner;
  2959. }
  2960. /**
  2961. * @param {!AnchorMargin} margin set of margin values from anchor.
  2962. */
  2963. }, {
  2964. key: 'setAnchorMargin',
  2965. value: function setAnchorMargin(margin) {
  2966. this.anchorMargin_.top = typeof margin.top === 'number' ? margin.top : 0;
  2967. this.anchorMargin_.right = typeof margin.right === 'number' ? margin.right : 0;
  2968. this.anchorMargin_.bottom = typeof margin.bottom === 'number' ? margin.bottom : 0;
  2969. this.anchorMargin_.left = typeof margin.left === 'number' ? margin.left : 0;
  2970. }
  2971. /**
  2972. * Used to indicate if the menu-surface is hoisted to the body.
  2973. * @param {boolean} isHoisted
  2974. */
  2975. }, {
  2976. key: 'setIsHoisted',
  2977. value: function setIsHoisted(isHoisted) {
  2978. this.hoistedElement_ = isHoisted;
  2979. }
  2980. /**
  2981. * Used to set the menu-surface calculations based on a fixed position menu.
  2982. * @param {boolean} isFixedPosition
  2983. */
  2984. }, {
  2985. key: 'setFixedPosition',
  2986. value: function setFixedPosition(isFixedPosition) {
  2987. this.isFixedPosition_ = isFixedPosition;
  2988. }
  2989. /**
  2990. * Sets the menu-surface position on the page.
  2991. * @param {number} x
  2992. * @param {number} y
  2993. */
  2994. }, {
  2995. key: 'setAbsolutePosition',
  2996. value: function setAbsolutePosition(x, y) {
  2997. this.position_.x = this.typeCheckisFinite_(x) ? x : 0;
  2998. this.position_.y = this.typeCheckisFinite_(y) ? y : 0;
  2999. }
  3000. /** @param {boolean} quickOpen */
  3001. }, {
  3002. key: 'setQuickOpen',
  3003. value: function setQuickOpen(quickOpen) {
  3004. this.quickOpen_ = quickOpen;
  3005. }
  3006. /**
  3007. * Handle clicks and close if not within menu-surface element.
  3008. * @param {!Event} evt
  3009. */
  3010. }, {
  3011. key: 'handleBodyClick',
  3012. value: function handleBodyClick(evt) {
  3013. var el = evt.target;
  3014. if (this.adapter_.isElementInContainer(el)) {
  3015. return;
  3016. }
  3017. this.close();
  3018. }
  3019. }, {
  3020. key: 'handleKeydown',
  3021. /**
  3022. * Handle keys that close the surface.
  3023. * @param {!Event} evt
  3024. */
  3025. value: function handleKeydown(evt) {
  3026. var keyCode = evt.keyCode,
  3027. key = evt.key,
  3028. shiftKey = evt.shiftKey;
  3029. var isEscape = key === 'Escape' || keyCode === 27;
  3030. var isTab = key === 'Tab' || keyCode === 9;
  3031. if (isEscape) {
  3032. this.close();
  3033. } else if (isTab) {
  3034. if (this.adapter_.isLastElementFocused() && !shiftKey) {
  3035. this.adapter_.focusFirstElement();
  3036. evt.preventDefault();
  3037. } else if (this.adapter_.isFirstElementFocused() && shiftKey) {
  3038. this.adapter_.focusLastElement();
  3039. evt.preventDefault();
  3040. }
  3041. }
  3042. }
  3043. /**
  3044. * @return {!AutoLayoutMeasurements} Measurements used to position menu surface popup.
  3045. */
  3046. }, {
  3047. key: 'getAutoLayoutMeasurements_',
  3048. value: function getAutoLayoutMeasurements_() {
  3049. var anchorRect = this.adapter_.getAnchorDimensions();
  3050. var viewport = this.adapter_.getWindowDimensions();
  3051. var bodyDimensions = this.adapter_.getBodyDimensions();
  3052. var windowScroll = this.adapter_.getWindowScroll();
  3053. if (!anchorRect) {
  3054. anchorRect = /** @type {ClientRect} */{
  3055. x: this.position_.x,
  3056. y: this.position_.y,
  3057. top: this.position_.y,
  3058. bottom: this.position_.y,
  3059. left: this.position_.x,
  3060. right: this.position_.x,
  3061. height: 0,
  3062. width: 0
  3063. };
  3064. }
  3065. return {
  3066. viewport: viewport,
  3067. bodyDimensions: bodyDimensions,
  3068. windowScroll: windowScroll,
  3069. viewportDistance: {
  3070. top: anchorRect.top,
  3071. right: viewport.width - anchorRect.right,
  3072. left: anchorRect.left,
  3073. bottom: viewport.height - anchorRect.bottom
  3074. },
  3075. anchorHeight: anchorRect.height,
  3076. anchorWidth: anchorRect.width,
  3077. surfaceHeight: this.dimensions_.height,
  3078. surfaceWidth: this.dimensions_.width
  3079. };
  3080. }
  3081. /**
  3082. * Computes the corner of the anchor from which to animate and position the menu surface.
  3083. * @return {!Corner}
  3084. * @private
  3085. */
  3086. }, {
  3087. key: 'getOriginCorner_',
  3088. value: function getOriginCorner_() {
  3089. // Defaults: open from the top left.
  3090. var corner = __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* Corner */].TOP_LEFT;
  3091. var _measures_ = this.measures_,
  3092. viewportDistance = _measures_.viewportDistance,
  3093. anchorHeight = _measures_.anchorHeight,
  3094. anchorWidth = _measures_.anchorWidth,
  3095. surfaceHeight = _measures_.surfaceHeight,
  3096. surfaceWidth = _measures_.surfaceWidth;
  3097. var isBottomAligned = Boolean(this.anchorCorner_ & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].BOTTOM);
  3098. var availableTop = isBottomAligned ? viewportDistance.top + anchorHeight + this.anchorMargin_.bottom : viewportDistance.top + this.anchorMargin_.top;
  3099. var availableBottom = isBottomAligned ? viewportDistance.bottom - this.anchorMargin_.bottom : viewportDistance.bottom + anchorHeight - this.anchorMargin_.top;
  3100. var topOverflow = surfaceHeight - availableTop;
  3101. var bottomOverflow = surfaceHeight - availableBottom;
  3102. if (bottomOverflow > 0 && topOverflow < bottomOverflow) {
  3103. corner |= __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].BOTTOM;
  3104. }
  3105. var isRtl = this.adapter_.isRtl();
  3106. var isFlipRtl = Boolean(this.anchorCorner_ & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].FLIP_RTL);
  3107. var avoidHorizontalOverlap = Boolean(this.anchorCorner_ & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].RIGHT);
  3108. var isAlignedRight = avoidHorizontalOverlap && !isRtl || !avoidHorizontalOverlap && isFlipRtl && isRtl;
  3109. var availableLeft = isAlignedRight ? viewportDistance.left + anchorWidth + this.anchorMargin_.right : viewportDistance.left + this.anchorMargin_.left;
  3110. var availableRight = isAlignedRight ? viewportDistance.right - this.anchorMargin_.right : viewportDistance.right + anchorWidth - this.anchorMargin_.left;
  3111. var leftOverflow = surfaceWidth - availableLeft;
  3112. var rightOverflow = surfaceWidth - availableRight;
  3113. if (leftOverflow < 0 && isAlignedRight && isRtl || avoidHorizontalOverlap && !isAlignedRight && leftOverflow < 0 || rightOverflow > 0 && leftOverflow < rightOverflow) {
  3114. corner |= __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].RIGHT;
  3115. }
  3116. return (/** @type {Corner} */corner
  3117. );
  3118. }
  3119. /**
  3120. * @param {!Corner} corner Origin corner of the menu surface.
  3121. * @return {number} Horizontal offset of menu surface origin corner from corresponding anchor corner.
  3122. * @private
  3123. */
  3124. }, {
  3125. key: 'getHorizontalOriginOffset_',
  3126. value: function getHorizontalOriginOffset_(corner) {
  3127. var anchorWidth = this.measures_.anchorWidth;
  3128. // isRightAligned corresponds to using the 'right' property on the surface.
  3129. var isRightAligned = Boolean(corner & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].RIGHT);
  3130. var avoidHorizontalOverlap = Boolean(this.anchorCorner_ & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].RIGHT);
  3131. if (isRightAligned) {
  3132. var rightOffset = avoidHorizontalOverlap ? anchorWidth - this.anchorMargin_.left : this.anchorMargin_.right;
  3133. // For hoisted or fixed elements, adjust the offset by the difference between viewport width and body width so
  3134. // when we calculate the right value (`adjustPositionForHoistedElement_`) based on the element position,
  3135. // the right property is correct.
  3136. if (this.hoistedElement_ || this.isFixedPosition_) {
  3137. return rightOffset - (this.measures_.viewport.width - this.measures_.bodyDimensions.width);
  3138. }
  3139. return rightOffset;
  3140. }
  3141. return avoidHorizontalOverlap ? anchorWidth - this.anchorMargin_.right : this.anchorMargin_.left;
  3142. }
  3143. /**
  3144. * @param {!Corner} corner Origin corner of the menu surface.
  3145. * @return {number} Vertical offset of menu surface origin corner from corresponding anchor corner.
  3146. * @private
  3147. */
  3148. }, {
  3149. key: 'getVerticalOriginOffset_',
  3150. value: function getVerticalOriginOffset_(corner) {
  3151. var anchorHeight = this.measures_.anchorHeight;
  3152. var isBottomAligned = Boolean(corner & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].BOTTOM);
  3153. var avoidVerticalOverlap = Boolean(this.anchorCorner_ & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].BOTTOM);
  3154. var y = 0;
  3155. if (isBottomAligned) {
  3156. y = avoidVerticalOverlap ? anchorHeight - this.anchorMargin_.top : -this.anchorMargin_.bottom;
  3157. } else {
  3158. y = avoidVerticalOverlap ? anchorHeight + this.anchorMargin_.bottom : this.anchorMargin_.top;
  3159. }
  3160. return y;
  3161. }
  3162. /**
  3163. * @param {!Corner} corner Origin corner of the menu surface.
  3164. * @return {number} Maximum height of the menu surface, based on available space. 0 indicates should not be set.
  3165. * @private
  3166. */
  3167. }, {
  3168. key: 'getMenuSurfaceMaxHeight_',
  3169. value: function getMenuSurfaceMaxHeight_(corner) {
  3170. var maxHeight = 0;
  3171. var viewportDistance = this.measures_.viewportDistance;
  3172. var isBottomAligned = Boolean(corner & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].BOTTOM);
  3173. var MARGIN_TO_EDGE = MDCMenuSurfaceFoundation.numbers.MARGIN_TO_EDGE;
  3174. // When maximum height is not specified, it is handled from css.
  3175. if (isBottomAligned) {
  3176. maxHeight = viewportDistance.top + this.anchorMargin_.top - MARGIN_TO_EDGE;
  3177. if (!(this.anchorCorner_ & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].BOTTOM)) {
  3178. maxHeight += this.measures_.anchorHeight;
  3179. }
  3180. } else {
  3181. maxHeight = viewportDistance.bottom - this.anchorMargin_.bottom + this.measures_.anchorHeight - MARGIN_TO_EDGE;
  3182. if (this.anchorCorner_ & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].BOTTOM) {
  3183. maxHeight -= this.measures_.anchorHeight;
  3184. }
  3185. }
  3186. return maxHeight;
  3187. }
  3188. /** @private */
  3189. }, {
  3190. key: 'autoPosition_',
  3191. value: function autoPosition_() {
  3192. var _position;
  3193. // Compute measurements for autoposition methods reuse.
  3194. this.measures_ = this.getAutoLayoutMeasurements_();
  3195. var corner = this.getOriginCorner_();
  3196. var maxMenuSurfaceHeight = this.getMenuSurfaceMaxHeight_(corner);
  3197. var verticalAlignment = corner & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].BOTTOM ? 'bottom' : 'top';
  3198. var horizontalAlignment = corner & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].RIGHT ? 'right' : 'left';
  3199. var horizontalOffset = this.getHorizontalOriginOffset_(corner);
  3200. var verticalOffset = this.getVerticalOriginOffset_(corner);
  3201. var position = (_position = {}, _defineProperty(_position, horizontalAlignment, horizontalOffset ? horizontalOffset : '0'), _defineProperty(_position, verticalAlignment, verticalOffset ? verticalOffset : '0'), _position);
  3202. var _measures_2 = this.measures_,
  3203. anchorWidth = _measures_2.anchorWidth,
  3204. surfaceWidth = _measures_2.surfaceWidth;
  3205. // Center align when anchor width is comparable or greater than menu surface, otherwise keep corner.
  3206. if (anchorWidth / surfaceWidth > __WEBPACK_IMPORTED_MODULE_2__constants__["d" /* numbers */].ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO) {
  3207. horizontalAlignment = 'center';
  3208. }
  3209. // If the menu-surface has been hoisted to the body, it's no longer relative to the anchor element
  3210. if (this.hoistedElement_ || this.isFixedPosition_) {
  3211. position = this.adjustPositionForHoistedElement_(position);
  3212. }
  3213. for (var prop in position) {
  3214. if (position.hasOwnProperty(prop) && position[prop] !== '0') {
  3215. position[prop] = parseInt(position[prop], 10) + 'px';
  3216. }
  3217. }
  3218. this.adapter_.setTransformOrigin(horizontalAlignment + ' ' + verticalAlignment);
  3219. this.adapter_.setPosition(position);
  3220. this.adapter_.setMaxHeight(maxMenuSurfaceHeight ? maxMenuSurfaceHeight + 'px' : '');
  3221. // Clear measures after positioning is complete.
  3222. this.measures_ = null;
  3223. }
  3224. /**
  3225. * Calculates the offsets for positioning the menu-surface when the menu-surface has been
  3226. * hoisted to the body.
  3227. * @param {!{
  3228. * top: (string|undefined),
  3229. * right: (string|undefined),
  3230. * bottom: (string|undefined),
  3231. * left: (string|undefined)
  3232. * }} position
  3233. * @return {!{
  3234. * top: (string|undefined),
  3235. * right: (string|undefined),
  3236. * bottom: (string|undefined),
  3237. * left: (string|undefined)
  3238. * }} position
  3239. * @private
  3240. */
  3241. }, {
  3242. key: 'adjustPositionForHoistedElement_',
  3243. value: function adjustPositionForHoistedElement_(position) {
  3244. var _measures_3 = this.measures_,
  3245. windowScroll = _measures_3.windowScroll,
  3246. viewportDistance = _measures_3.viewportDistance;
  3247. for (var prop in position) {
  3248. if (position.hasOwnProperty(prop)) {
  3249. // Hoisted surfaces need to have the anchor elements location on the page added to the
  3250. // position properties for proper alignment on the body.
  3251. if (viewportDistance.hasOwnProperty(prop)) {
  3252. position[prop] = parseInt(position[prop], 10) + viewportDistance[prop];
  3253. }
  3254. // Surfaces that are absolutely positioned need to have additional calculations for scroll
  3255. // and bottom positioning.
  3256. if (!this.isFixedPosition_) {
  3257. if (prop === 'top') {
  3258. position[prop] = parseInt(position[prop], 10) + windowScroll.y;
  3259. } else if (prop === 'bottom') {
  3260. position[prop] = parseInt(position[prop], 10) - windowScroll.y;
  3261. } else if (prop === 'left') {
  3262. position[prop] = parseInt(position[prop], 10) + windowScroll.x;
  3263. } else if (prop === 'right') {
  3264. position[prop] = parseInt(position[prop], 10) - windowScroll.x;
  3265. }
  3266. }
  3267. }
  3268. }
  3269. return position;
  3270. }
  3271. /**
  3272. * Open the menu surface.
  3273. */
  3274. }, {
  3275. key: 'open',
  3276. value: function open() {
  3277. var _this2 = this;
  3278. this.adapter_.saveFocus();
  3279. if (!this.quickOpen_) {
  3280. this.adapter_.addClass(MDCMenuSurfaceFoundation.cssClasses.ANIMATING_OPEN);
  3281. }
  3282. this.animationRequestId_ = requestAnimationFrame(function () {
  3283. _this2.adapter_.addClass(MDCMenuSurfaceFoundation.cssClasses.OPEN);
  3284. _this2.dimensions_ = _this2.adapter_.getInnerDimensions();
  3285. _this2.autoPosition_();
  3286. if (_this2.quickOpen_) {
  3287. _this2.adapter_.notifyOpen();
  3288. } else {
  3289. _this2.openAnimationEndTimerId_ = setTimeout(function () {
  3290. _this2.openAnimationEndTimerId_ = 0;
  3291. _this2.adapter_.removeClass(MDCMenuSurfaceFoundation.cssClasses.ANIMATING_OPEN);
  3292. _this2.adapter_.notifyOpen();
  3293. }, __WEBPACK_IMPORTED_MODULE_2__constants__["d" /* numbers */].TRANSITION_OPEN_DURATION);
  3294. }
  3295. });
  3296. this.isOpen_ = true;
  3297. }
  3298. /**
  3299. * Closes the menu surface.
  3300. */
  3301. }, {
  3302. key: 'close',
  3303. value: function close() {
  3304. var _this3 = this;
  3305. if (!this.quickOpen_) {
  3306. this.adapter_.addClass(MDCMenuSurfaceFoundation.cssClasses.ANIMATING_CLOSED);
  3307. }
  3308. requestAnimationFrame(function () {
  3309. _this3.adapter_.removeClass(MDCMenuSurfaceFoundation.cssClasses.OPEN);
  3310. if (_this3.quickOpen_) {
  3311. _this3.adapter_.notifyClose();
  3312. } else {
  3313. _this3.closeAnimationEndTimerId_ = setTimeout(function () {
  3314. _this3.closeAnimationEndTimerId_ = 0;
  3315. _this3.adapter_.removeClass(MDCMenuSurfaceFoundation.cssClasses.ANIMATING_CLOSED);
  3316. _this3.adapter_.notifyClose();
  3317. }, __WEBPACK_IMPORTED_MODULE_2__constants__["d" /* numbers */].TRANSITION_CLOSE_DURATION);
  3318. }
  3319. });
  3320. this.isOpen_ = false;
  3321. this.maybeRestoreFocus_();
  3322. }
  3323. /**
  3324. * The last focused element when the menu surface was opened should regain focus, if the user is
  3325. * focused on or within the menu surface when it is closed.
  3326. * @private
  3327. */
  3328. }, {
  3329. key: 'maybeRestoreFocus_',
  3330. value: function maybeRestoreFocus_() {
  3331. if (this.adapter_.isFocused() || this.adapter_.isElementInContainer(document.activeElement)) {
  3332. this.adapter_.restoreFocus();
  3333. }
  3334. }
  3335. /** @return {boolean} */
  3336. }, {
  3337. key: 'isOpen',
  3338. value: function isOpen() {
  3339. return this.isOpen_;
  3340. }
  3341. /**
  3342. * isFinite that doesn't force conversion to number type.
  3343. * Equivalent to Number.isFinite in ES2015, but is not included in IE11.
  3344. * @param {number} num
  3345. * @return {boolean}
  3346. * @private
  3347. */
  3348. }, {
  3349. key: 'typeCheckisFinite_',
  3350. value: function typeCheckisFinite_(num) {
  3351. return typeof num === 'number' && isFinite(num);
  3352. }
  3353. }]);
  3354. return MDCMenuSurfaceFoundation;
  3355. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  3356. /***/ }),
  3357. /* 19 */
  3358. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3359. "use strict";
  3360. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return cssClasses; });
  3361. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return strings; });
  3362. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return numbers; });
  3363. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return CornerBit; });
  3364. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Corner; });
  3365. /**
  3366. * @license
  3367. * Copyright 2018 Google Inc.
  3368. *
  3369. * Permission is hereby granted, free of charge, to any person obtaining a copy
  3370. * of this software and associated documentation files (the "Software"), to deal
  3371. * in the Software without restriction, including without limitation the rights
  3372. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  3373. * copies of the Software, and to permit persons to whom the Software is
  3374. * furnished to do so, subject to the following conditions:
  3375. *
  3376. * The above copyright notice and this permission notice shall be included in
  3377. * all copies or substantial portions of the Software.
  3378. *
  3379. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  3380. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  3381. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  3382. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  3383. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  3384. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  3385. * THE SOFTWARE.
  3386. */
  3387. /** @enum {string} */
  3388. var cssClasses = {
  3389. ANCHOR: 'mdc-menu-surface--anchor',
  3390. ANIMATING_CLOSED: 'mdc-menu-surface--animating-closed',
  3391. ANIMATING_OPEN: 'mdc-menu-surface--animating-open',
  3392. FIXED: 'mdc-menu-surface--fixed',
  3393. OPEN: 'mdc-menu-surface--open',
  3394. ROOT: 'mdc-menu-surface'
  3395. };
  3396. /** @enum {string} */
  3397. var strings = {
  3398. CLOSED_EVENT: 'MDCMenuSurface:closed',
  3399. OPENED_EVENT: 'MDCMenuSurface:opened',
  3400. 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"])'
  3401. };
  3402. /** @enum {number} */
  3403. var numbers = {
  3404. // Total duration of menu-surface open animation.
  3405. TRANSITION_OPEN_DURATION: 120,
  3406. // Total duration of menu-surface close animation.
  3407. TRANSITION_CLOSE_DURATION: 75,
  3408. // Margin left to the edge of the viewport when menu-surface is at maximum possible height.
  3409. MARGIN_TO_EDGE: 32,
  3410. // Ratio of anchor width to menu-surface width for switching from corner positioning to center positioning.
  3411. ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO: 0.67
  3412. };
  3413. /**
  3414. * Enum for bits in the {@see Corner) bitmap.
  3415. * @enum {number}
  3416. */
  3417. var CornerBit = {
  3418. BOTTOM: 1,
  3419. CENTER: 2,
  3420. RIGHT: 4,
  3421. FLIP_RTL: 8
  3422. };
  3423. /**
  3424. * Enum for representing an element corner for positioning the menu-surface.
  3425. *
  3426. * The START constants map to LEFT if element directionality is left
  3427. * to right and RIGHT if the directionality is right to left.
  3428. * Likewise END maps to RIGHT or LEFT depending on the directionality.
  3429. *
  3430. * @enum {number}
  3431. */
  3432. var Corner = {
  3433. TOP_LEFT: 0,
  3434. TOP_RIGHT: CornerBit.RIGHT,
  3435. BOTTOM_LEFT: CornerBit.BOTTOM,
  3436. BOTTOM_RIGHT: CornerBit.BOTTOM | CornerBit.RIGHT,
  3437. TOP_START: CornerBit.FLIP_RTL,
  3438. TOP_END: CornerBit.FLIP_RTL | CornerBit.RIGHT,
  3439. BOTTOM_START: CornerBit.BOTTOM | CornerBit.FLIP_RTL,
  3440. BOTTOM_END: CornerBit.BOTTOM | CornerBit.RIGHT | CornerBit.FLIP_RTL
  3441. };
  3442. /***/ }),
  3443. /* 20 */
  3444. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3445. "use strict";
  3446. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  3447. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCNotchedOutline", function() { return MDCNotchedOutline; });
  3448. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  3449. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(46);
  3450. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(116);
  3451. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_floating_label_index__ = __webpack_require__(9);
  3452. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__constants__ = __webpack_require__(47);
  3453. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCNotchedOutlineFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  3454. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  3455. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  3456. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3457. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  3458. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  3459. /**
  3460. * @license
  3461. * Copyright 2017 Google Inc.
  3462. *
  3463. * Permission is hereby granted, free of charge, to any person obtaining a copy
  3464. * of this software and associated documentation files (the "Software"), to deal
  3465. * in the Software without restriction, including without limitation the rights
  3466. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  3467. * copies of the Software, and to permit persons to whom the Software is
  3468. * furnished to do so, subject to the following conditions:
  3469. *
  3470. * The above copyright notice and this permission notice shall be included in
  3471. * all copies or substantial portions of the Software.
  3472. *
  3473. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  3474. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  3475. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  3476. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  3477. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  3478. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  3479. * THE SOFTWARE.
  3480. */
  3481. /**
  3482. * @extends {MDCComponent<!MDCNotchedOutlineFoundation>}
  3483. * @final
  3484. */
  3485. var MDCNotchedOutline = function (_MDCComponent) {
  3486. _inherits(MDCNotchedOutline, _MDCComponent);
  3487. _createClass(MDCNotchedOutline, null, [{
  3488. key: 'attachTo',
  3489. /**
  3490. * @param {!Element} root
  3491. * @return {!MDCNotchedOutline}
  3492. */
  3493. value: function attachTo(root) {
  3494. return new MDCNotchedOutline(root);
  3495. }
  3496. /** @param {...?} args */
  3497. }]);
  3498. function MDCNotchedOutline() {
  3499. var _ref;
  3500. _classCallCheck(this, MDCNotchedOutline);
  3501. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  3502. args[_key] = arguments[_key];
  3503. }
  3504. /** @private {Element} */
  3505. var _this = _possibleConstructorReturn(this, (_ref = MDCNotchedOutline.__proto__ || Object.getPrototypeOf(MDCNotchedOutline)).call.apply(_ref, [this].concat(args)));
  3506. _this.notchElement_;
  3507. return _this;
  3508. }
  3509. _createClass(MDCNotchedOutline, [{
  3510. key: 'initialSyncWithDOM',
  3511. value: function initialSyncWithDOM() {
  3512. var label = this.root_.querySelector('.' + __WEBPACK_IMPORTED_MODULE_3__material_floating_label_index__["MDCFloatingLabelFoundation"].cssClasses.ROOT);
  3513. this.notchElement_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_4__constants__["c" /* strings */].NOTCH_ELEMENT_SELECTOR);
  3514. if (label) {
  3515. label.style.transitionDuration = '0s';
  3516. this.root_.classList.add(__WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */].OUTLINE_UPGRADED);
  3517. requestAnimationFrame(function () {
  3518. label.style.transitionDuration = '';
  3519. });
  3520. } else {
  3521. this.root_.classList.add(__WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */].NO_LABEL);
  3522. }
  3523. }
  3524. /**
  3525. * Updates classes and styles to open the notch to the specified width.
  3526. * @param {number} notchWidth The notch width in the outline.
  3527. */
  3528. }, {
  3529. key: 'notch',
  3530. value: function notch(notchWidth) {
  3531. this.foundation_.notch(notchWidth);
  3532. }
  3533. /**
  3534. * Updates classes and styles to close the notch.
  3535. */
  3536. }, {
  3537. key: 'closeNotch',
  3538. value: function closeNotch() {
  3539. this.foundation_.closeNotch();
  3540. }
  3541. /**
  3542. * @return {!MDCNotchedOutlineFoundation}
  3543. */
  3544. }, {
  3545. key: 'getDefaultFoundation',
  3546. value: function getDefaultFoundation() {
  3547. var _this2 = this;
  3548. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */](
  3549. /** @type {!MDCNotchedOutlineAdapter} */_extends({
  3550. addClass: function addClass(className) {
  3551. return _this2.root_.classList.add(className);
  3552. },
  3553. removeClass: function removeClass(className) {
  3554. return _this2.root_.classList.remove(className);
  3555. },
  3556. setNotchWidthProperty: function setNotchWidthProperty(width) {
  3557. return _this2.notchElement_.style.setProperty('width', width + 'px');
  3558. },
  3559. removeNotchWidthProperty: function removeNotchWidthProperty() {
  3560. return _this2.notchElement_.style.removeProperty('width');
  3561. }
  3562. }));
  3563. }
  3564. }]);
  3565. return MDCNotchedOutline;
  3566. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  3567. /***/ }),
  3568. /* 21 */
  3569. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3570. "use strict";
  3571. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCSelectIcon; });
  3572. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  3573. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(49);
  3574. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(123);
  3575. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  3576. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  3577. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  3578. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3579. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  3580. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  3581. /**
  3582. * @license
  3583. * Copyright 2018 Google Inc.
  3584. *
  3585. * Permission is hereby granted, free of charge, to any person obtaining a copy
  3586. * of this software and associated documentation files (the "Software"), to deal
  3587. * in the Software without restriction, including without limitation the rights
  3588. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  3589. * copies of the Software, and to permit persons to whom the Software is
  3590. * furnished to do so, subject to the following conditions:
  3591. *
  3592. * The above copyright notice and this permission notice shall be included in
  3593. * all copies or substantial portions of the Software.
  3594. *
  3595. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  3596. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  3597. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  3598. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  3599. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  3600. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  3601. * THE SOFTWARE.
  3602. */
  3603. /**
  3604. * @extends {MDCComponent<!MDCSelectIconFoundation>}
  3605. * @final
  3606. */
  3607. var MDCSelectIcon = function (_MDCComponent) {
  3608. _inherits(MDCSelectIcon, _MDCComponent);
  3609. function MDCSelectIcon() {
  3610. _classCallCheck(this, MDCSelectIcon);
  3611. return _possibleConstructorReturn(this, (MDCSelectIcon.__proto__ || Object.getPrototypeOf(MDCSelectIcon)).apply(this, arguments));
  3612. }
  3613. _createClass(MDCSelectIcon, [{
  3614. key: 'getDefaultFoundation',
  3615. /**
  3616. * @return {!MDCSelectIconFoundation}
  3617. */
  3618. value: function getDefaultFoundation() {
  3619. var _this2 = this;
  3620. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]( /** @type {!MDCSelectIconAdapter} */_extends({
  3621. getAttr: function getAttr(attr) {
  3622. return _this2.root_.getAttribute(attr);
  3623. },
  3624. setAttr: function setAttr(attr, value) {
  3625. return _this2.root_.setAttribute(attr, value);
  3626. },
  3627. removeAttr: function removeAttr(attr) {
  3628. return _this2.root_.removeAttribute(attr);
  3629. },
  3630. setContent: function setContent(content) {
  3631. _this2.root_.textContent = content;
  3632. },
  3633. registerInteractionHandler: function registerInteractionHandler(evtType, handler) {
  3634. return _this2.root_.addEventListener(evtType, handler);
  3635. },
  3636. deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) {
  3637. return _this2.root_.removeEventListener(evtType, handler);
  3638. },
  3639. notifyIconAction: function notifyIconAction() {
  3640. return _this2.emit(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.ICON_EVENT, {} /* evtData */, true /* shouldBubble */);
  3641. }
  3642. }));
  3643. }
  3644. }, {
  3645. key: 'foundation',
  3646. /**
  3647. * @return {!MDCSelectIconFoundation}
  3648. */
  3649. get: function get() {
  3650. return this.foundation_;
  3651. }
  3652. }], [{
  3653. key: 'attachTo',
  3654. /**
  3655. * @param {!Element} root
  3656. * @return {!MDCSelectIcon}
  3657. */
  3658. value: function attachTo(root) {
  3659. return new MDCSelectIcon(root);
  3660. }
  3661. }]);
  3662. return MDCSelectIcon;
  3663. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  3664. /***/ }),
  3665. /* 22 */
  3666. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3667. "use strict";
  3668. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCSelectHelperText; });
  3669. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  3670. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(50);
  3671. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(125);
  3672. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  3673. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  3674. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  3675. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3676. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  3677. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  3678. /**
  3679. * @license
  3680. * Copyright 2018 Google Inc.
  3681. *
  3682. * Permission is hereby granted, free of charge, to any person obtaining a copy
  3683. * of this software and associated documentation files (the "Software"), to deal
  3684. * in the Software without restriction, including without limitation the rights
  3685. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  3686. * copies of the Software, and to permit persons to whom the Software is
  3687. * furnished to do so, subject to the following conditions:
  3688. *
  3689. * The above copyright notice and this permission notice shall be included in
  3690. * all copies or substantial portions of the Software.
  3691. *
  3692. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  3693. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  3694. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  3695. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  3696. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  3697. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  3698. * THE SOFTWARE.
  3699. */
  3700. /**
  3701. * @extends {MDCComponent<!MDCSelectHelperTextFoundation>}
  3702. * @final
  3703. */
  3704. var MDCSelectHelperText = function (_MDCComponent) {
  3705. _inherits(MDCSelectHelperText, _MDCComponent);
  3706. function MDCSelectHelperText() {
  3707. _classCallCheck(this, MDCSelectHelperText);
  3708. return _possibleConstructorReturn(this, (MDCSelectHelperText.__proto__ || Object.getPrototypeOf(MDCSelectHelperText)).apply(this, arguments));
  3709. }
  3710. _createClass(MDCSelectHelperText, [{
  3711. key: 'getDefaultFoundation',
  3712. /**
  3713. * @return {!MDCSelectHelperTextFoundation}
  3714. */
  3715. value: function getDefaultFoundation() {
  3716. var _this2 = this;
  3717. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]( /** @type {!MDCSelectHelperTextAdapter} */_extends({
  3718. addClass: function addClass(className) {
  3719. return _this2.root_.classList.add(className);
  3720. },
  3721. removeClass: function removeClass(className) {
  3722. return _this2.root_.classList.remove(className);
  3723. },
  3724. hasClass: function hasClass(className) {
  3725. return _this2.root_.classList.contains(className);
  3726. },
  3727. setAttr: function setAttr(attr, value) {
  3728. return _this2.root_.setAttribute(attr, value);
  3729. },
  3730. removeAttr: function removeAttr(attr) {
  3731. return _this2.root_.removeAttribute(attr);
  3732. },
  3733. setContent: function setContent(content) {
  3734. _this2.root_.textContent = content;
  3735. }
  3736. }));
  3737. }
  3738. }, {
  3739. key: 'foundation',
  3740. /**
  3741. * @return {!MDCSelectHelperTextFoundation}
  3742. */
  3743. get: function get() {
  3744. return this.foundation_;
  3745. }
  3746. }], [{
  3747. key: 'attachTo',
  3748. /**
  3749. * @param {!Element} root
  3750. * @return {!MDCSelectHelperText}
  3751. */
  3752. value: function attachTo(root) {
  3753. return new MDCSelectHelperText(root);
  3754. }
  3755. }]);
  3756. return MDCSelectHelperText;
  3757. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  3758. /***/ }),
  3759. /* 23 */
  3760. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3761. "use strict";
  3762. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  3763. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; });
  3764. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; });
  3765. /**
  3766. * @license
  3767. * Copyright 2018 Google Inc.
  3768. *
  3769. * Permission is hereby granted, free of charge, to any person obtaining a copy
  3770. * of this software and associated documentation files (the "Software"), to deal
  3771. * in the Software without restriction, including without limitation the rights
  3772. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  3773. * copies of the Software, and to permit persons to whom the Software is
  3774. * furnished to do so, subject to the following conditions:
  3775. *
  3776. * The above copyright notice and this permission notice shall be included in
  3777. * all copies or substantial portions of the Software.
  3778. *
  3779. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  3780. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  3781. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  3782. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  3783. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  3784. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  3785. * THE SOFTWARE.
  3786. */
  3787. var cssClasses = {
  3788. OPENING: 'mdc-snackbar--opening',
  3789. OPEN: 'mdc-snackbar--open',
  3790. CLOSING: 'mdc-snackbar--closing'
  3791. };
  3792. var strings = {
  3793. SURFACE_SELECTOR: '.mdc-snackbar__surface',
  3794. LABEL_SELECTOR: '.mdc-snackbar__label',
  3795. ACTION_SELECTOR: '.mdc-snackbar__action',
  3796. DISMISS_SELECTOR: '.mdc-snackbar__dismiss',
  3797. OPENING_EVENT: 'MDCSnackbar:opening',
  3798. OPENED_EVENT: 'MDCSnackbar:opened',
  3799. CLOSING_EVENT: 'MDCSnackbar:closing',
  3800. CLOSED_EVENT: 'MDCSnackbar:closed',
  3801. REASON_ACTION: 'action',
  3802. REASON_DISMISS: 'dismiss',
  3803. ARIA_LIVE_LABEL_TEXT_ATTR: 'data-mdc-snackbar-label-text'
  3804. };
  3805. var numbers = {
  3806. MIN_AUTO_DISMISS_TIMEOUT_MS: 4000,
  3807. MAX_AUTO_DISMISS_TIMEOUT_MS: 10000,
  3808. DEFAULT_AUTO_DISMISS_TIMEOUT_MS: 5000,
  3809. // These variables need to be kept in sync with the values in _variables.scss.
  3810. SNACKBAR_ANIMATION_OPEN_TIME_MS: 150,
  3811. SNACKBAR_ANIMATION_CLOSE_TIME_MS: 75,
  3812. /**
  3813. * Number of milliseconds to wait between temporarily clearing the label text
  3814. * in the DOM and subsequently restoring it. This is necessary to force IE 11
  3815. * to pick up the `aria-live` content change and announce it to the user.
  3816. */
  3817. ARIA_LIVE_DELAY_MS: 1000
  3818. };
  3819. /***/ }),
  3820. /* 24 */
  3821. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3822. "use strict";
  3823. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  3824. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(56);
  3825. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(137);
  3826. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  3827. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  3828. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3829. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  3830. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  3831. /**
  3832. * @license
  3833. * Copyright 2018 Google Inc.
  3834. *
  3835. * Permission is hereby granted, free of charge, to any person obtaining a copy
  3836. * of this software and associated documentation files (the "Software"), to deal
  3837. * in the Software without restriction, including without limitation the rights
  3838. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  3839. * copies of the Software, and to permit persons to whom the Software is
  3840. * furnished to do so, subject to the following conditions:
  3841. *
  3842. * The above copyright notice and this permission notice shall be included in
  3843. * all copies or substantial portions of the Software.
  3844. *
  3845. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  3846. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  3847. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  3848. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  3849. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  3850. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  3851. * THE SOFTWARE.
  3852. */
  3853. /**
  3854. * @extends {MDCFoundation<!MDCTabIndicatorAdapter>}
  3855. * @abstract
  3856. */
  3857. var MDCTabIndicatorFoundation = function (_MDCFoundation) {
  3858. _inherits(MDCTabIndicatorFoundation, _MDCFoundation);
  3859. _createClass(MDCTabIndicatorFoundation, null, [{
  3860. key: 'cssClasses',
  3861. /** @return enum {string} */
  3862. get: function get() {
  3863. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  3864. }
  3865. /** @return enum {string} */
  3866. }, {
  3867. key: 'strings',
  3868. get: function get() {
  3869. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  3870. }
  3871. /**
  3872. * @see MDCTabIndicatorAdapter for typing information
  3873. * @return {!MDCTabIndicatorAdapter}
  3874. */
  3875. }, {
  3876. key: 'defaultAdapter',
  3877. get: function get() {
  3878. return (/** @type {!MDCTabIndicatorAdapter} */{
  3879. addClass: function addClass() {},
  3880. removeClass: function removeClass() {},
  3881. computeContentClientRect: function computeContentClientRect() {},
  3882. setContentStyleProperty: function setContentStyleProperty() {}
  3883. }
  3884. );
  3885. }
  3886. /** @param {!MDCTabIndicatorAdapter} adapter */
  3887. }]);
  3888. function MDCTabIndicatorFoundation(adapter) {
  3889. _classCallCheck(this, MDCTabIndicatorFoundation);
  3890. return _possibleConstructorReturn(this, (MDCTabIndicatorFoundation.__proto__ || Object.getPrototypeOf(MDCTabIndicatorFoundation)).call(this, _extends(MDCTabIndicatorFoundation.defaultAdapter, adapter)));
  3891. }
  3892. /** @return {!ClientRect} */
  3893. _createClass(MDCTabIndicatorFoundation, [{
  3894. key: 'computeContentClientRect',
  3895. value: function computeContentClientRect() {
  3896. return this.adapter_.computeContentClientRect();
  3897. }
  3898. /**
  3899. * Activates the indicator
  3900. * @param {!ClientRect=} previousIndicatorClientRect
  3901. * @abstract
  3902. */
  3903. }, {
  3904. key: 'activate',
  3905. value: function activate(previousIndicatorClientRect) {} // eslint-disable-line no-unused-vars
  3906. /** @abstract */
  3907. }, {
  3908. key: 'deactivate',
  3909. value: function deactivate() {}
  3910. }]);
  3911. return MDCTabIndicatorFoundation;
  3912. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  3913. /* harmony default export */ __webpack_exports__["a"] = (MDCTabIndicatorFoundation);
  3914. /***/ }),
  3915. /* 25 */
  3916. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3917. "use strict";
  3918. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  3919. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(62);
  3920. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(151);
  3921. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  3922. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  3923. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3924. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  3925. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  3926. /**
  3927. * @license
  3928. * Copyright 2017 Google Inc.
  3929. *
  3930. * Permission is hereby granted, free of charge, to any person obtaining a copy
  3931. * of this software and associated documentation files (the "Software"), to deal
  3932. * in the Software without restriction, including without limitation the rights
  3933. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  3934. * copies of the Software, and to permit persons to whom the Software is
  3935. * furnished to do so, subject to the following conditions:
  3936. *
  3937. * The above copyright notice and this permission notice shall be included in
  3938. * all copies or substantial portions of the Software.
  3939. *
  3940. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  3941. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  3942. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  3943. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  3944. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  3945. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  3946. * THE SOFTWARE.
  3947. */
  3948. /**
  3949. * @extends {MDCFoundation<!MDCTextFieldHelperTextAdapter>}
  3950. * @final
  3951. */
  3952. var MDCTextFieldHelperTextFoundation = function (_MDCFoundation) {
  3953. _inherits(MDCTextFieldHelperTextFoundation, _MDCFoundation);
  3954. _createClass(MDCTextFieldHelperTextFoundation, null, [{
  3955. key: 'cssClasses',
  3956. /** @return enum {string} */
  3957. get: function get() {
  3958. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  3959. }
  3960. /** @return enum {string} */
  3961. }, {
  3962. key: 'strings',
  3963. get: function get() {
  3964. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  3965. }
  3966. /**
  3967. * {@see MDCTextFieldHelperTextAdapter} for typing information on parameters and return
  3968. * types.
  3969. * @return {!MDCTextFieldHelperTextAdapter}
  3970. */
  3971. }, {
  3972. key: 'defaultAdapter',
  3973. get: function get() {
  3974. return (/** @type {!MDCTextFieldHelperTextAdapter} */{
  3975. addClass: function addClass() {},
  3976. removeClass: function removeClass() {},
  3977. hasClass: function hasClass() {},
  3978. setAttr: function setAttr() {},
  3979. removeAttr: function removeAttr() {},
  3980. setContent: function setContent() {}
  3981. }
  3982. );
  3983. }
  3984. /**
  3985. * @param {!MDCTextFieldHelperTextAdapter} adapter
  3986. */
  3987. }]);
  3988. function MDCTextFieldHelperTextFoundation(adapter) {
  3989. _classCallCheck(this, MDCTextFieldHelperTextFoundation);
  3990. return _possibleConstructorReturn(this, (MDCTextFieldHelperTextFoundation.__proto__ || Object.getPrototypeOf(MDCTextFieldHelperTextFoundation)).call(this, _extends(MDCTextFieldHelperTextFoundation.defaultAdapter, adapter)));
  3991. }
  3992. /**
  3993. * Sets the content of the helper text field.
  3994. * @param {string} content
  3995. */
  3996. _createClass(MDCTextFieldHelperTextFoundation, [{
  3997. key: 'setContent',
  3998. value: function setContent(content) {
  3999. this.adapter_.setContent(content);
  4000. }
  4001. /** @param {boolean} isPersistent Sets the persistency of the helper text. */
  4002. }, {
  4003. key: 'setPersistent',
  4004. value: function setPersistent(isPersistent) {
  4005. if (isPersistent) {
  4006. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_PERSISTENT);
  4007. } else {
  4008. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_PERSISTENT);
  4009. }
  4010. }
  4011. /**
  4012. * @param {boolean} isValidation True to make the helper text act as an
  4013. * error validation message.
  4014. */
  4015. }, {
  4016. key: 'setValidation',
  4017. value: function setValidation(isValidation) {
  4018. if (isValidation) {
  4019. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_VALIDATION_MSG);
  4020. } else {
  4021. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_VALIDATION_MSG);
  4022. }
  4023. }
  4024. /** Makes the helper text visible to the screen reader. */
  4025. }, {
  4026. key: 'showToScreenReader',
  4027. value: function showToScreenReader() {
  4028. this.adapter_.removeAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_HIDDEN);
  4029. }
  4030. /**
  4031. * Sets the validity of the helper text based on the input validity.
  4032. * @param {boolean} inputIsValid
  4033. */
  4034. }, {
  4035. key: 'setValidity',
  4036. value: function setValidity(inputIsValid) {
  4037. var helperTextIsPersistent = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_PERSISTENT);
  4038. var helperTextIsValidationMsg = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_VALIDATION_MSG);
  4039. var validationMsgNeedsDisplay = helperTextIsValidationMsg && !inputIsValid;
  4040. if (validationMsgNeedsDisplay) {
  4041. this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ROLE, 'alert');
  4042. } else {
  4043. this.adapter_.removeAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ROLE);
  4044. }
  4045. if (!helperTextIsPersistent && !validationMsgNeedsDisplay) {
  4046. this.hide_();
  4047. }
  4048. }
  4049. /**
  4050. * Hides the help text from screen readers.
  4051. * @private
  4052. */
  4053. }, {
  4054. key: 'hide_',
  4055. value: function hide_() {
  4056. this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_HIDDEN, 'true');
  4057. }
  4058. }]);
  4059. return MDCTextFieldHelperTextFoundation;
  4060. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  4061. /* harmony default export */ __webpack_exports__["a"] = (MDCTextFieldHelperTextFoundation);
  4062. /***/ }),
  4063. /* 26 */
  4064. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4065. "use strict";
  4066. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  4067. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(63);
  4068. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(152);
  4069. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  4070. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  4071. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4072. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  4073. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  4074. /**
  4075. * @license
  4076. * Copyright 2019 Google Inc.
  4077. *
  4078. * Permission is hereby granted, free of charge, to any person obtaining a copy
  4079. * of this software and associated documentation files (the "Software"), to deal
  4080. * in the Software without restriction, including without limitation the rights
  4081. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  4082. * copies of the Software, and to permit persons to whom the Software is
  4083. * furnished to do so, subject to the following conditions:
  4084. *
  4085. * The above copyright notice and this permission notice shall be included in
  4086. * all copies or substantial portions of the Software.
  4087. *
  4088. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  4089. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  4090. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  4091. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  4092. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  4093. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  4094. * THE SOFTWARE.
  4095. */
  4096. /**
  4097. * @extends {MDCFoundation<!MDCTextFieldCharacterCounterAdapter>}
  4098. * @final
  4099. */
  4100. var MDCTextFieldCharacterCounterFoundation = function (_MDCFoundation) {
  4101. _inherits(MDCTextFieldCharacterCounterFoundation, _MDCFoundation);
  4102. _createClass(MDCTextFieldCharacterCounterFoundation, null, [{
  4103. key: 'cssClasses',
  4104. /** @return enum {string} */
  4105. get: function get() {
  4106. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  4107. }
  4108. /** @return enum {string} */
  4109. }, {
  4110. key: 'strings',
  4111. get: function get() {
  4112. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  4113. }
  4114. /**
  4115. * {@see MDCTextFieldCharacterCounterAdapter} for typing information on parameters and return
  4116. * types.
  4117. * @return {!MDCTextFieldCharacterCounterAdapter}
  4118. */
  4119. }, {
  4120. key: 'defaultAdapter',
  4121. get: function get() {
  4122. return (/** @type {!MDCTextFieldCharacterCounterAdapter} */{
  4123. setContent: function setContent() {}
  4124. }
  4125. );
  4126. }
  4127. /**
  4128. * @param {!MDCTextFieldCharacterCounterAdapter} adapter
  4129. */
  4130. }]);
  4131. function MDCTextFieldCharacterCounterFoundation(adapter) {
  4132. _classCallCheck(this, MDCTextFieldCharacterCounterFoundation);
  4133. return _possibleConstructorReturn(this, (MDCTextFieldCharacterCounterFoundation.__proto__ || Object.getPrototypeOf(MDCTextFieldCharacterCounterFoundation)).call(this, _extends(MDCTextFieldCharacterCounterFoundation.defaultAdapter, adapter)));
  4134. }
  4135. /**
  4136. * @param {number} currentLength
  4137. * @param {number} maxLength
  4138. */
  4139. _createClass(MDCTextFieldCharacterCounterFoundation, [{
  4140. key: 'setCounterValue',
  4141. value: function setCounterValue(currentLength, maxLength) {
  4142. currentLength = Math.min(currentLength, maxLength);
  4143. this.adapter_.setContent(currentLength + ' / ' + maxLength);
  4144. }
  4145. }]);
  4146. return MDCTextFieldCharacterCounterFoundation;
  4147. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  4148. /* harmony default export */ __webpack_exports__["a"] = (MDCTextFieldCharacterCounterFoundation);
  4149. /***/ }),
  4150. /* 27 */
  4151. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4152. "use strict";
  4153. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  4154. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(64);
  4155. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(153);
  4156. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  4157. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  4158. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4159. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  4160. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  4161. /**
  4162. * @license
  4163. * Copyright 2017 Google Inc.
  4164. *
  4165. * Permission is hereby granted, free of charge, to any person obtaining a copy
  4166. * of this software and associated documentation files (the "Software"), to deal
  4167. * in the Software without restriction, including without limitation the rights
  4168. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  4169. * copies of the Software, and to permit persons to whom the Software is
  4170. * furnished to do so, subject to the following conditions:
  4171. *
  4172. * The above copyright notice and this permission notice shall be included in
  4173. * all copies or substantial portions of the Software.
  4174. *
  4175. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  4176. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  4177. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  4178. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  4179. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  4180. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  4181. * THE SOFTWARE.
  4182. */
  4183. /**
  4184. * @extends {MDCFoundation<!MDCTextFieldIconAdapter>}
  4185. * @final
  4186. */
  4187. var MDCTextFieldIconFoundation = function (_MDCFoundation) {
  4188. _inherits(MDCTextFieldIconFoundation, _MDCFoundation);
  4189. _createClass(MDCTextFieldIconFoundation, null, [{
  4190. key: 'strings',
  4191. /** @return enum {string} */
  4192. get: function get() {
  4193. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* strings */];
  4194. }
  4195. /**
  4196. * {@see MDCTextFieldIconAdapter} for typing information on parameters and return
  4197. * types.
  4198. * @return {!MDCTextFieldIconAdapter}
  4199. */
  4200. }, {
  4201. key: 'defaultAdapter',
  4202. get: function get() {
  4203. return (/** @type {!MDCTextFieldIconAdapter} */{
  4204. getAttr: function getAttr() {},
  4205. setAttr: function setAttr() {},
  4206. removeAttr: function removeAttr() {},
  4207. setContent: function setContent() {},
  4208. registerInteractionHandler: function registerInteractionHandler() {},
  4209. deregisterInteractionHandler: function deregisterInteractionHandler() {},
  4210. notifyIconAction: function notifyIconAction() {}
  4211. }
  4212. );
  4213. }
  4214. /**
  4215. * @param {!MDCTextFieldIconAdapter} adapter
  4216. */
  4217. }]);
  4218. function MDCTextFieldIconFoundation(adapter) {
  4219. _classCallCheck(this, MDCTextFieldIconFoundation);
  4220. /** @private {string?} */
  4221. var _this = _possibleConstructorReturn(this, (MDCTextFieldIconFoundation.__proto__ || Object.getPrototypeOf(MDCTextFieldIconFoundation)).call(this, _extends(MDCTextFieldIconFoundation.defaultAdapter, adapter)));
  4222. _this.savedTabIndex_ = null;
  4223. /** @private {function(!Event): undefined} */
  4224. _this.interactionHandler_ = function (evt) {
  4225. return _this.handleInteraction(evt);
  4226. };
  4227. return _this;
  4228. }
  4229. _createClass(MDCTextFieldIconFoundation, [{
  4230. key: 'init',
  4231. value: function init() {
  4232. var _this2 = this;
  4233. this.savedTabIndex_ = this.adapter_.getAttr('tabindex');
  4234. ['click', 'keydown'].forEach(function (evtType) {
  4235. _this2.adapter_.registerInteractionHandler(evtType, _this2.interactionHandler_);
  4236. });
  4237. }
  4238. }, {
  4239. key: 'destroy',
  4240. value: function destroy() {
  4241. var _this3 = this;
  4242. ['click', 'keydown'].forEach(function (evtType) {
  4243. _this3.adapter_.deregisterInteractionHandler(evtType, _this3.interactionHandler_);
  4244. });
  4245. }
  4246. /** @param {boolean} disabled */
  4247. }, {
  4248. key: 'setDisabled',
  4249. value: function setDisabled(disabled) {
  4250. if (!this.savedTabIndex_) {
  4251. return;
  4252. }
  4253. if (disabled) {
  4254. this.adapter_.setAttr('tabindex', '-1');
  4255. this.adapter_.removeAttr('role');
  4256. } else {
  4257. this.adapter_.setAttr('tabindex', this.savedTabIndex_);
  4258. this.adapter_.setAttr('role', __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* strings */].ICON_ROLE);
  4259. }
  4260. }
  4261. /** @param {string} label */
  4262. }, {
  4263. key: 'setAriaLabel',
  4264. value: function setAriaLabel(label) {
  4265. this.adapter_.setAttr('aria-label', label);
  4266. }
  4267. /** @param {string} content */
  4268. }, {
  4269. key: 'setContent',
  4270. value: function setContent(content) {
  4271. this.adapter_.setContent(content);
  4272. }
  4273. /**
  4274. * Handles an interaction event
  4275. * @param {!Event} evt
  4276. */
  4277. }, {
  4278. key: 'handleInteraction',
  4279. value: function handleInteraction(evt) {
  4280. if (evt.type === 'click' || evt.key === 'Enter' || evt.keyCode === 13) {
  4281. this.adapter_.notifyIconAction();
  4282. }
  4283. }
  4284. }]);
  4285. return MDCTextFieldIconFoundation;
  4286. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  4287. /* harmony default export */ __webpack_exports__["a"] = (MDCTextFieldIconFoundation);
  4288. /***/ }),
  4289. /* 28 */
  4290. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4291. "use strict";
  4292. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  4293. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4294. /**
  4295. * @license
  4296. * Copyright 2016 Google Inc.
  4297. *
  4298. * Permission is hereby granted, free of charge, to any person obtaining a copy
  4299. * of this software and associated documentation files (the "Software"), to deal
  4300. * in the Software without restriction, including without limitation the rights
  4301. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  4302. * copies of the Software, and to permit persons to whom the Software is
  4303. * furnished to do so, subject to the following conditions:
  4304. *
  4305. * The above copyright notice and this permission notice shall be included in
  4306. * all copies or substantial portions of the Software.
  4307. *
  4308. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  4309. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  4310. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  4311. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  4312. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  4313. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  4314. * THE SOFTWARE.
  4315. */
  4316. /* eslint no-unused-vars: [2, {"args": "none"}] */
  4317. /**
  4318. * Adapter for MDC Ripple. Provides an interface for managing
  4319. * - classes
  4320. * - dom
  4321. * - CSS variables
  4322. * - position
  4323. * - dimensions
  4324. * - scroll position
  4325. * - event handlers
  4326. * - unbounded, active and disabled states
  4327. *
  4328. * Additionally, provides type information for the adapter to the Closure
  4329. * compiler.
  4330. *
  4331. * Implement this adapter for your framework of choice to delegate updates to
  4332. * the component in your framework of choice. See architecture documentation
  4333. * for more details.
  4334. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  4335. *
  4336. * @record
  4337. */
  4338. var MDCRippleAdapter = function () {
  4339. function MDCRippleAdapter() {
  4340. _classCallCheck(this, MDCRippleAdapter);
  4341. }
  4342. _createClass(MDCRippleAdapter, [{
  4343. key: "browserSupportsCssVars",
  4344. /** @return {boolean} */
  4345. value: function browserSupportsCssVars() {}
  4346. /** @return {boolean} */
  4347. }, {
  4348. key: "isUnbounded",
  4349. value: function isUnbounded() {}
  4350. /** @return {boolean} */
  4351. }, {
  4352. key: "isSurfaceActive",
  4353. value: function isSurfaceActive() {}
  4354. /** @return {boolean} */
  4355. }, {
  4356. key: "isSurfaceDisabled",
  4357. value: function isSurfaceDisabled() {}
  4358. /** @param {string} className */
  4359. }, {
  4360. key: "addClass",
  4361. value: function addClass(className) {}
  4362. /** @param {string} className */
  4363. }, {
  4364. key: "removeClass",
  4365. value: function removeClass(className) {}
  4366. /** @param {!EventTarget} target */
  4367. }, {
  4368. key: "containsEventTarget",
  4369. value: function containsEventTarget(target) {}
  4370. /**
  4371. * @param {string} evtType
  4372. * @param {!Function} handler
  4373. */
  4374. }, {
  4375. key: "registerInteractionHandler",
  4376. value: function registerInteractionHandler(evtType, handler) {}
  4377. /**
  4378. * @param {string} evtType
  4379. * @param {!Function} handler
  4380. */
  4381. }, {
  4382. key: "deregisterInteractionHandler",
  4383. value: function deregisterInteractionHandler(evtType, handler) {}
  4384. /**
  4385. * @param {string} evtType
  4386. * @param {!Function} handler
  4387. */
  4388. }, {
  4389. key: "registerDocumentInteractionHandler",
  4390. value: function registerDocumentInteractionHandler(evtType, handler) {}
  4391. /**
  4392. * @param {string} evtType
  4393. * @param {!Function} handler
  4394. */
  4395. }, {
  4396. key: "deregisterDocumentInteractionHandler",
  4397. value: function deregisterDocumentInteractionHandler(evtType, handler) {}
  4398. /**
  4399. * @param {!Function} handler
  4400. */
  4401. }, {
  4402. key: "registerResizeHandler",
  4403. value: function registerResizeHandler(handler) {}
  4404. /**
  4405. * @param {!Function} handler
  4406. */
  4407. }, {
  4408. key: "deregisterResizeHandler",
  4409. value: function deregisterResizeHandler(handler) {}
  4410. /**
  4411. * @param {string} varName
  4412. * @param {?number|string} value
  4413. */
  4414. }, {
  4415. key: "updateCssVariable",
  4416. value: function updateCssVariable(varName, value) {}
  4417. /** @return {!ClientRect} */
  4418. }, {
  4419. key: "computeBoundingRect",
  4420. value: function computeBoundingRect() {}
  4421. /** @return {{x: number, y: number}} */
  4422. }, {
  4423. key: "getWindowPageOffset",
  4424. value: function getWindowPageOffset() {}
  4425. }]);
  4426. return MDCRippleAdapter;
  4427. }();
  4428. /* unused harmony default export */ var _unused_webpack_default_export = (MDCRippleAdapter);
  4429. /***/ }),
  4430. /* 29 */
  4431. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4432. "use strict";
  4433. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCChip; });
  4434. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  4435. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__ = __webpack_require__(2);
  4436. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__adapter__ = __webpack_require__(30);
  4437. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation__ = __webpack_require__(31);
  4438. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__constants__ = __webpack_require__(32);
  4439. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_3__foundation__["a"]; });
  4440. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  4441. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  4442. var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
  4443. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4444. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  4445. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  4446. /**
  4447. * @license
  4448. * Copyright 2016 Google Inc.
  4449. *
  4450. * Permission is hereby granted, free of charge, to any person obtaining a copy
  4451. * of this software and associated documentation files (the "Software"), to deal
  4452. * in the Software without restriction, including without limitation the rights
  4453. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  4454. * copies of the Software, and to permit persons to whom the Software is
  4455. * furnished to do so, subject to the following conditions:
  4456. *
  4457. * The above copyright notice and this permission notice shall be included in
  4458. * all copies or substantial portions of the Software.
  4459. *
  4460. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  4461. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  4462. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  4463. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  4464. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  4465. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  4466. * THE SOFTWARE.
  4467. */
  4468. var INTERACTION_EVENTS = ['click', 'keydown'];
  4469. /**
  4470. * @extends {MDCComponent<!MDCChipFoundation>}
  4471. * @final
  4472. */
  4473. var MDCChip = function (_MDCComponent) {
  4474. _inherits(MDCChip, _MDCComponent);
  4475. /**
  4476. * @param {...?} args
  4477. */
  4478. function MDCChip() {
  4479. var _ref;
  4480. _classCallCheck(this, MDCChip);
  4481. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  4482. args[_key] = arguments[_key];
  4483. }
  4484. /** @type {string} */
  4485. var _this = _possibleConstructorReturn(this, (_ref = MDCChip.__proto__ || Object.getPrototypeOf(MDCChip)).call.apply(_ref, [this].concat(args)));
  4486. _this.id;
  4487. /** @private {?Element} */
  4488. _this.leadingIcon_;
  4489. /** @private {?Element} */
  4490. _this.trailingIcon_;
  4491. /** @private {?Element} */
  4492. _this.checkmark_;
  4493. /** @private {!MDCRipple} */
  4494. _this.ripple_;
  4495. /** @private {?function(?Event): undefined} */
  4496. _this.handleInteraction_;
  4497. /** @private {?function(!Event): undefined} */
  4498. _this.handleTransitionEnd_;
  4499. /** @private {function(!Event): undefined} */
  4500. _this.handleTrailingIconInteraction_;
  4501. return _this;
  4502. }
  4503. /**
  4504. * @param {!Element} root
  4505. * @return {!MDCChip}
  4506. */
  4507. _createClass(MDCChip, [{
  4508. key: 'initialize',
  4509. value: function initialize() {
  4510. var _this2 = this;
  4511. var rippleFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (el, foundation) {
  4512. return new __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRipple"](el, foundation);
  4513. };
  4514. this.id = this.root_.id;
  4515. this.leadingIcon_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].LEADING_ICON_SELECTOR);
  4516. this.trailingIcon_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].TRAILING_ICON_SELECTOR);
  4517. this.checkmark_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].CHECKMARK_SELECTOR);
  4518. var adapter = _extends(__WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRipple"].createAdapter(this), {
  4519. computeBoundingRect: function computeBoundingRect() {
  4520. return _this2.foundation_.getDimensions();
  4521. }
  4522. });
  4523. this.ripple_ = rippleFactory(this.root_, new __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRippleFoundation"](adapter));
  4524. }
  4525. }, {
  4526. key: 'initialSyncWithDOM',
  4527. value: function initialSyncWithDOM() {
  4528. var _this3 = this;
  4529. this.handleInteraction_ = function (evt) {
  4530. return _this3.foundation_.handleInteraction(evt);
  4531. };
  4532. this.handleTransitionEnd_ = function (evt) {
  4533. return _this3.foundation_.handleTransitionEnd(evt);
  4534. };
  4535. this.handleTrailingIconInteraction_ = function (evt) {
  4536. return _this3.foundation_.handleTrailingIconInteraction(evt);
  4537. };
  4538. INTERACTION_EVENTS.forEach(function (evtType) {
  4539. _this3.root_.addEventListener(evtType, _this3.handleInteraction_);
  4540. });
  4541. this.root_.addEventListener('transitionend', this.handleTransitionEnd_);
  4542. if (this.trailingIcon_) {
  4543. INTERACTION_EVENTS.forEach(function (evtType) {
  4544. _this3.trailingIcon_.addEventListener(evtType, _this3.handleTrailingIconInteraction_);
  4545. });
  4546. }
  4547. }
  4548. }, {
  4549. key: 'destroy',
  4550. value: function destroy() {
  4551. var _this4 = this;
  4552. this.ripple_.destroy();
  4553. INTERACTION_EVENTS.forEach(function (evtType) {
  4554. _this4.root_.removeEventListener(evtType, _this4.handleInteraction_);
  4555. });
  4556. this.root_.removeEventListener('transitionend', this.handleTransitionEnd_);
  4557. if (this.trailingIcon_) {
  4558. INTERACTION_EVENTS.forEach(function (evtType) {
  4559. _this4.trailingIcon_.removeEventListener(evtType, _this4.handleTrailingIconInteraction_);
  4560. });
  4561. }
  4562. _get(MDCChip.prototype.__proto__ || Object.getPrototypeOf(MDCChip.prototype), 'destroy', this).call(this);
  4563. }
  4564. /**
  4565. * Returns whether the chip is selected.
  4566. * @return {boolean}
  4567. */
  4568. }, {
  4569. key: 'beginExit',
  4570. /**
  4571. * Begins the exit animation which leads to removal of the chip.
  4572. */
  4573. value: function beginExit() {
  4574. this.foundation_.beginExit();
  4575. }
  4576. /**
  4577. * @return {!MDCChipFoundation}
  4578. */
  4579. }, {
  4580. key: 'getDefaultFoundation',
  4581. value: function getDefaultFoundation() {
  4582. var _this5 = this;
  4583. return new __WEBPACK_IMPORTED_MODULE_3__foundation__["a" /* MDCChipFoundation */]( /** @type {!MDCChipAdapter} */_extends({
  4584. addClass: function addClass(className) {
  4585. return _this5.root_.classList.add(className);
  4586. },
  4587. removeClass: function removeClass(className) {
  4588. return _this5.root_.classList.remove(className);
  4589. },
  4590. hasClass: function hasClass(className) {
  4591. return _this5.root_.classList.contains(className);
  4592. },
  4593. addClassToLeadingIcon: function addClassToLeadingIcon(className) {
  4594. if (_this5.leadingIcon_) {
  4595. _this5.leadingIcon_.classList.add(className);
  4596. }
  4597. },
  4598. removeClassFromLeadingIcon: function removeClassFromLeadingIcon(className) {
  4599. if (_this5.leadingIcon_) {
  4600. _this5.leadingIcon_.classList.remove(className);
  4601. }
  4602. },
  4603. eventTargetHasClass: function eventTargetHasClass(target, className) {
  4604. return target.classList.contains(className);
  4605. },
  4606. notifyInteraction: function notifyInteraction() {
  4607. return _this5.emit(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].INTERACTION_EVENT, { chipId: _this5.id }, true /* shouldBubble */);
  4608. },
  4609. notifySelection: function notifySelection(selected) {
  4610. return _this5.emit(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].SELECTION_EVENT, { chipId: _this5.id, selected: selected }, true /* shouldBubble */);
  4611. },
  4612. notifyTrailingIconInteraction: function notifyTrailingIconInteraction() {
  4613. return _this5.emit(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].TRAILING_ICON_INTERACTION_EVENT, { chipId: _this5.id }, true /* shouldBubble */);
  4614. },
  4615. notifyRemoval: function notifyRemoval() {
  4616. return _this5.emit(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].REMOVAL_EVENT, { chipId: _this5.id, root: _this5.root_ }, true /* shouldBubble */);
  4617. },
  4618. getComputedStyleValue: function getComputedStyleValue(propertyName) {
  4619. return window.getComputedStyle(_this5.root_).getPropertyValue(propertyName);
  4620. },
  4621. setStyleProperty: function setStyleProperty(propertyName, value) {
  4622. return _this5.root_.style.setProperty(propertyName, value);
  4623. },
  4624. hasLeadingIcon: function hasLeadingIcon() {
  4625. return !!_this5.leadingIcon_;
  4626. },
  4627. getRootBoundingClientRect: function getRootBoundingClientRect() {
  4628. return _this5.root_.getBoundingClientRect();
  4629. },
  4630. getCheckmarkBoundingClientRect: function getCheckmarkBoundingClientRect() {
  4631. return _this5.checkmark_ ? _this5.checkmark_.getBoundingClientRect() : null;
  4632. }
  4633. }));
  4634. }
  4635. /** @return {!MDCRipple} */
  4636. }, {
  4637. key: 'selected',
  4638. get: function get() {
  4639. return this.foundation_.isSelected();
  4640. }
  4641. /**
  4642. * Sets selected state on the chip.
  4643. * @param {boolean} selected
  4644. */
  4645. ,
  4646. set: function set(selected) {
  4647. this.foundation_.setSelected(selected);
  4648. }
  4649. /**
  4650. * Returns whether a trailing icon click should trigger exit/removal of the chip.
  4651. * @return {boolean}
  4652. */
  4653. }, {
  4654. key: 'shouldRemoveOnTrailingIconClick',
  4655. get: function get() {
  4656. return this.foundation_.getShouldRemoveOnTrailingIconClick();
  4657. }
  4658. /**
  4659. * Sets whether a trailing icon click should trigger exit/removal of the chip.
  4660. * @param {boolean} shouldRemove
  4661. */
  4662. ,
  4663. set: function set(shouldRemove) {
  4664. this.foundation_.setShouldRemoveOnTrailingIconClick(shouldRemove);
  4665. }
  4666. }, {
  4667. key: 'ripple',
  4668. get: function get() {
  4669. return this.ripple_;
  4670. }
  4671. }], [{
  4672. key: 'attachTo',
  4673. value: function attachTo(root) {
  4674. return new MDCChip(root);
  4675. }
  4676. }]);
  4677. return MDCChip;
  4678. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  4679. /***/ }),
  4680. /* 30 */
  4681. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4682. "use strict";
  4683. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  4684. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4685. /**
  4686. * @license
  4687. * Copyright 2017 Google Inc.
  4688. *
  4689. * Permission is hereby granted, free of charge, to any person obtaining a copy
  4690. * of this software and associated documentation files (the "Software"), to deal
  4691. * in the Software without restriction, including without limitation the rights
  4692. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  4693. * copies of the Software, and to permit persons to whom the Software is
  4694. * furnished to do so, subject to the following conditions:
  4695. *
  4696. * The above copyright notice and this permission notice shall be included in
  4697. * all copies or substantial portions of the Software.
  4698. *
  4699. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  4700. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  4701. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  4702. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  4703. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  4704. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  4705. * THE SOFTWARE.
  4706. */
  4707. /* eslint no-unused-vars: [2, {"args": "none"}] */
  4708. /**
  4709. * Adapter for MDC Chip.
  4710. *
  4711. * Defines the shape of the adapter expected by the foundation. Implement this
  4712. * adapter to integrate the Chip into your framework. See
  4713. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  4714. * for more information.
  4715. *
  4716. * @record
  4717. */
  4718. var MDCChipAdapter = function () {
  4719. function MDCChipAdapter() {
  4720. _classCallCheck(this, MDCChipAdapter);
  4721. }
  4722. _createClass(MDCChipAdapter, [{
  4723. key: "addClass",
  4724. /**
  4725. * Adds a class to the root element.
  4726. * @param {string} className
  4727. */
  4728. value: function addClass(className) {}
  4729. /**
  4730. * Removes a class from the root element.
  4731. * @param {string} className
  4732. */
  4733. }, {
  4734. key: "removeClass",
  4735. value: function removeClass(className) {}
  4736. /**
  4737. * Returns true if the root element contains the given class.
  4738. * @param {string} className
  4739. * @return {boolean}
  4740. */
  4741. }, {
  4742. key: "hasClass",
  4743. value: function hasClass(className) {}
  4744. /**
  4745. * Adds a class to the leading icon element.
  4746. * @param {string} className
  4747. */
  4748. }, {
  4749. key: "addClassToLeadingIcon",
  4750. value: function addClassToLeadingIcon(className) {}
  4751. /**
  4752. * Removes a class from the leading icon element.
  4753. * @param {string} className
  4754. */
  4755. }, {
  4756. key: "removeClassFromLeadingIcon",
  4757. value: function removeClassFromLeadingIcon(className) {}
  4758. /**
  4759. * Returns true if target has className, false otherwise.
  4760. * @param {!EventTarget} target
  4761. * @param {string} className
  4762. * @return {boolean}
  4763. */
  4764. }, {
  4765. key: "eventTargetHasClass",
  4766. value: function eventTargetHasClass(target, className) {}
  4767. /**
  4768. * Emits a custom "MDCChip:interaction" event denoting the chip has been
  4769. * interacted with (typically on click or keydown).
  4770. */
  4771. }, {
  4772. key: "notifyInteraction",
  4773. value: function notifyInteraction() {}
  4774. /**
  4775. * Emits a custom "MDCChip:selection" event denoting the chip has been selected or deselected.
  4776. * @param {boolean} selected
  4777. */
  4778. }, {
  4779. key: "notifySelection",
  4780. value: function notifySelection(selected) {}
  4781. /**
  4782. * Emits a custom "MDCChip:trailingIconInteraction" event denoting the trailing icon has been
  4783. * interacted with (typically on click or keydown).
  4784. */
  4785. }, {
  4786. key: "notifyTrailingIconInteraction",
  4787. value: function notifyTrailingIconInteraction() {}
  4788. /**
  4789. * Emits a custom event "MDCChip:removal" denoting the chip will be removed.
  4790. */
  4791. }, {
  4792. key: "notifyRemoval",
  4793. value: function notifyRemoval() {}
  4794. /**
  4795. * Returns the computed property value of the given style property on the root element.
  4796. * @param {string} propertyName
  4797. * @return {string}
  4798. */
  4799. }, {
  4800. key: "getComputedStyleValue",
  4801. value: function getComputedStyleValue(propertyName) {}
  4802. /**
  4803. * Sets the property value of the given style property on the root element.
  4804. * @param {string} propertyName
  4805. * @param {string} value
  4806. */
  4807. }, {
  4808. key: "setStyleProperty",
  4809. value: function setStyleProperty(propertyName, value) {}
  4810. /**
  4811. * Returns whether the chip has a leading icon.
  4812. * @return {boolean}
  4813. */
  4814. }, {
  4815. key: "hasLeadingIcon",
  4816. value: function hasLeadingIcon() {}
  4817. /**
  4818. * Returns the bounding client rect of the root element.
  4819. * @return {!ClientRect}
  4820. */
  4821. }, {
  4822. key: "getRootBoundingClientRect",
  4823. value: function getRootBoundingClientRect() {}
  4824. /**
  4825. * Returns the bounding client rect of the checkmark element or null if it doesn't exist.
  4826. * @return {?ClientRect}
  4827. */
  4828. }, {
  4829. key: "getCheckmarkBoundingClientRect",
  4830. value: function getCheckmarkBoundingClientRect() {}
  4831. }]);
  4832. return MDCChipAdapter;
  4833. }();
  4834. /* unused harmony default export */ var _unused_webpack_default_export = (MDCChipAdapter);
  4835. /***/ }),
  4836. /* 31 */
  4837. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4838. "use strict";
  4839. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCChipFoundation; });
  4840. /* unused harmony export MDCChipInteractionEventType */
  4841. /* unused harmony export MDCChipSelectionEventType */
  4842. /* unused harmony export MDCChipRemovalEventType */
  4843. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  4844. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(30);
  4845. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(32);
  4846. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  4847. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  4848. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4849. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  4850. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  4851. /**
  4852. * @license
  4853. * Copyright 2016 Google Inc.
  4854. *
  4855. * Permission is hereby granted, free of charge, to any person obtaining a copy
  4856. * of this software and associated documentation files (the "Software"), to deal
  4857. * in the Software without restriction, including without limitation the rights
  4858. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  4859. * copies of the Software, and to permit persons to whom the Software is
  4860. * furnished to do so, subject to the following conditions:
  4861. *
  4862. * The above copyright notice and this permission notice shall be included in
  4863. * all copies or substantial portions of the Software.
  4864. *
  4865. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  4866. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  4867. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  4868. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  4869. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  4870. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  4871. * THE SOFTWARE.
  4872. */
  4873. /**
  4874. * @extends {MDCFoundation<!MDCChipAdapter>}
  4875. * @final
  4876. */
  4877. var MDCChipFoundation = function (_MDCFoundation) {
  4878. _inherits(MDCChipFoundation, _MDCFoundation);
  4879. _createClass(MDCChipFoundation, null, [{
  4880. key: 'strings',
  4881. /** @return enum {string} */
  4882. get: function get() {
  4883. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  4884. }
  4885. /** @return enum {string} */
  4886. }, {
  4887. key: 'cssClasses',
  4888. get: function get() {
  4889. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  4890. }
  4891. /**
  4892. * {@see MDCChipAdapter} for typing information on parameters and return
  4893. * types.
  4894. * @return {!MDCChipAdapter}
  4895. */
  4896. }, {
  4897. key: 'defaultAdapter',
  4898. get: function get() {
  4899. return (/** @type {!MDCChipAdapter} */{
  4900. addClass: function addClass() {},
  4901. removeClass: function removeClass() {},
  4902. hasClass: function hasClass() {},
  4903. addClassToLeadingIcon: function addClassToLeadingIcon() {},
  4904. removeClassFromLeadingIcon: function removeClassFromLeadingIcon() {},
  4905. eventTargetHasClass: function eventTargetHasClass() {},
  4906. notifyInteraction: function notifyInteraction() {},
  4907. notifySelection: function notifySelection() {},
  4908. notifyTrailingIconInteraction: function notifyTrailingIconInteraction() {},
  4909. notifyRemoval: function notifyRemoval() {},
  4910. getComputedStyleValue: function getComputedStyleValue() {},
  4911. setStyleProperty: function setStyleProperty() {},
  4912. hasLeadingIcon: function hasLeadingIcon() {},
  4913. getRootBoundingClientRect: function getRootBoundingClientRect() {},
  4914. getCheckmarkBoundingClientRect: function getCheckmarkBoundingClientRect() {}
  4915. }
  4916. );
  4917. }
  4918. /**
  4919. * @param {!MDCChipAdapter} adapter
  4920. */
  4921. }]);
  4922. function MDCChipFoundation(adapter) {
  4923. _classCallCheck(this, MDCChipFoundation);
  4924. /**
  4925. * Whether a trailing icon click should immediately trigger exit/removal of the chip.
  4926. * @private {boolean}
  4927. * */
  4928. var _this = _possibleConstructorReturn(this, (MDCChipFoundation.__proto__ || Object.getPrototypeOf(MDCChipFoundation)).call(this, _extends(MDCChipFoundation.defaultAdapter, adapter)));
  4929. _this.shouldRemoveOnTrailingIconClick_ = true;
  4930. return _this;
  4931. }
  4932. /**
  4933. * @return {boolean}
  4934. */
  4935. _createClass(MDCChipFoundation, [{
  4936. key: 'isSelected',
  4937. value: function isSelected() {
  4938. return this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SELECTED);
  4939. }
  4940. /**
  4941. * @param {boolean} selected
  4942. */
  4943. }, {
  4944. key: 'setSelected',
  4945. value: function setSelected(selected) {
  4946. if (selected) {
  4947. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SELECTED);
  4948. } else {
  4949. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SELECTED);
  4950. }
  4951. this.adapter_.notifySelection(selected);
  4952. }
  4953. /**
  4954. * @return {boolean}
  4955. */
  4956. }, {
  4957. key: 'getShouldRemoveOnTrailingIconClick',
  4958. value: function getShouldRemoveOnTrailingIconClick() {
  4959. return this.shouldRemoveOnTrailingIconClick_;
  4960. }
  4961. /**
  4962. * @param {boolean} shouldRemove
  4963. */
  4964. }, {
  4965. key: 'setShouldRemoveOnTrailingIconClick',
  4966. value: function setShouldRemoveOnTrailingIconClick(shouldRemove) {
  4967. this.shouldRemoveOnTrailingIconClick_ = shouldRemove;
  4968. }
  4969. /** @return {!ClientRect} */
  4970. }, {
  4971. key: 'getDimensions',
  4972. value: function getDimensions() {
  4973. // When a chip has a checkmark and not a leading icon, the bounding rect changes in size depending on the current
  4974. // size of the checkmark.
  4975. if (!this.adapter_.hasLeadingIcon() && this.adapter_.getCheckmarkBoundingClientRect() !== null) {
  4976. var height = this.adapter_.getRootBoundingClientRect().height;
  4977. // The checkmark's width is initially set to 0, so use the checkmark's height as a proxy since the checkmark
  4978. // should always be square.
  4979. var width = this.adapter_.getRootBoundingClientRect().width + this.adapter_.getCheckmarkBoundingClientRect().height;
  4980. return (/** @type {!ClientRect} */{ height: height, width: width }
  4981. );
  4982. } else {
  4983. return this.adapter_.getRootBoundingClientRect();
  4984. }
  4985. }
  4986. /**
  4987. * Begins the exit animation which leads to removal of the chip.
  4988. */
  4989. }, {
  4990. key: 'beginExit',
  4991. value: function beginExit() {
  4992. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CHIP_EXIT);
  4993. }
  4994. /**
  4995. * Handles an interaction event on the root element.
  4996. * @param {!Event} evt
  4997. */
  4998. }, {
  4999. key: 'handleInteraction',
  5000. value: function handleInteraction(evt) {
  5001. if (evt.type === 'click' || evt.key === 'Enter' || evt.keyCode === 13) {
  5002. this.adapter_.notifyInteraction();
  5003. }
  5004. }
  5005. /**
  5006. * Handles a transition end event on the root element.
  5007. * @param {!Event} evt
  5008. */
  5009. }, {
  5010. key: 'handleTransitionEnd',
  5011. value: function handleTransitionEnd(evt) {
  5012. var _this2 = this;
  5013. // Handle transition end event on the chip when it is about to be removed.
  5014. if (this.adapter_.eventTargetHasClass( /** @type {!EventTarget} */evt.target, __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CHIP_EXIT)) {
  5015. if (evt.propertyName === 'width') {
  5016. this.adapter_.notifyRemoval();
  5017. } else if (evt.propertyName === 'opacity') {
  5018. // See: https://css-tricks.com/using-css-transitions-auto-dimensions/#article-header-id-5
  5019. var chipWidth = this.adapter_.getComputedStyleValue('width');
  5020. // On the next frame (once we get the computed width), explicitly set the chip's width
  5021. // to its current pixel width, so we aren't transitioning out of 'auto'.
  5022. requestAnimationFrame(function () {
  5023. _this2.adapter_.setStyleProperty('width', chipWidth);
  5024. // To mitigate jitter, start transitioning padding and margin before width.
  5025. _this2.adapter_.setStyleProperty('padding', '0');
  5026. _this2.adapter_.setStyleProperty('margin', '0');
  5027. // On the next frame (once width is explicitly set), transition width to 0.
  5028. requestAnimationFrame(function () {
  5029. _this2.adapter_.setStyleProperty('width', '0');
  5030. });
  5031. });
  5032. }
  5033. return;
  5034. }
  5035. // Handle a transition end event on the leading icon or checkmark, since the transition end event bubbles.
  5036. if (evt.propertyName !== 'opacity') {
  5037. return;
  5038. }
  5039. if (this.adapter_.eventTargetHasClass( /** @type {!EventTarget} */evt.target, __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LEADING_ICON) && this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SELECTED)) {
  5040. this.adapter_.addClassToLeadingIcon(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HIDDEN_LEADING_ICON);
  5041. } else if (this.adapter_.eventTargetHasClass( /** @type {!EventTarget} */evt.target, __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CHECKMARK) && !this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SELECTED)) {
  5042. this.adapter_.removeClassFromLeadingIcon(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HIDDEN_LEADING_ICON);
  5043. }
  5044. }
  5045. /**
  5046. * Handles an interaction event on the trailing icon element. This is used to
  5047. * prevent the ripple from activating on interaction with the trailing icon.
  5048. * @param {!Event} evt
  5049. */
  5050. }, {
  5051. key: 'handleTrailingIconInteraction',
  5052. value: function handleTrailingIconInteraction(evt) {
  5053. evt.stopPropagation();
  5054. if (evt.type === 'click' || evt.key === 'Enter' || evt.keyCode === 13) {
  5055. this.adapter_.notifyTrailingIconInteraction();
  5056. if (this.shouldRemoveOnTrailingIconClick_) {
  5057. this.beginExit();
  5058. }
  5059. }
  5060. }
  5061. }]);
  5062. return MDCChipFoundation;
  5063. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  5064. /**
  5065. * @typedef {{
  5066. * detail: {
  5067. * chipId: string,
  5068. * },
  5069. * bubbles: boolean,
  5070. * }}
  5071. */
  5072. var MDCChipInteractionEventType = void 0;
  5073. /**
  5074. * @typedef {{
  5075. * detail: {
  5076. * chipId: string,
  5077. * selected: boolean,
  5078. * },
  5079. * bubbles: boolean,
  5080. * }}
  5081. */
  5082. var MDCChipSelectionEventType = void 0;
  5083. /**
  5084. * @typedef {{
  5085. * detail: {
  5086. * chipId: string,
  5087. * root: Element,
  5088. * },
  5089. * bubbles: boolean,
  5090. * }}
  5091. */
  5092. var MDCChipRemovalEventType = void 0;
  5093. /***/ }),
  5094. /* 32 */
  5095. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5096. "use strict";
  5097. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  5098. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  5099. /**
  5100. * @license
  5101. * Copyright 2016 Google Inc.
  5102. *
  5103. * Permission is hereby granted, free of charge, to any person obtaining a copy
  5104. * of this software and associated documentation files (the "Software"), to deal
  5105. * in the Software without restriction, including without limitation the rights
  5106. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  5107. * copies of the Software, and to permit persons to whom the Software is
  5108. * furnished to do so, subject to the following conditions:
  5109. *
  5110. * The above copyright notice and this permission notice shall be included in
  5111. * all copies or substantial portions of the Software.
  5112. *
  5113. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  5114. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  5115. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  5116. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  5117. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  5118. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  5119. * THE SOFTWARE.
  5120. */
  5121. /** @enum {string} */
  5122. var strings = {
  5123. ENTRY_ANIMATION_NAME: 'mdc-chip-entry',
  5124. INTERACTION_EVENT: 'MDCChip:interaction',
  5125. SELECTION_EVENT: 'MDCChip:selection',
  5126. TRAILING_ICON_INTERACTION_EVENT: 'MDCChip:trailingIconInteraction',
  5127. REMOVAL_EVENT: 'MDCChip:removal',
  5128. CHECKMARK_SELECTOR: '.mdc-chip__checkmark',
  5129. LEADING_ICON_SELECTOR: '.mdc-chip__icon--leading',
  5130. TRAILING_ICON_SELECTOR: '.mdc-chip__icon--trailing'
  5131. };
  5132. /** @enum {string} */
  5133. var cssClasses = {
  5134. CHECKMARK: 'mdc-chip__checkmark',
  5135. CHIP_EXIT: 'mdc-chip--exit',
  5136. HIDDEN_LEADING_ICON: 'mdc-chip__icon--leading-hidden',
  5137. LEADING_ICON: 'mdc-chip__icon--leading',
  5138. TRAILING_ICON: 'mdc-chip__icon--trailing',
  5139. SELECTED: 'mdc-chip--selected'
  5140. };
  5141. /***/ }),
  5142. /* 33 */
  5143. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5144. "use strict";
  5145. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  5146. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5147. /**
  5148. * @license
  5149. * Copyright 2017 Google Inc.
  5150. *
  5151. * Permission is hereby granted, free of charge, to any person obtaining a copy
  5152. * of this software and associated documentation files (the "Software"), to deal
  5153. * in the Software without restriction, including without limitation the rights
  5154. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  5155. * copies of the Software, and to permit persons to whom the Software is
  5156. * furnished to do so, subject to the following conditions:
  5157. *
  5158. * The above copyright notice and this permission notice shall be included in
  5159. * all copies or substantial portions of the Software.
  5160. *
  5161. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  5162. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  5163. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  5164. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  5165. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  5166. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  5167. * THE SOFTWARE.
  5168. */
  5169. /* eslint no-unused-vars: [2, {"args": "none"}] */
  5170. /**
  5171. * Adapter for MDC Chip Set.
  5172. *
  5173. * Defines the shape of the adapter expected by the foundation. Implement this
  5174. * adapter to integrate the Chip Set into your framework. See
  5175. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  5176. * for more information.
  5177. *
  5178. * @record
  5179. */
  5180. var MDCChipSetAdapter = function () {
  5181. function MDCChipSetAdapter() {
  5182. _classCallCheck(this, MDCChipSetAdapter);
  5183. }
  5184. _createClass(MDCChipSetAdapter, [{
  5185. key: "hasClass",
  5186. /**
  5187. * Returns true if the root element contains the given class name.
  5188. * @param {string} className
  5189. * @return {boolean}
  5190. */
  5191. value: function hasClass(className) {}
  5192. /**
  5193. * Removes the chip with the given id from the chip set.
  5194. * @param {string} chipId
  5195. */
  5196. }, {
  5197. key: "removeChip",
  5198. value: function removeChip(chipId) {}
  5199. /**
  5200. * Sets the selected state of the chip with the given id.
  5201. * @param {string} chipId
  5202. * @param {boolean} selected
  5203. */
  5204. }, {
  5205. key: "setSelected",
  5206. value: function setSelected(chipId, selected) {}
  5207. }]);
  5208. return MDCChipSetAdapter;
  5209. }();
  5210. /* unused harmony default export */ var _unused_webpack_default_export = (MDCChipSetAdapter);
  5211. /***/ }),
  5212. /* 34 */
  5213. /***/ (function(module, exports, __webpack_require__) {
  5214. var tabbable = __webpack_require__(83);
  5215. var xtend = __webpack_require__(84);
  5216. var activeFocusTraps = (function() {
  5217. var trapQueue = [];
  5218. return {
  5219. activateTrap: function(trap) {
  5220. if (trapQueue.length > 0) {
  5221. var activeTrap = trapQueue[trapQueue.length - 1];
  5222. if (activeTrap !== trap) {
  5223. activeTrap.pause();
  5224. }
  5225. }
  5226. var trapIndex = trapQueue.indexOf(trap);
  5227. if (trapIndex === -1) {
  5228. trapQueue.push(trap);
  5229. } else {
  5230. // move this existing trap to the front of the queue
  5231. trapQueue.splice(trapIndex, 1);
  5232. trapQueue.push(trap);
  5233. }
  5234. },
  5235. deactivateTrap: function(trap) {
  5236. var trapIndex = trapQueue.indexOf(trap);
  5237. if (trapIndex !== -1) {
  5238. trapQueue.splice(trapIndex, 1);
  5239. }
  5240. if (trapQueue.length > 0) {
  5241. trapQueue[trapQueue.length - 1].unpause();
  5242. }
  5243. }
  5244. };
  5245. })();
  5246. function focusTrap(element, userOptions) {
  5247. var doc = document;
  5248. var container =
  5249. typeof element === 'string' ? doc.querySelector(element) : element;
  5250. var config = xtend(
  5251. {
  5252. returnFocusOnDeactivate: true,
  5253. escapeDeactivates: true
  5254. },
  5255. userOptions
  5256. );
  5257. var state = {
  5258. firstTabbableNode: null,
  5259. lastTabbableNode: null,
  5260. nodeFocusedBeforeActivation: null,
  5261. mostRecentlyFocusedNode: null,
  5262. active: false,
  5263. paused: false
  5264. };
  5265. var trap = {
  5266. activate: activate,
  5267. deactivate: deactivate,
  5268. pause: pause,
  5269. unpause: unpause
  5270. };
  5271. return trap;
  5272. function activate(activateOptions) {
  5273. if (state.active) return;
  5274. updateTabbableNodes();
  5275. state.active = true;
  5276. state.paused = false;
  5277. state.nodeFocusedBeforeActivation = doc.activeElement;
  5278. var onActivate =
  5279. activateOptions && activateOptions.onActivate
  5280. ? activateOptions.onActivate
  5281. : config.onActivate;
  5282. if (onActivate) {
  5283. onActivate();
  5284. }
  5285. addListeners();
  5286. return trap;
  5287. }
  5288. function deactivate(deactivateOptions) {
  5289. if (!state.active) return;
  5290. removeListeners();
  5291. state.active = false;
  5292. state.paused = false;
  5293. activeFocusTraps.deactivateTrap(trap);
  5294. var onDeactivate =
  5295. deactivateOptions && deactivateOptions.onDeactivate !== undefined
  5296. ? deactivateOptions.onDeactivate
  5297. : config.onDeactivate;
  5298. if (onDeactivate) {
  5299. onDeactivate();
  5300. }
  5301. var returnFocus =
  5302. deactivateOptions && deactivateOptions.returnFocus !== undefined
  5303. ? deactivateOptions.returnFocus
  5304. : config.returnFocusOnDeactivate;
  5305. if (returnFocus) {
  5306. delay(function() {
  5307. tryFocus(state.nodeFocusedBeforeActivation);
  5308. });
  5309. }
  5310. return trap;
  5311. }
  5312. function pause() {
  5313. if (state.paused || !state.active) return;
  5314. state.paused = true;
  5315. removeListeners();
  5316. }
  5317. function unpause() {
  5318. if (!state.paused || !state.active) return;
  5319. state.paused = false;
  5320. addListeners();
  5321. }
  5322. function addListeners() {
  5323. if (!state.active) return;
  5324. // There can be only one listening focus trap at a time
  5325. activeFocusTraps.activateTrap(trap);
  5326. updateTabbableNodes();
  5327. // Delay ensures that the focused element doesn't capture the event
  5328. // that caused the focus trap activation.
  5329. delay(function() {
  5330. tryFocus(getInitialFocusNode());
  5331. });
  5332. doc.addEventListener('focusin', checkFocusIn, true);
  5333. doc.addEventListener('mousedown', checkPointerDown, true);
  5334. doc.addEventListener('touchstart', checkPointerDown, true);
  5335. doc.addEventListener('click', checkClick, true);
  5336. doc.addEventListener('keydown', checkKey, true);
  5337. return trap;
  5338. }
  5339. function removeListeners() {
  5340. if (!state.active) return;
  5341. doc.removeEventListener('focusin', checkFocusIn, true);
  5342. doc.removeEventListener('mousedown', checkPointerDown, true);
  5343. doc.removeEventListener('touchstart', checkPointerDown, true);
  5344. doc.removeEventListener('click', checkClick, true);
  5345. doc.removeEventListener('keydown', checkKey, true);
  5346. return trap;
  5347. }
  5348. function getNodeForOption(optionName) {
  5349. var optionValue = config[optionName];
  5350. var node = optionValue;
  5351. if (!optionValue) {
  5352. return null;
  5353. }
  5354. if (typeof optionValue === 'string') {
  5355. node = doc.querySelector(optionValue);
  5356. if (!node) {
  5357. throw new Error('`' + optionName + '` refers to no known node');
  5358. }
  5359. }
  5360. if (typeof optionValue === 'function') {
  5361. node = optionValue();
  5362. if (!node) {
  5363. throw new Error('`' + optionName + '` did not return a node');
  5364. }
  5365. }
  5366. return node;
  5367. }
  5368. function getInitialFocusNode() {
  5369. var node;
  5370. if (getNodeForOption('initialFocus') !== null) {
  5371. node = getNodeForOption('initialFocus');
  5372. } else if (container.contains(doc.activeElement)) {
  5373. node = doc.activeElement;
  5374. } else {
  5375. node = state.firstTabbableNode || getNodeForOption('fallbackFocus');
  5376. }
  5377. if (!node) {
  5378. throw new Error(
  5379. "You can't have a focus-trap without at least one focusable element"
  5380. );
  5381. }
  5382. return node;
  5383. }
  5384. // This needs to be done on mousedown and touchstart instead of click
  5385. // so that it precedes the focus event.
  5386. function checkPointerDown(e) {
  5387. if (container.contains(e.target)) return;
  5388. if (config.clickOutsideDeactivates) {
  5389. deactivate({
  5390. returnFocus: !tabbable.isFocusable(e.target)
  5391. });
  5392. } else {
  5393. e.preventDefault();
  5394. }
  5395. }
  5396. // In case focus escapes the trap for some strange reason, pull it back in.
  5397. function checkFocusIn(e) {
  5398. // In Firefox when you Tab out of an iframe the Document is briefly focused.
  5399. if (container.contains(e.target) || e.target instanceof Document) {
  5400. return;
  5401. }
  5402. e.stopImmediatePropagation();
  5403. tryFocus(state.mostRecentlyFocusedNode || getInitialFocusNode());
  5404. }
  5405. function checkKey(e) {
  5406. if (config.escapeDeactivates !== false && isEscapeEvent(e)) {
  5407. e.preventDefault();
  5408. deactivate();
  5409. return;
  5410. }
  5411. if (isTabEvent(e)) {
  5412. checkTab(e);
  5413. return;
  5414. }
  5415. }
  5416. // Hijack Tab events on the first and last focusable nodes of the trap,
  5417. // in order to prevent focus from escaping. If it escapes for even a
  5418. // moment it can end up scrolling the page and causing confusion so we
  5419. // kind of need to capture the action at the keydown phase.
  5420. function checkTab(e) {
  5421. updateTabbableNodes();
  5422. if (e.shiftKey && e.target === state.firstTabbableNode) {
  5423. e.preventDefault();
  5424. tryFocus(state.lastTabbableNode);
  5425. return;
  5426. }
  5427. if (!e.shiftKey && e.target === state.lastTabbableNode) {
  5428. e.preventDefault();
  5429. tryFocus(state.firstTabbableNode);
  5430. return;
  5431. }
  5432. }
  5433. function checkClick(e) {
  5434. if (config.clickOutsideDeactivates) return;
  5435. if (container.contains(e.target)) return;
  5436. e.preventDefault();
  5437. e.stopImmediatePropagation();
  5438. }
  5439. function updateTabbableNodes() {
  5440. var tabbableNodes = tabbable(container);
  5441. state.firstTabbableNode = tabbableNodes[0] || getInitialFocusNode();
  5442. state.lastTabbableNode =
  5443. tabbableNodes[tabbableNodes.length - 1] || getInitialFocusNode();
  5444. }
  5445. function tryFocus(node) {
  5446. if (node === doc.activeElement) return;
  5447. if (!node || !node.focus) {
  5448. tryFocus(getInitialFocusNode());
  5449. return;
  5450. }
  5451. node.focus();
  5452. state.mostRecentlyFocusedNode = node;
  5453. if (isSelectableInput(node)) {
  5454. node.select();
  5455. }
  5456. }
  5457. }
  5458. function isSelectableInput(node) {
  5459. return (
  5460. node.tagName &&
  5461. node.tagName.toLowerCase() === 'input' &&
  5462. typeof node.select === 'function'
  5463. );
  5464. }
  5465. function isEscapeEvent(e) {
  5466. return e.key === 'Escape' || e.key === 'Esc' || e.keyCode === 27;
  5467. }
  5468. function isTabEvent(e) {
  5469. return e.key === 'Tab' || e.keyCode === 9;
  5470. }
  5471. function delay(fn) {
  5472. return setTimeout(fn, 0);
  5473. }
  5474. module.exports = focusTrap;
  5475. /***/ }),
  5476. /* 35 */
  5477. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5478. "use strict";
  5479. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__adapter__ = __webpack_require__(36);
  5480. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_foundation__ = __webpack_require__(0);
  5481. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(37);
  5482. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  5483. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  5484. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5485. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  5486. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  5487. /**
  5488. * @license
  5489. * Copyright 2018 Google Inc.
  5490. *
  5491. * Permission is hereby granted, free of charge, to any person obtaining a copy
  5492. * of this software and associated documentation files (the "Software"), to deal
  5493. * in the Software without restriction, including without limitation the rights
  5494. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  5495. * copies of the Software, and to permit persons to whom the Software is
  5496. * furnished to do so, subject to the following conditions:
  5497. *
  5498. * The above copyright notice and this permission notice shall be included in
  5499. * all copies or substantial portions of the Software.
  5500. *
  5501. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  5502. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  5503. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  5504. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  5505. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  5506. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  5507. * THE SOFTWARE.
  5508. */
  5509. /**
  5510. * @extends {MDCFoundation<!MDCDrawerAdapter>}
  5511. */
  5512. var MDCDismissibleDrawerFoundation = function (_MDCFoundation) {
  5513. _inherits(MDCDismissibleDrawerFoundation, _MDCFoundation);
  5514. _createClass(MDCDismissibleDrawerFoundation, null, [{
  5515. key: 'strings',
  5516. /** @return enum {string} */
  5517. get: function get() {
  5518. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  5519. }
  5520. /** @return enum {string} */
  5521. }, {
  5522. key: 'cssClasses',
  5523. get: function get() {
  5524. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  5525. }
  5526. }, {
  5527. key: 'defaultAdapter',
  5528. get: function get() {
  5529. return (/** @type {!MDCDrawerAdapter} */{
  5530. addClass: function addClass() /* className: string */{},
  5531. removeClass: function removeClass() /* className: string */{},
  5532. hasClass: function hasClass() /* className: string */{},
  5533. elementHasClass: function elementHasClass() /* element: !Element, className: string */{},
  5534. notifyClose: function notifyClose() {},
  5535. notifyOpen: function notifyOpen() {},
  5536. saveFocus: function saveFocus() {},
  5537. restoreFocus: function restoreFocus() {},
  5538. focusActiveNavigationItem: function focusActiveNavigationItem() {},
  5539. trapFocus: function trapFocus() {},
  5540. releaseFocus: function releaseFocus() {}
  5541. }
  5542. );
  5543. }
  5544. }]);
  5545. function MDCDismissibleDrawerFoundation(adapter) {
  5546. _classCallCheck(this, MDCDismissibleDrawerFoundation);
  5547. /** @private {number} */
  5548. var _this = _possibleConstructorReturn(this, (MDCDismissibleDrawerFoundation.__proto__ || Object.getPrototypeOf(MDCDismissibleDrawerFoundation)).call(this, _extends(MDCDismissibleDrawerFoundation.defaultAdapter, adapter)));
  5549. _this.animationFrame_ = 0;
  5550. /** @private {number} */
  5551. _this.animationTimer_ = 0;
  5552. return _this;
  5553. }
  5554. _createClass(MDCDismissibleDrawerFoundation, [{
  5555. key: 'destroy',
  5556. value: function destroy() {
  5557. if (this.animationFrame_) {
  5558. cancelAnimationFrame(this.animationFrame_);
  5559. }
  5560. if (this.animationTimer_) {
  5561. clearTimeout(this.animationTimer_);
  5562. }
  5563. }
  5564. /**
  5565. * Function to open the drawer.
  5566. */
  5567. }, {
  5568. key: 'open',
  5569. value: function open() {
  5570. var _this2 = this;
  5571. if (this.isOpen() || this.isOpening() || this.isClosing()) {
  5572. return;
  5573. }
  5574. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].OPEN);
  5575. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ANIMATE);
  5576. // Wait a frame once display is no longer "none", to establish basis for animation
  5577. this.runNextAnimationFrame_(function () {
  5578. _this2.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].OPENING);
  5579. });
  5580. this.adapter_.saveFocus();
  5581. }
  5582. /**
  5583. * Function to close the drawer.
  5584. */
  5585. }, {
  5586. key: 'close',
  5587. value: function close() {
  5588. if (!this.isOpen() || this.isOpening() || this.isClosing()) {
  5589. return;
  5590. }
  5591. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CLOSING);
  5592. }
  5593. /**
  5594. * Extension point for when drawer finishes open animation.
  5595. * @protected
  5596. */
  5597. }, {
  5598. key: 'opened',
  5599. value: function opened() {}
  5600. /**
  5601. * Extension point for when drawer finishes close animation.
  5602. * @protected
  5603. */
  5604. }, {
  5605. key: 'closed',
  5606. value: function closed() {}
  5607. /**
  5608. * Returns true if drawer is in open state.
  5609. * @return {boolean}
  5610. */
  5611. }, {
  5612. key: 'isOpen',
  5613. value: function isOpen() {
  5614. return this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].OPEN);
  5615. }
  5616. /**
  5617. * Returns true if drawer is animating open.
  5618. * @return {boolean}
  5619. */
  5620. }, {
  5621. key: 'isOpening',
  5622. value: function isOpening() {
  5623. return this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].OPENING) || this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ANIMATE);
  5624. }
  5625. /**
  5626. * Returns true if drawer is animating closed.
  5627. * @return {boolean}
  5628. */
  5629. }, {
  5630. key: 'isClosing',
  5631. value: function isClosing() {
  5632. return this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CLOSING);
  5633. }
  5634. /**
  5635. * Keydown handler to close drawer when key is escape.
  5636. * @param evt
  5637. */
  5638. }, {
  5639. key: 'handleKeydown',
  5640. value: function handleKeydown(evt) {
  5641. var keyCode = evt.keyCode,
  5642. key = evt.key;
  5643. var isEscape = key === 'Escape' || keyCode === 27;
  5644. if (isEscape) {
  5645. this.close();
  5646. }
  5647. }
  5648. /**
  5649. * Handles a transition end event on the root element.
  5650. * @param {!Event} evt
  5651. */
  5652. }, {
  5653. key: 'handleTransitionEnd',
  5654. value: function handleTransitionEnd(evt) {
  5655. var OPENING = __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].OPENING,
  5656. CLOSING = __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CLOSING,
  5657. OPEN = __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].OPEN,
  5658. ANIMATE = __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ANIMATE,
  5659. ROOT = __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ROOT;
  5660. // In Edge, transitionend on ripple pseudo-elements yields a target without classList, so check for Element first.
  5661. var isElement = evt.target instanceof Element;
  5662. if (!isElement || !this.adapter_.elementHasClass( /** @type {!Element} */evt.target, ROOT)) {
  5663. return;
  5664. }
  5665. if (this.isClosing()) {
  5666. this.adapter_.removeClass(OPEN);
  5667. this.closed();
  5668. this.adapter_.restoreFocus();
  5669. this.adapter_.notifyClose();
  5670. } else {
  5671. this.adapter_.focusActiveNavigationItem();
  5672. this.opened();
  5673. this.adapter_.notifyOpen();
  5674. }
  5675. this.adapter_.removeClass(ANIMATE);
  5676. this.adapter_.removeClass(OPENING);
  5677. this.adapter_.removeClass(CLOSING);
  5678. }
  5679. /**
  5680. * Runs the given logic on the next animation frame, using setTimeout to factor in Firefox reflow behavior.
  5681. * @param {Function} callback
  5682. * @private
  5683. */
  5684. }, {
  5685. key: 'runNextAnimationFrame_',
  5686. value: function runNextAnimationFrame_(callback) {
  5687. var _this3 = this;
  5688. cancelAnimationFrame(this.animationFrame_);
  5689. this.animationFrame_ = requestAnimationFrame(function () {
  5690. _this3.animationFrame_ = 0;
  5691. clearTimeout(_this3.animationTimer_);
  5692. _this3.animationTimer_ = setTimeout(callback, 0);
  5693. });
  5694. }
  5695. }]);
  5696. return MDCDismissibleDrawerFoundation;
  5697. }(__WEBPACK_IMPORTED_MODULE_1__material_base_foundation__["a" /* default */]);
  5698. /* harmony default export */ __webpack_exports__["a"] = (MDCDismissibleDrawerFoundation);
  5699. /***/ }),
  5700. /* 36 */
  5701. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5702. "use strict";
  5703. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  5704. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5705. /**
  5706. * @license
  5707. * Copyright 2018 Google Inc.
  5708. *
  5709. * Permission is hereby granted, free of charge, to any person obtaining a copy
  5710. * of this software and associated documentation files (the "Software"), to deal
  5711. * in the Software without restriction, including without limitation the rights
  5712. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  5713. * copies of the Software, and to permit persons to whom the Software is
  5714. * furnished to do so, subject to the following conditions:
  5715. *
  5716. * The above copyright notice and this permission notice shall be included in
  5717. * all copies or substantial portions of the Software.
  5718. *
  5719. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  5720. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  5721. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  5722. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  5723. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  5724. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  5725. * THE SOFTWARE.
  5726. */
  5727. /* eslint no-unused-vars: [2, {"args": "none"}] */
  5728. /**
  5729. * Adapter for MDC Drawer
  5730. *
  5731. * Defines the shape of the adapter expected by the foundation. Implement this
  5732. * adapter to integrate the Drawer into your framework. See
  5733. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  5734. * for more information.
  5735. *
  5736. * @record
  5737. */
  5738. var MDCDrawerAdapter = function () {
  5739. function MDCDrawerAdapter() {
  5740. _classCallCheck(this, MDCDrawerAdapter);
  5741. }
  5742. _createClass(MDCDrawerAdapter, [{
  5743. key: "addClass",
  5744. /**
  5745. * Adds a class to the root Element.
  5746. * @param {string} className
  5747. */
  5748. value: function addClass(className) {}
  5749. /**
  5750. * Removes a class from the root Element.
  5751. * @param {string} className
  5752. */
  5753. }, {
  5754. key: "removeClass",
  5755. value: function removeClass(className) {}
  5756. /**
  5757. * Returns true if the root Element contains the given class.
  5758. * @param {string} className
  5759. * @return {boolean}
  5760. */
  5761. }, {
  5762. key: "hasClass",
  5763. value: function hasClass(className) {}
  5764. /**
  5765. * @param {!Element} element target element to verify class name
  5766. * @param {string} className class name
  5767. */
  5768. }, {
  5769. key: "elementHasClass",
  5770. value: function elementHasClass(element, className) {}
  5771. /**
  5772. * Saves the focus of currently active element.
  5773. */
  5774. }, {
  5775. key: "saveFocus",
  5776. value: function saveFocus() {}
  5777. /**
  5778. * Restores focus to element previously saved with 'saveFocus'.
  5779. */
  5780. }, {
  5781. key: "restoreFocus",
  5782. value: function restoreFocus() {}
  5783. /**
  5784. * Focuses the active / selected navigation item.
  5785. */
  5786. }, {
  5787. key: "focusActiveNavigationItem",
  5788. value: function focusActiveNavigationItem() {}
  5789. /**
  5790. * Emits a custom event "MDCDrawer:closed" denoting the drawer has closed.
  5791. */
  5792. }, {
  5793. key: "notifyClose",
  5794. value: function notifyClose() {}
  5795. /**
  5796. * Emits a custom event "MDCDrawer:opened" denoting the drawer has opened.
  5797. */
  5798. }, {
  5799. key: "notifyOpen",
  5800. value: function notifyOpen() {}
  5801. /**
  5802. * Traps focus on root element and focuses the active navigation element.
  5803. */
  5804. }, {
  5805. key: "trapFocus",
  5806. value: function trapFocus() {}
  5807. /**
  5808. * Releases focus trap from root element which was set by `trapFocus`
  5809. * and restores focus to where it was prior to calling `trapFocus`.
  5810. */
  5811. }, {
  5812. key: "releaseFocus",
  5813. value: function releaseFocus() {}
  5814. }]);
  5815. return MDCDrawerAdapter;
  5816. }();
  5817. /* unused harmony default export */ var _unused_webpack_default_export = (MDCDrawerAdapter);
  5818. /***/ }),
  5819. /* 37 */
  5820. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5821. "use strict";
  5822. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  5823. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  5824. /**
  5825. * @license
  5826. * Copyright 2016 Google Inc.
  5827. *
  5828. * Permission is hereby granted, free of charge, to any person obtaining a copy
  5829. * of this software and associated documentation files (the "Software"), to deal
  5830. * in the Software without restriction, including without limitation the rights
  5831. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  5832. * copies of the Software, and to permit persons to whom the Software is
  5833. * furnished to do so, subject to the following conditions:
  5834. *
  5835. * The above copyright notice and this permission notice shall be included in
  5836. * all copies or substantial portions of the Software.
  5837. *
  5838. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  5839. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  5840. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  5841. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  5842. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  5843. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  5844. * THE SOFTWARE.
  5845. */
  5846. /** @enum {string} */
  5847. var cssClasses = {
  5848. ROOT: 'mdc-drawer',
  5849. DISMISSIBLE: 'mdc-drawer--dismissible',
  5850. MODAL: 'mdc-drawer--modal',
  5851. OPEN: 'mdc-drawer--open',
  5852. ANIMATE: 'mdc-drawer--animate',
  5853. OPENING: 'mdc-drawer--opening',
  5854. CLOSING: 'mdc-drawer--closing'
  5855. };
  5856. /** @enum {string} */
  5857. var strings = {
  5858. APP_CONTENT_SELECTOR: '.mdc-drawer-app-content',
  5859. SCRIM_SELECTOR: '.mdc-drawer-scrim',
  5860. CLOSE_EVENT: 'MDCDrawer:closed',
  5861. OPEN_EVENT: 'MDCDrawer:opened'
  5862. };
  5863. /***/ }),
  5864. /* 38 */
  5865. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5866. "use strict";
  5867. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  5868. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5869. /**
  5870. * @license
  5871. * Copyright 2018 Google Inc.
  5872. *
  5873. * Permission is hereby granted, free of charge, to any person obtaining a copy
  5874. * of this software and associated documentation files (the "Software"), to deal
  5875. * in the Software without restriction, including without limitation the rights
  5876. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  5877. * copies of the Software, and to permit persons to whom the Software is
  5878. * furnished to do so, subject to the following conditions:
  5879. *
  5880. * The above copyright notice and this permission notice shall be included in
  5881. * all copies or substantial portions of the Software.
  5882. *
  5883. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  5884. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  5885. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  5886. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  5887. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  5888. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  5889. * THE SOFTWARE.
  5890. */
  5891. /* eslint no-unused-vars: [2, {"args": "none"}] */
  5892. /**
  5893. * Adapter for MDC List. Provides an interface for managing focus.
  5894. *
  5895. * Additionally, provides type information for the adapter to the Closure
  5896. * compiler.
  5897. *
  5898. * Implement this adapter for your framework of choice to delegate updates to
  5899. * the component in your framework of choice. See architecture documentation
  5900. * for more details.
  5901. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  5902. *
  5903. * @record
  5904. */
  5905. var MDCListAdapter = function () {
  5906. function MDCListAdapter() {
  5907. _classCallCheck(this, MDCListAdapter);
  5908. }
  5909. _createClass(MDCListAdapter, [{
  5910. key: "getListItemCount",
  5911. /** @return {number} */
  5912. value: function getListItemCount() {}
  5913. /**
  5914. * @return {number} */
  5915. }, {
  5916. key: "getFocusedElementIndex",
  5917. value: function getFocusedElementIndex() {}
  5918. /**
  5919. * @param {number} index
  5920. * @param {string} attribute
  5921. * @param {string} value
  5922. */
  5923. }, {
  5924. key: "setAttributeForElementIndex",
  5925. value: function setAttributeForElementIndex(index, attribute, value) {}
  5926. /**
  5927. * @param {number} index
  5928. * @param {string} attribute
  5929. */
  5930. }, {
  5931. key: "removeAttributeForElementIndex",
  5932. value: function removeAttributeForElementIndex(index, attribute) {}
  5933. /**
  5934. * @param {number} index
  5935. * @param {string} className
  5936. */
  5937. }, {
  5938. key: "addClassForElementIndex",
  5939. value: function addClassForElementIndex(index, className) {}
  5940. /**
  5941. * @param {number} index
  5942. * @param {string} className
  5943. */
  5944. }, {
  5945. key: "removeClassForElementIndex",
  5946. value: function removeClassForElementIndex(index, className) {}
  5947. /**
  5948. * Focuses list item at the index specified.
  5949. * @param {number} index
  5950. */
  5951. }, {
  5952. key: "focusItemAtIndex",
  5953. value: function focusItemAtIndex(index) {}
  5954. /**
  5955. * Sets the tabindex to the value specified for all button/a element children of
  5956. * the list item at the index specified.
  5957. * @param {number} listItemIndex
  5958. * @param {number} tabIndexValue
  5959. */
  5960. }, {
  5961. key: "setTabIndexForListItemChildren",
  5962. value: function setTabIndexForListItemChildren(listItemIndex, tabIndexValue) {}
  5963. /**
  5964. * @param {number} index
  5965. * @return {boolean} Returns true if radio button is present at given list item index.
  5966. */
  5967. }, {
  5968. key: "hasRadioAtIndex",
  5969. value: function hasRadioAtIndex(index) {}
  5970. /**
  5971. * @param {number} index
  5972. * @return {boolean} Returns true if checkbox is present at given list item index.
  5973. */
  5974. }, {
  5975. key: "hasCheckboxAtIndex",
  5976. value: function hasCheckboxAtIndex(index) {}
  5977. /**
  5978. * @param {number} index
  5979. * @return {boolean} Returns true if checkbox inside a list item is checked.
  5980. */
  5981. }, {
  5982. key: "isCheckboxCheckedAtIndex",
  5983. value: function isCheckboxCheckedAtIndex(index) {}
  5984. /**
  5985. * Sets the checked status of checkbox or radio at given list item index.
  5986. * @param {number} index
  5987. * @param {boolean} isChecked
  5988. */
  5989. }, {
  5990. key: "setCheckedCheckboxOrRadioAtIndex",
  5991. value: function setCheckedCheckboxOrRadioAtIndex(index, isChecked) {}
  5992. /**
  5993. * Notifies user action on list item.
  5994. */
  5995. }, {
  5996. key: "notifyAction",
  5997. value: function notifyAction(index) {}
  5998. /**
  5999. * @return {boolean} Returns true when the current focused element is inside list root.
  6000. */
  6001. }, {
  6002. key: "isFocusInsideList",
  6003. value: function isFocusInsideList() {}
  6004. }]);
  6005. return MDCListAdapter;
  6006. }();
  6007. /* unused harmony default export */ var _unused_webpack_default_export = (MDCListAdapter);
  6008. /***/ }),
  6009. /* 39 */
  6010. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6011. "use strict";
  6012. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  6013. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  6014. /* unused harmony export Index */
  6015. /**
  6016. * @license
  6017. * Copyright 2018 Google Inc.
  6018. *
  6019. * Permission is hereby granted, free of charge, to any person obtaining a copy
  6020. * of this software and associated documentation files (the "Software"), to deal
  6021. * in the Software without restriction, including without limitation the rights
  6022. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  6023. * copies of the Software, and to permit persons to whom the Software is
  6024. * furnished to do so, subject to the following conditions:
  6025. *
  6026. * The above copyright notice and this permission notice shall be included in
  6027. * all copies or substantial portions of the Software.
  6028. *
  6029. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  6030. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  6031. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  6032. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  6033. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  6034. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  6035. * THE SOFTWARE.
  6036. */
  6037. /** @enum {string} */
  6038. var cssClasses = {
  6039. ROOT: 'mdc-list',
  6040. LIST_ITEM_CLASS: 'mdc-list-item',
  6041. LIST_ITEM_SELECTED_CLASS: 'mdc-list-item--selected',
  6042. LIST_ITEM_ACTIVATED_CLASS: 'mdc-list-item--activated'
  6043. };
  6044. /** @enum {string} */
  6045. var strings = {
  6046. ARIA_ORIENTATION: 'aria-orientation',
  6047. ARIA_ORIENTATION_HORIZONTAL: 'horizontal',
  6048. ARIA_SELECTED: 'aria-selected',
  6049. ARIA_CHECKED: 'aria-checked',
  6050. ARIA_CHECKED_RADIO_SELECTOR: '[role="radio"][aria-checked="true"]',
  6051. ARIA_ROLE_CHECKBOX_SELECTOR: '[role="checkbox"]',
  6052. ARIA_CHECKED_CHECKBOX_SELECTOR: '[role="checkbox"][aria-checked="true"]',
  6053. RADIO_SELECTOR: 'input[type="radio"]:not(:disabled)',
  6054. CHECKBOX_SELECTOR: 'input[type="checkbox"]:not(:disabled)',
  6055. CHECKBOX_RADIO_SELECTOR: 'input[type="checkbox"]:not(:disabled), input[type="radio"]:not(:disabled)',
  6056. CHILD_ELEMENTS_TO_TOGGLE_TABINDEX: '.' + cssClasses.LIST_ITEM_CLASS + ' button:not(:disabled),\n .' + cssClasses.LIST_ITEM_CLASS + ' a',
  6057. FOCUSABLE_CHILD_ELEMENTS: '.' + cssClasses.LIST_ITEM_CLASS + ' button:not(:disabled), .' + 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)',
  6058. ENABLED_ITEMS_SELECTOR: '.mdc-list-item:not(.mdc-list-item--disabled)',
  6059. ACTION_EVENT: 'MDCList:action'
  6060. };
  6061. /** @typedef {number|!Array<number>} */
  6062. var Index = void 0;
  6063. /***/ }),
  6064. /* 40 */
  6065. /***/ (function(module, exports, __webpack_require__) {
  6066. var tabbable = __webpack_require__(89);
  6067. var xtend = __webpack_require__(90);
  6068. var activeFocusTraps = (function() {
  6069. var trapQueue = [];
  6070. return {
  6071. activateTrap: function(trap) {
  6072. if (trapQueue.length > 0) {
  6073. var activeTrap = trapQueue[trapQueue.length - 1];
  6074. if (activeTrap !== trap) {
  6075. activeTrap.pause();
  6076. }
  6077. }
  6078. var trapIndex = trapQueue.indexOf(trap);
  6079. if (trapIndex === -1) {
  6080. trapQueue.push(trap);
  6081. } else {
  6082. // move this existing trap to the front of the queue
  6083. trapQueue.splice(trapIndex, 1);
  6084. trapQueue.push(trap);
  6085. }
  6086. },
  6087. deactivateTrap: function(trap) {
  6088. var trapIndex = trapQueue.indexOf(trap);
  6089. if (trapIndex !== -1) {
  6090. trapQueue.splice(trapIndex, 1);
  6091. }
  6092. if (trapQueue.length > 0) {
  6093. trapQueue[trapQueue.length - 1].unpause();
  6094. }
  6095. }
  6096. };
  6097. })();
  6098. function focusTrap(element, userOptions) {
  6099. var doc = document;
  6100. var container =
  6101. typeof element === 'string' ? doc.querySelector(element) : element;
  6102. var config = xtend(
  6103. {
  6104. returnFocusOnDeactivate: true,
  6105. escapeDeactivates: true
  6106. },
  6107. userOptions
  6108. );
  6109. var state = {
  6110. firstTabbableNode: null,
  6111. lastTabbableNode: null,
  6112. nodeFocusedBeforeActivation: null,
  6113. mostRecentlyFocusedNode: null,
  6114. active: false,
  6115. paused: false
  6116. };
  6117. var trap = {
  6118. activate: activate,
  6119. deactivate: deactivate,
  6120. pause: pause,
  6121. unpause: unpause
  6122. };
  6123. return trap;
  6124. function activate(activateOptions) {
  6125. if (state.active) return;
  6126. updateTabbableNodes();
  6127. state.active = true;
  6128. state.paused = false;
  6129. state.nodeFocusedBeforeActivation = doc.activeElement;
  6130. var onActivate =
  6131. activateOptions && activateOptions.onActivate
  6132. ? activateOptions.onActivate
  6133. : config.onActivate;
  6134. if (onActivate) {
  6135. onActivate();
  6136. }
  6137. addListeners();
  6138. return trap;
  6139. }
  6140. function deactivate(deactivateOptions) {
  6141. if (!state.active) return;
  6142. removeListeners();
  6143. state.active = false;
  6144. state.paused = false;
  6145. activeFocusTraps.deactivateTrap(trap);
  6146. var onDeactivate =
  6147. deactivateOptions && deactivateOptions.onDeactivate !== undefined
  6148. ? deactivateOptions.onDeactivate
  6149. : config.onDeactivate;
  6150. if (onDeactivate) {
  6151. onDeactivate();
  6152. }
  6153. var returnFocus =
  6154. deactivateOptions && deactivateOptions.returnFocus !== undefined
  6155. ? deactivateOptions.returnFocus
  6156. : config.returnFocusOnDeactivate;
  6157. if (returnFocus) {
  6158. delay(function() {
  6159. tryFocus(state.nodeFocusedBeforeActivation);
  6160. });
  6161. }
  6162. return trap;
  6163. }
  6164. function pause() {
  6165. if (state.paused || !state.active) return;
  6166. state.paused = true;
  6167. removeListeners();
  6168. }
  6169. function unpause() {
  6170. if (!state.paused || !state.active) return;
  6171. state.paused = false;
  6172. addListeners();
  6173. }
  6174. function addListeners() {
  6175. if (!state.active) return;
  6176. // There can be only one listening focus trap at a time
  6177. activeFocusTraps.activateTrap(trap);
  6178. updateTabbableNodes();
  6179. // Delay ensures that the focused element doesn't capture the event
  6180. // that caused the focus trap activation.
  6181. delay(function() {
  6182. tryFocus(getInitialFocusNode());
  6183. });
  6184. doc.addEventListener('focusin', checkFocusIn, true);
  6185. doc.addEventListener('mousedown', checkPointerDown, true);
  6186. doc.addEventListener('touchstart', checkPointerDown, true);
  6187. doc.addEventListener('click', checkClick, true);
  6188. doc.addEventListener('keydown', checkKey, true);
  6189. return trap;
  6190. }
  6191. function removeListeners() {
  6192. if (!state.active) return;
  6193. doc.removeEventListener('focusin', checkFocusIn, true);
  6194. doc.removeEventListener('mousedown', checkPointerDown, true);
  6195. doc.removeEventListener('touchstart', checkPointerDown, true);
  6196. doc.removeEventListener('click', checkClick, true);
  6197. doc.removeEventListener('keydown', checkKey, true);
  6198. return trap;
  6199. }
  6200. function getNodeForOption(optionName) {
  6201. var optionValue = config[optionName];
  6202. var node = optionValue;
  6203. if (!optionValue) {
  6204. return null;
  6205. }
  6206. if (typeof optionValue === 'string') {
  6207. node = doc.querySelector(optionValue);
  6208. if (!node) {
  6209. throw new Error('`' + optionName + '` refers to no known node');
  6210. }
  6211. }
  6212. if (typeof optionValue === 'function') {
  6213. node = optionValue();
  6214. if (!node) {
  6215. throw new Error('`' + optionName + '` did not return a node');
  6216. }
  6217. }
  6218. return node;
  6219. }
  6220. function getInitialFocusNode() {
  6221. var node;
  6222. if (getNodeForOption('initialFocus') !== null) {
  6223. node = getNodeForOption('initialFocus');
  6224. } else if (container.contains(doc.activeElement)) {
  6225. node = doc.activeElement;
  6226. } else {
  6227. node = state.firstTabbableNode || getNodeForOption('fallbackFocus');
  6228. }
  6229. if (!node) {
  6230. throw new Error(
  6231. "You can't have a focus-trap without at least one focusable element"
  6232. );
  6233. }
  6234. return node;
  6235. }
  6236. // This needs to be done on mousedown and touchstart instead of click
  6237. // so that it precedes the focus event.
  6238. function checkPointerDown(e) {
  6239. if (container.contains(e.target)) return;
  6240. if (config.clickOutsideDeactivates) {
  6241. deactivate({
  6242. returnFocus: !tabbable.isFocusable(e.target)
  6243. });
  6244. } else {
  6245. e.preventDefault();
  6246. }
  6247. }
  6248. // In case focus escapes the trap for some strange reason, pull it back in.
  6249. function checkFocusIn(e) {
  6250. // In Firefox when you Tab out of an iframe the Document is briefly focused.
  6251. if (container.contains(e.target) || e.target instanceof Document) {
  6252. return;
  6253. }
  6254. e.stopImmediatePropagation();
  6255. tryFocus(state.mostRecentlyFocusedNode || getInitialFocusNode());
  6256. }
  6257. function checkKey(e) {
  6258. if (config.escapeDeactivates !== false && isEscapeEvent(e)) {
  6259. e.preventDefault();
  6260. deactivate();
  6261. return;
  6262. }
  6263. if (isTabEvent(e)) {
  6264. checkTab(e);
  6265. return;
  6266. }
  6267. }
  6268. // Hijack Tab events on the first and last focusable nodes of the trap,
  6269. // in order to prevent focus from escaping. If it escapes for even a
  6270. // moment it can end up scrolling the page and causing confusion so we
  6271. // kind of need to capture the action at the keydown phase.
  6272. function checkTab(e) {
  6273. updateTabbableNodes();
  6274. if (e.shiftKey && e.target === state.firstTabbableNode) {
  6275. e.preventDefault();
  6276. tryFocus(state.lastTabbableNode);
  6277. return;
  6278. }
  6279. if (!e.shiftKey && e.target === state.lastTabbableNode) {
  6280. e.preventDefault();
  6281. tryFocus(state.firstTabbableNode);
  6282. return;
  6283. }
  6284. }
  6285. function checkClick(e) {
  6286. if (config.clickOutsideDeactivates) return;
  6287. if (container.contains(e.target)) return;
  6288. e.preventDefault();
  6289. e.stopImmediatePropagation();
  6290. }
  6291. function updateTabbableNodes() {
  6292. var tabbableNodes = tabbable(container);
  6293. state.firstTabbableNode = tabbableNodes[0] || getInitialFocusNode();
  6294. state.lastTabbableNode =
  6295. tabbableNodes[tabbableNodes.length - 1] || getInitialFocusNode();
  6296. }
  6297. function tryFocus(node) {
  6298. if (node === doc.activeElement) return;
  6299. if (!node || !node.focus) {
  6300. tryFocus(getInitialFocusNode());
  6301. return;
  6302. }
  6303. node.focus();
  6304. state.mostRecentlyFocusedNode = node;
  6305. if (isSelectableInput(node)) {
  6306. node.select();
  6307. }
  6308. }
  6309. }
  6310. function isSelectableInput(node) {
  6311. return (
  6312. node.tagName &&
  6313. node.tagName.toLowerCase() === 'input' &&
  6314. typeof node.select === 'function'
  6315. );
  6316. }
  6317. function isEscapeEvent(e) {
  6318. return e.key === 'Escape' || e.key === 'Esc' || e.keyCode === 27;
  6319. }
  6320. function isTabEvent(e) {
  6321. return e.key === 'Tab' || e.keyCode === 9;
  6322. }
  6323. function delay(fn) {
  6324. return setTimeout(fn, 0);
  6325. }
  6326. module.exports = focusTrap;
  6327. /***/ }),
  6328. /* 41 */
  6329. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6330. "use strict";
  6331. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  6332. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6333. /**
  6334. * @license
  6335. * Copyright 2017 Google Inc.
  6336. *
  6337. * Permission is hereby granted, free of charge, to any person obtaining a copy
  6338. * of this software and associated documentation files (the "Software"), to deal
  6339. * in the Software without restriction, including without limitation the rights
  6340. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  6341. * copies of the Software, and to permit persons to whom the Software is
  6342. * furnished to do so, subject to the following conditions:
  6343. *
  6344. * The above copyright notice and this permission notice shall be included in
  6345. * all copies or substantial portions of the Software.
  6346. *
  6347. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  6348. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  6349. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  6350. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  6351. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  6352. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  6353. * THE SOFTWARE.
  6354. */
  6355. /* eslint no-unused-vars: [2, {"args": "none"}] */
  6356. /**
  6357. * Adapter for MDC Floating Label.
  6358. *
  6359. * Defines the shape of the adapter expected by the foundation. Implement this
  6360. * adapter to integrate the floating label into your framework. See
  6361. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  6362. * for more information.
  6363. *
  6364. * @record
  6365. */
  6366. var MDCFloatingLabelAdapter = function () {
  6367. function MDCFloatingLabelAdapter() {
  6368. _classCallCheck(this, MDCFloatingLabelAdapter);
  6369. }
  6370. _createClass(MDCFloatingLabelAdapter, [{
  6371. key: "addClass",
  6372. /**
  6373. * Adds a class to the label element.
  6374. * @param {string} className
  6375. */
  6376. value: function addClass(className) {}
  6377. /**
  6378. * Removes a class from the label element.
  6379. * @param {string} className
  6380. */
  6381. }, {
  6382. key: "removeClass",
  6383. value: function removeClass(className) {}
  6384. /**
  6385. * Returns the width of the label element.
  6386. * @return {number}
  6387. */
  6388. }, {
  6389. key: "getWidth",
  6390. value: function getWidth() {}
  6391. /**
  6392. * Registers an event listener on the root element for a given event.
  6393. * @param {string} evtType
  6394. * @param {function(!Event): undefined} handler
  6395. */
  6396. }, {
  6397. key: "registerInteractionHandler",
  6398. value: function registerInteractionHandler(evtType, handler) {}
  6399. /**
  6400. * Deregisters an event listener on the root element for a given event.
  6401. * @param {string} evtType
  6402. * @param {function(!Event): undefined} handler
  6403. */
  6404. }, {
  6405. key: "deregisterInteractionHandler",
  6406. value: function deregisterInteractionHandler(evtType, handler) {}
  6407. }]);
  6408. return MDCFloatingLabelAdapter;
  6409. }();
  6410. /* unused harmony default export */ var _unused_webpack_default_export = (MDCFloatingLabelAdapter);
  6411. /***/ }),
  6412. /* 42 */
  6413. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6414. "use strict";
  6415. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  6416. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6417. /**
  6418. * @license
  6419. * Copyright 2018 Google Inc.
  6420. *
  6421. * Permission is hereby granted, free of charge, to any person obtaining a copy
  6422. * of this software and associated documentation files (the "Software"), to deal
  6423. * in the Software without restriction, including without limitation the rights
  6424. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  6425. * copies of the Software, and to permit persons to whom the Software is
  6426. * furnished to do so, subject to the following conditions:
  6427. *
  6428. * The above copyright notice and this permission notice shall be included in
  6429. * all copies or substantial portions of the Software.
  6430. *
  6431. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  6432. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  6433. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  6434. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  6435. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  6436. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  6437. * THE SOFTWARE.
  6438. */
  6439. /* eslint no-unused-vars: [2, {"args": "none"}] */
  6440. /**
  6441. * Adapter for MDC TextField Line Ripple.
  6442. *
  6443. * Defines the shape of the adapter expected by the foundation. Implement this
  6444. * adapter to integrate the line ripple into your framework. See
  6445. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  6446. * for more information.
  6447. *
  6448. * @record
  6449. */
  6450. var MDCLineRippleAdapter = function () {
  6451. function MDCLineRippleAdapter() {
  6452. _classCallCheck(this, MDCLineRippleAdapter);
  6453. }
  6454. _createClass(MDCLineRippleAdapter, [{
  6455. key: "addClass",
  6456. /**
  6457. * Adds a class to the line ripple element.
  6458. * @param {string} className
  6459. */
  6460. value: function addClass(className) {}
  6461. /**
  6462. * Removes a class from the line ripple element.
  6463. * @param {string} className
  6464. */
  6465. }, {
  6466. key: "removeClass",
  6467. value: function removeClass(className) {}
  6468. /**
  6469. * @param {string} className
  6470. * @return {boolean}
  6471. */
  6472. }, {
  6473. key: "hasClass",
  6474. value: function hasClass(className) {}
  6475. /**
  6476. * Sets the style property with propertyName to value on the root element.
  6477. * @param {string} propertyName
  6478. * @param {string} value
  6479. */
  6480. }, {
  6481. key: "setStyle",
  6482. value: function setStyle(propertyName, value) {}
  6483. /**
  6484. * Registers an event listener on the line ripple element for a given event.
  6485. * @param {string} evtType
  6486. * @param {function(!Event): undefined} handler
  6487. */
  6488. }, {
  6489. key: "registerEventHandler",
  6490. value: function registerEventHandler(evtType, handler) {}
  6491. /**
  6492. * Deregisters an event listener on the line ripple element for a given event.
  6493. * @param {string} evtType
  6494. * @param {function(!Event): undefined} handler
  6495. */
  6496. }, {
  6497. key: "deregisterEventHandler",
  6498. value: function deregisterEventHandler(evtType, handler) {}
  6499. }]);
  6500. return MDCLineRippleAdapter;
  6501. }();
  6502. /* unused harmony default export */ var _unused_webpack_default_export = (MDCLineRippleAdapter);
  6503. /***/ }),
  6504. /* 43 */
  6505. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6506. "use strict";
  6507. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  6508. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCMenu", function() { return MDCMenu; });
  6509. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  6510. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(113);
  6511. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(17);
  6512. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_menu_surface_index__ = __webpack_require__(45);
  6513. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__material_menu_surface_foundation__ = __webpack_require__(18);
  6514. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__material_list_index__ = __webpack_require__(14);
  6515. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCMenuFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__foundation__["a"]; });
  6516. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "AnchorMargin", function() { return __WEBPACK_IMPORTED_MODULE_4__material_menu_surface_foundation__["a"]; });
  6517. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Corner", function() { return __WEBPACK_IMPORTED_MODULE_3__material_menu_surface_index__["Corner"]; });
  6518. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  6519. var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
  6520. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6521. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  6522. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  6523. /**
  6524. * @license
  6525. * Copyright 2018 Google Inc.
  6526. *
  6527. * Permission is hereby granted, free of charge, to any person obtaining a copy
  6528. * of this software and associated documentation files (the "Software"), to deal
  6529. * in the Software without restriction, including without limitation the rights
  6530. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  6531. * copies of the Software, and to permit persons to whom the Software is
  6532. * furnished to do so, subject to the following conditions:
  6533. *
  6534. * The above copyright notice and this permission notice shall be included in
  6535. * all copies or substantial portions of the Software.
  6536. *
  6537. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  6538. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  6539. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  6540. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  6541. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  6542. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  6543. * THE SOFTWARE.
  6544. */
  6545. /**
  6546. * @extends MDCComponent<!MDCMenuFoundation>
  6547. */
  6548. var MDCMenu = function (_MDCComponent) {
  6549. _inherits(MDCMenu, _MDCComponent);
  6550. /** @param {...?} args */
  6551. function MDCMenu() {
  6552. var _ref;
  6553. _classCallCheck(this, MDCMenu);
  6554. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  6555. args[_key] = arguments[_key];
  6556. }
  6557. /** @private {!MDCMenuSurface} */
  6558. var _this = _possibleConstructorReturn(this, (_ref = MDCMenu.__proto__ || Object.getPrototypeOf(MDCMenu)).call.apply(_ref, [this].concat(args)));
  6559. _this.menuSurface_;
  6560. /** @private {!MDCList} */
  6561. _this.list_;
  6562. /** @private {!Function} */
  6563. _this.handleKeydown_;
  6564. /** @private {!Function} */
  6565. _this.handleItemAction_;
  6566. /** @private {!Function} */
  6567. _this.afterOpenedCallback_;
  6568. return _this;
  6569. }
  6570. /**
  6571. * @param {!HTMLElement} root
  6572. * @return {!MDCMenu}
  6573. */
  6574. _createClass(MDCMenu, [{
  6575. key: 'initialize',
  6576. value: function initialize() {
  6577. var menuSurfaceFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (el) {
  6578. return new __WEBPACK_IMPORTED_MODULE_3__material_menu_surface_index__["MDCMenuSurface"](el);
  6579. };
  6580. var listFactory = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (el) {
  6581. return new __WEBPACK_IMPORTED_MODULE_5__material_list_index__["MDCList"](el);
  6582. };
  6583. this.menuSurface_ = menuSurfaceFactory(this.root_);
  6584. var list = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].LIST_SELECTOR);
  6585. if (list) {
  6586. this.list_ = listFactory(list);
  6587. this.list_.wrapFocus = true;
  6588. }
  6589. }
  6590. }, {
  6591. key: 'initialSyncWithDOM',
  6592. value: function initialSyncWithDOM() {
  6593. var _this2 = this;
  6594. this.afterOpenedCallback_ = function () {
  6595. return _this2.handleAfterOpened_();
  6596. };
  6597. this.handleKeydown_ = function (evt) {
  6598. return _this2.foundation_.handleKeydown(evt);
  6599. };
  6600. this.handleItemAction_ = function (evt) {
  6601. return _this2.foundation_.handleItemAction(_this2.items[evt.detail]);
  6602. };
  6603. this.menuSurface_.listen(__WEBPACK_IMPORTED_MODULE_4__material_menu_surface_foundation__["b" /* MDCMenuSurfaceFoundation */].strings.OPENED_EVENT, this.afterOpenedCallback_);
  6604. this.listen('keydown', this.handleKeydown_);
  6605. this.listen(__WEBPACK_IMPORTED_MODULE_5__material_list_index__["MDCListFoundation"].strings.ACTION_EVENT, this.handleItemAction_);
  6606. }
  6607. }, {
  6608. key: 'destroy',
  6609. value: function destroy() {
  6610. if (this.list_) {
  6611. this.list_.destroy();
  6612. }
  6613. this.menuSurface_.destroy();
  6614. this.menuSurface_.unlisten(__WEBPACK_IMPORTED_MODULE_4__material_menu_surface_foundation__["b" /* MDCMenuSurfaceFoundation */].strings.OPENED_EVENT, this.afterOpenedCallback_);
  6615. this.unlisten('keydown', this.handleKeydown_);
  6616. this.unlisten(__WEBPACK_IMPORTED_MODULE_5__material_list_index__["MDCListFoundation"].strings.ACTION_EVENT, this.handleItemAction_);
  6617. _get(MDCMenu.prototype.__proto__ || Object.getPrototypeOf(MDCMenu.prototype), 'destroy', this).call(this);
  6618. }
  6619. /** @return {boolean} */
  6620. }, {
  6621. key: 'setAnchorCorner',
  6622. /**
  6623. * @param {!Corner} corner Default anchor corner alignment of top-left
  6624. * menu corner.
  6625. */
  6626. value: function setAnchorCorner(corner) {
  6627. this.menuSurface_.setAnchorCorner(corner);
  6628. }
  6629. /**
  6630. * @param {!AnchorMargin} margin
  6631. */
  6632. }, {
  6633. key: 'setAnchorMargin',
  6634. value: function setAnchorMargin(margin) {
  6635. this.menuSurface_.setAnchorMargin(margin);
  6636. }
  6637. /**
  6638. * Return the items within the menu. Note that this only contains the set of elements within
  6639. * the items container that are proper list items, and not supplemental / presentational DOM
  6640. * elements.
  6641. * @return {!Array<!HTMLElement>}
  6642. */
  6643. }, {
  6644. key: 'getOptionByIndex',
  6645. /**
  6646. * Return the item within the menu at the index specified.
  6647. * @param {number} index
  6648. * @return {?HTMLElement}
  6649. */
  6650. value: function getOptionByIndex(index) {
  6651. var items = this.items;
  6652. if (index < items.length) {
  6653. return this.items[index];
  6654. } else {
  6655. return null;
  6656. }
  6657. }
  6658. /** @param {boolean} quickOpen */
  6659. }, {
  6660. key: 'setFixedPosition',
  6661. /** @param {boolean} isFixed */
  6662. value: function setFixedPosition(isFixed) {
  6663. this.menuSurface_.setFixedPosition(isFixed);
  6664. }
  6665. }, {
  6666. key: 'hoistMenuToBody',
  6667. value: function hoistMenuToBody() {
  6668. this.menuSurface_.hoistMenuToBody();
  6669. }
  6670. /** @param {boolean} isHoisted */
  6671. }, {
  6672. key: 'setIsHoisted',
  6673. value: function setIsHoisted(isHoisted) {
  6674. this.menuSurface_.setIsHoisted(isHoisted);
  6675. }
  6676. /**
  6677. * @param {number} x
  6678. * @param {number} y
  6679. */
  6680. }, {
  6681. key: 'setAbsolutePosition',
  6682. value: function setAbsolutePosition(x, y) {
  6683. this.menuSurface_.setAbsolutePosition(x, y);
  6684. }
  6685. /**
  6686. * Sets the element that the menu-surface is anchored to.
  6687. * @param {!HTMLElement} element
  6688. */
  6689. }, {
  6690. key: 'setAnchorElement',
  6691. value: function setAnchorElement(element) {
  6692. this.menuSurface_.anchorElement = element;
  6693. }
  6694. }, {
  6695. key: 'handleAfterOpened_',
  6696. value: function handleAfterOpened_() {
  6697. var list = this.items;
  6698. if (list.length > 0) {
  6699. list[0].focus();
  6700. }
  6701. }
  6702. /** @return {!MDCMenuFoundation} */
  6703. }, {
  6704. key: 'getDefaultFoundation',
  6705. value: function getDefaultFoundation() {
  6706. var _this3 = this;
  6707. return new __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* MDCMenuFoundation */]({
  6708. addClassToElementAtIndex: function addClassToElementAtIndex(index, className) {
  6709. var list = _this3.items;
  6710. list[index].classList.add(className);
  6711. },
  6712. removeClassFromElementAtIndex: function removeClassFromElementAtIndex(index, className) {
  6713. var list = _this3.items;
  6714. list[index].classList.remove(className);
  6715. },
  6716. addAttributeToElementAtIndex: function addAttributeToElementAtIndex(index, attr, value) {
  6717. var list = _this3.items;
  6718. list[index].setAttribute(attr, value);
  6719. },
  6720. removeAttributeFromElementAtIndex: function removeAttributeFromElementAtIndex(index, attr) {
  6721. var list = _this3.items;
  6722. list[index].removeAttribute(attr);
  6723. },
  6724. elementContainsClass: function elementContainsClass(element, className) {
  6725. return element.classList.contains(className);
  6726. },
  6727. closeSurface: function closeSurface() {
  6728. return _this3.open = false;
  6729. },
  6730. getElementIndex: function getElementIndex(element) {
  6731. return _this3.items.indexOf(element);
  6732. },
  6733. getParentElement: function getParentElement(element) {
  6734. return element.parentElement;
  6735. },
  6736. getSelectedElementIndex: function getSelectedElementIndex(selectionGroup) {
  6737. return _this3.items.indexOf(selectionGroup.querySelector('.' + __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].MENU_SELECTED_LIST_ITEM));
  6738. },
  6739. notifySelected: function notifySelected(evtData) {
  6740. return _this3.emit(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].SELECTED_EVENT, {
  6741. index: evtData.index,
  6742. item: _this3.items[evtData.index]
  6743. });
  6744. }
  6745. });
  6746. }
  6747. }, {
  6748. key: 'open',
  6749. get: function get() {
  6750. return this.menuSurface_.open;
  6751. }
  6752. /** @param {boolean} value */
  6753. ,
  6754. set: function set(value) {
  6755. this.menuSurface_.open = value;
  6756. }
  6757. /** @return {boolean} */
  6758. }, {
  6759. key: 'wrapFocus',
  6760. get: function get() {
  6761. return this.list_.wrapFocus;
  6762. }
  6763. /** @param {boolean} value */
  6764. ,
  6765. set: function set(value) {
  6766. this.list_.wrapFocus = value;
  6767. }
  6768. }, {
  6769. key: 'items',
  6770. get: function get() {
  6771. return this.list_.listElements;
  6772. }
  6773. }, {
  6774. key: 'quickOpen',
  6775. set: function set(quickOpen) {
  6776. this.menuSurface_.quickOpen = quickOpen;
  6777. }
  6778. }], [{
  6779. key: 'attachTo',
  6780. value: function attachTo(root) {
  6781. return new MDCMenu(root);
  6782. }
  6783. }]);
  6784. return MDCMenu;
  6785. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  6786. /***/ }),
  6787. /* 44 */
  6788. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6789. "use strict";
  6790. /* unused harmony export MDCMenuSurfaceAdapter */
  6791. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  6792. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6793. /**
  6794. * @license
  6795. * Copyright 2018 Google Inc.
  6796. *
  6797. * Permission is hereby granted, free of charge, to any person obtaining a copy
  6798. * of this software and associated documentation files (the "Software"), to deal
  6799. * in the Software without restriction, including without limitation the rights
  6800. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  6801. * copies of the Software, and to permit persons to whom the Software is
  6802. * furnished to do so, subject to the following conditions:
  6803. *
  6804. * The above copyright notice and this permission notice shall be included in
  6805. * all copies or substantial portions of the Software.
  6806. *
  6807. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  6808. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  6809. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  6810. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  6811. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  6812. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  6813. * THE SOFTWARE.
  6814. */
  6815. /* eslint no-unused-vars: [2, {"args": "none"}] */
  6816. /**
  6817. * Adapter for MDCMenuSurface. Provides an interface for managing
  6818. * - classes
  6819. * - dom
  6820. * - focus
  6821. * - position
  6822. * - dimensions
  6823. * - event handlers
  6824. *
  6825. * Additionally, provides type information for the adapter to the Closure
  6826. * compiler.
  6827. *
  6828. * Implement this adapter for your framework of choice to delegate updates to
  6829. * the component in your framework of choice. See architecture documentation
  6830. * for more details.
  6831. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  6832. *
  6833. * @record
  6834. */
  6835. var MDCMenuSurfaceAdapter = function () {
  6836. function MDCMenuSurfaceAdapter() {
  6837. _classCallCheck(this, MDCMenuSurfaceAdapter);
  6838. }
  6839. _createClass(MDCMenuSurfaceAdapter, [{
  6840. key: "addClass",
  6841. /** @param {string} className */
  6842. value: function addClass(className) {}
  6843. /** @param {string} className */
  6844. }, {
  6845. key: "removeClass",
  6846. value: function removeClass(className) {}
  6847. /**
  6848. * @param {string} className
  6849. * @return {boolean}
  6850. */
  6851. }, {
  6852. key: "hasClass",
  6853. value: function hasClass(className) {}
  6854. /** @return {boolean} */
  6855. }, {
  6856. key: "hasAnchor",
  6857. value: function hasAnchor() {}
  6858. /** Emits an event when the menu surface is closed. */
  6859. }, {
  6860. key: "notifyClose",
  6861. value: function notifyClose() {}
  6862. /** Emits an event when the menu surface is opened. */
  6863. }, {
  6864. key: "notifyOpen",
  6865. value: function notifyOpen() {}
  6866. /**
  6867. * @return {boolean}
  6868. * @param {EventTarget} el
  6869. */
  6870. }, {
  6871. key: "isElementInContainer",
  6872. value: function isElementInContainer(el) {}
  6873. /** @return {boolean} */
  6874. }, {
  6875. key: "isRtl",
  6876. value: function isRtl() {}
  6877. /** @param {string} origin */
  6878. }, {
  6879. key: "setTransformOrigin",
  6880. value: function setTransformOrigin(origin) {}
  6881. /** @return {boolean} */
  6882. }, {
  6883. key: "isFocused",
  6884. value: function isFocused() {}
  6885. /** Saves the element that was focused before the menu surface was opened. */
  6886. }, {
  6887. key: "saveFocus",
  6888. value: function saveFocus() {}
  6889. /** Restores focus to the element that was focused before the menu surface was opened. */
  6890. }, {
  6891. key: "restoreFocus",
  6892. value: function restoreFocus() {}
  6893. /** @return {boolean} */
  6894. }, {
  6895. key: "isFirstElementFocused",
  6896. value: function isFirstElementFocused() {}
  6897. /** @return {boolean} */
  6898. }, {
  6899. key: "isLastElementFocused",
  6900. value: function isLastElementFocused() {}
  6901. /** Focuses the first focusable element in the menu-surface. */
  6902. }, {
  6903. key: "focusFirstElement",
  6904. value: function focusFirstElement() {}
  6905. /** Focuses the first focusable element in the menu-surface. */
  6906. }, {
  6907. key: "focusLastElement",
  6908. value: function focusLastElement() {}
  6909. /** @return {!{width: number, height: number}} */
  6910. }, {
  6911. key: "getInnerDimensions",
  6912. value: function getInnerDimensions() {}
  6913. /** @return {!{width: number, height: number, top: number, right: number, bottom: number, left: number}} */
  6914. }, {
  6915. key: "getAnchorDimensions",
  6916. value: function getAnchorDimensions() {}
  6917. /** @return {!{ width: number, height: number }} */
  6918. }, {
  6919. key: "getWindowDimensions",
  6920. value: function getWindowDimensions() {}
  6921. /** @return {!{ width: number, height: number }} */
  6922. }, {
  6923. key: "getBodyDimensions",
  6924. value: function getBodyDimensions() {}
  6925. /** @return {!{ width: number, height: number }} */
  6926. }, {
  6927. key: "getWindowScroll",
  6928. value: function getWindowScroll() {}
  6929. /** @param {!{
  6930. * top: (string|undefined),
  6931. * right: (string|undefined),
  6932. * bottom: (string|undefined),
  6933. * left: (string|undefined)
  6934. * }} position */
  6935. }, {
  6936. key: "setPosition",
  6937. value: function setPosition(position) {}
  6938. /** @param {string} height */
  6939. }, {
  6940. key: "setMaxHeight",
  6941. value: function setMaxHeight(height) {}
  6942. }]);
  6943. return MDCMenuSurfaceAdapter;
  6944. }();
  6945. /***/ }),
  6946. /* 45 */
  6947. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6948. "use strict";
  6949. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  6950. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCMenuSurface", function() { return MDCMenuSurface; });
  6951. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  6952. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util__ = __webpack_require__(115);
  6953. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(18);
  6954. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__adapter__ = __webpack_require__(44);
  6955. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__constants__ = __webpack_require__(19);
  6956. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCMenuSurfaceFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["b"]; });
  6957. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "AnchorMargin", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  6958. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Corner", function() { return __WEBPACK_IMPORTED_MODULE_4__constants__["a"]; });
  6959. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "CornerBit", function() { return __WEBPACK_IMPORTED_MODULE_4__constants__["b"]; });
  6960. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "util", function() { return __WEBPACK_IMPORTED_MODULE_1__util__; });
  6961. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  6962. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  6963. var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
  6964. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6965. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  6966. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  6967. /**
  6968. * @license
  6969. * Copyright 2018 Google Inc.
  6970. *
  6971. * Permission is hereby granted, free of charge, to any person obtaining a copy
  6972. * of this software and associated documentation files (the "Software"), to deal
  6973. * in the Software without restriction, including without limitation the rights
  6974. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  6975. * copies of the Software, and to permit persons to whom the Software is
  6976. * furnished to do so, subject to the following conditions:
  6977. *
  6978. * The above copyright notice and this permission notice shall be included in
  6979. * all copies or substantial portions of the Software.
  6980. *
  6981. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  6982. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  6983. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  6984. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  6985. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  6986. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  6987. * THE SOFTWARE.
  6988. */
  6989. /**
  6990. * @extends MDCComponent<!MDCMenuSurfaceFoundation>
  6991. */
  6992. var MDCMenuSurface = function (_MDCComponent) {
  6993. _inherits(MDCMenuSurface, _MDCComponent);
  6994. /** @param {...?} args */
  6995. function MDCMenuSurface() {
  6996. var _ref;
  6997. _classCallCheck(this, MDCMenuSurface);
  6998. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  6999. args[_key] = arguments[_key];
  7000. }
  7001. /** @private {!Element} */
  7002. var _this = _possibleConstructorReturn(this, (_ref = MDCMenuSurface.__proto__ || Object.getPrototypeOf(MDCMenuSurface)).call.apply(_ref, [this].concat(args)));
  7003. _this.previousFocus_;
  7004. /** @private {!Element} */
  7005. _this.anchorElement;
  7006. /** @private {Element} */
  7007. _this.firstFocusableElement_;
  7008. /** @private {Element} */
  7009. _this.lastFocusableElement_;
  7010. /** @private {!Function} */
  7011. _this.handleKeydown_;
  7012. /** @private {!Function} */
  7013. _this.handleBodyClick_;
  7014. /** @private {!Function} */
  7015. _this.registerBodyClickListener_;
  7016. /** @private {!Function} */
  7017. _this.deregisterBodyClickListener_;
  7018. return _this;
  7019. }
  7020. /**
  7021. * @param {!Element} root
  7022. * @return {!MDCMenuSurface}
  7023. */
  7024. _createClass(MDCMenuSurface, [{
  7025. key: 'initialSyncWithDOM',
  7026. value: function initialSyncWithDOM() {
  7027. var _this2 = this;
  7028. if (this.root_.parentElement && this.root_.parentElement.classList.contains(__WEBPACK_IMPORTED_MODULE_4__constants__["c" /* cssClasses */].ANCHOR)) {
  7029. this.anchorElement = this.root_.parentElement;
  7030. }
  7031. if (this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_4__constants__["c" /* cssClasses */].FIXED)) {
  7032. this.setFixedPosition(true);
  7033. }
  7034. this.handleKeydown_ = function (evt) {
  7035. return _this2.foundation_.handleKeydown(evt);
  7036. };
  7037. this.handleBodyClick_ = function (evt) {
  7038. return _this2.foundation_.handleBodyClick(evt);
  7039. };
  7040. this.registerBodyClickListener_ = function () {
  7041. return document.body.addEventListener('click', _this2.handleBodyClick_);
  7042. };
  7043. this.deregisterBodyClickListener_ = function () {
  7044. return document.body.removeEventListener('click', _this2.handleBodyClick_);
  7045. };
  7046. this.root_.addEventListener('keydown', this.handleKeydown_);
  7047. this.root_.addEventListener(__WEBPACK_IMPORTED_MODULE_4__constants__["e" /* strings */].OPENED_EVENT, this.registerBodyClickListener_);
  7048. this.root_.addEventListener(__WEBPACK_IMPORTED_MODULE_4__constants__["e" /* strings */].CLOSED_EVENT, this.deregisterBodyClickListener_);
  7049. }
  7050. }, {
  7051. key: 'destroy',
  7052. value: function destroy() {
  7053. this.root_.removeEventListener('keydown', this.handleKeydown_);
  7054. this.root_.removeEventListener(__WEBPACK_IMPORTED_MODULE_4__constants__["e" /* strings */].OPENED_EVENT, this.registerBodyClickListener_);
  7055. this.root_.removeEventListener(__WEBPACK_IMPORTED_MODULE_4__constants__["e" /* strings */].CLOSED_EVENT, this.deregisterBodyClickListener_);
  7056. _get(MDCMenuSurface.prototype.__proto__ || Object.getPrototypeOf(MDCMenuSurface.prototype), 'destroy', this).call(this);
  7057. }
  7058. /** @return {boolean} */
  7059. }, {
  7060. key: 'hoistMenuToBody',
  7061. /**
  7062. * Removes the menu-surface from it's current location and appends it to the
  7063. * body to overcome any overflow:hidden issues.
  7064. */
  7065. value: function hoistMenuToBody() {
  7066. document.body.appendChild(this.root_.parentElement.removeChild(this.root_));
  7067. this.setIsHoisted(true);
  7068. }
  7069. /**
  7070. * Sets the foundation to use page offsets for an positioning when the menu
  7071. * is hoisted to the body.
  7072. * @param {boolean} isHoisted
  7073. */
  7074. }, {
  7075. key: 'setIsHoisted',
  7076. value: function setIsHoisted(isHoisted) {
  7077. this.foundation_.setIsHoisted(isHoisted);
  7078. }
  7079. /**
  7080. * Sets the element that the menu-surface is anchored to.
  7081. * @param {!Element} element
  7082. */
  7083. }, {
  7084. key: 'setMenuSurfaceAnchorElement',
  7085. value: function setMenuSurfaceAnchorElement(element) {
  7086. this.anchorElement = element;
  7087. }
  7088. /**
  7089. * Sets the menu-surface to position: fixed.
  7090. * @param {boolean} isFixed
  7091. */
  7092. }, {
  7093. key: 'setFixedPosition',
  7094. value: function setFixedPosition(isFixed) {
  7095. if (isFixed) {
  7096. this.root_.classList.add(__WEBPACK_IMPORTED_MODULE_4__constants__["c" /* cssClasses */].FIXED);
  7097. } else {
  7098. this.root_.classList.remove(__WEBPACK_IMPORTED_MODULE_4__constants__["c" /* cssClasses */].FIXED);
  7099. }
  7100. this.foundation_.setFixedPosition(isFixed);
  7101. }
  7102. /**
  7103. * Sets the absolute x/y position to position based on. Requires the menu to be hoisted.
  7104. * @param {number} x
  7105. * @param {number} y
  7106. */
  7107. }, {
  7108. key: 'setAbsolutePosition',
  7109. value: function setAbsolutePosition(x, y) {
  7110. this.foundation_.setAbsolutePosition(x, y);
  7111. this.setIsHoisted(true);
  7112. }
  7113. /**
  7114. * @param {!Corner} corner Default anchor corner alignment of top-left
  7115. * surface corner.
  7116. */
  7117. }, {
  7118. key: 'setAnchorCorner',
  7119. value: function setAnchorCorner(corner) {
  7120. this.foundation_.setAnchorCorner(corner);
  7121. }
  7122. /**
  7123. * @param {!AnchorMargin} margin
  7124. */
  7125. }, {
  7126. key: 'setAnchorMargin',
  7127. value: function setAnchorMargin(margin) {
  7128. this.foundation_.setAnchorMargin(margin);
  7129. }
  7130. /** @param {boolean} quickOpen */
  7131. }, {
  7132. key: 'getDefaultFoundation',
  7133. /** @return {!MDCMenuSurfaceFoundation} */
  7134. value: function getDefaultFoundation() {
  7135. var _this3 = this;
  7136. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["b" /* MDCMenuSurfaceFoundation */](
  7137. /** @type {!MDCMenuSurfaceAdapter} */_extends({
  7138. addClass: function addClass(className) {
  7139. return _this3.root_.classList.add(className);
  7140. },
  7141. removeClass: function removeClass(className) {
  7142. return _this3.root_.classList.remove(className);
  7143. },
  7144. hasClass: function hasClass(className) {
  7145. return _this3.root_.classList.contains(className);
  7146. },
  7147. hasAnchor: function hasAnchor() {
  7148. return !!_this3.anchorElement;
  7149. },
  7150. notifyClose: function notifyClose() {
  7151. return _this3.emit(__WEBPACK_IMPORTED_MODULE_2__foundation__["b" /* MDCMenuSurfaceFoundation */].strings.CLOSED_EVENT, {});
  7152. },
  7153. notifyOpen: function notifyOpen() {
  7154. return _this3.emit(__WEBPACK_IMPORTED_MODULE_2__foundation__["b" /* MDCMenuSurfaceFoundation */].strings.OPENED_EVENT, {});
  7155. },
  7156. isElementInContainer: function isElementInContainer(el) {
  7157. return _this3.root_ === el || _this3.root_.contains(el);
  7158. },
  7159. isRtl: function isRtl() {
  7160. return getComputedStyle(_this3.root_).getPropertyValue('direction') === 'rtl';
  7161. },
  7162. setTransformOrigin: function setTransformOrigin(origin) {
  7163. _this3.root_.style[__WEBPACK_IMPORTED_MODULE_1__util__["getTransformPropertyName"](window) + '-origin'] = origin;
  7164. }
  7165. }, this.getFocusAdapterMethods_(), this.getDimensionAdapterMethods_()));
  7166. }
  7167. /**
  7168. * @return {!{
  7169. * isFocused: function(): boolean,
  7170. * saveFocus: function(),
  7171. * restoreFocus: function(),
  7172. * isFirstElementFocused: function(): boolean,
  7173. * isLastElementFocused: function(): boolean,
  7174. * focusFirstElement: function(),
  7175. * focusLastElement: function(),
  7176. * }}
  7177. * @private
  7178. */
  7179. }, {
  7180. key: 'getFocusAdapterMethods_',
  7181. value: function getFocusAdapterMethods_() {
  7182. var _this4 = this;
  7183. return {
  7184. isFocused: function isFocused() {
  7185. return document.activeElement === _this4.root_;
  7186. },
  7187. saveFocus: function saveFocus() {
  7188. _this4.previousFocus_ = document.activeElement;
  7189. },
  7190. restoreFocus: function restoreFocus() {
  7191. if (_this4.root_.contains(document.activeElement)) {
  7192. if (_this4.previousFocus_ && _this4.previousFocus_.focus) {
  7193. _this4.previousFocus_.focus();
  7194. }
  7195. }
  7196. },
  7197. isFirstElementFocused: function isFirstElementFocused() {
  7198. return _this4.firstFocusableElement_ && _this4.firstFocusableElement_ === document.activeElement;
  7199. },
  7200. isLastElementFocused: function isLastElementFocused() {
  7201. return _this4.lastFocusableElement_ && _this4.lastFocusableElement_ === document.activeElement;
  7202. },
  7203. focusFirstElement: function focusFirstElement() {
  7204. return _this4.firstFocusableElement_ && _this4.firstFocusableElement_.focus && _this4.firstFocusableElement_.focus();
  7205. },
  7206. focusLastElement: function focusLastElement() {
  7207. return _this4.lastFocusableElement_ && _this4.lastFocusableElement_.focus && _this4.lastFocusableElement_.focus();
  7208. }
  7209. };
  7210. }
  7211. /**
  7212. * @return {!{
  7213. * getInnerDimensions: function(),
  7214. * getAnchorDimensions: function(): (HTMLElement | null | * | ClientRect),
  7215. * getWindowDimensions: function(),
  7216. * setPosition: function(*),
  7217. * setMaxHeight: function(string)}}
  7218. * @private
  7219. */
  7220. }, {
  7221. key: 'getDimensionAdapterMethods_',
  7222. value: function getDimensionAdapterMethods_() {
  7223. var _this5 = this;
  7224. return {
  7225. getInnerDimensions: function getInnerDimensions() {
  7226. return { width: _this5.root_.offsetWidth, height: _this5.root_.offsetHeight };
  7227. },
  7228. getAnchorDimensions: function getAnchorDimensions() {
  7229. return _this5.anchorElement && _this5.anchorElement.getBoundingClientRect();
  7230. },
  7231. getWindowDimensions: function getWindowDimensions() {
  7232. return { width: window.innerWidth, height: window.innerHeight };
  7233. },
  7234. getBodyDimensions: function getBodyDimensions() {
  7235. return { width: document.body.clientWidth, height: document.body.clientHeight };
  7236. },
  7237. getWindowScroll: function getWindowScroll() {
  7238. return { x: window.pageXOffset, y: window.pageYOffset };
  7239. },
  7240. setPosition: function setPosition(position) {
  7241. _this5.root_.style.left = 'left' in position ? position.left : null;
  7242. _this5.root_.style.right = 'right' in position ? position.right : null;
  7243. _this5.root_.style.top = 'top' in position ? position.top : null;
  7244. _this5.root_.style.bottom = 'bottom' in position ? position.bottom : null;
  7245. },
  7246. setMaxHeight: function setMaxHeight(height) {
  7247. _this5.root_.style.maxHeight = height;
  7248. }
  7249. };
  7250. }
  7251. }, {
  7252. key: 'open',
  7253. get: function get() {
  7254. return this.foundation_.isOpen();
  7255. }
  7256. /** @param {boolean} value */
  7257. ,
  7258. set: function set(value) {
  7259. if (value) {
  7260. var focusableElements = this.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_4__constants__["e" /* strings */].FOCUSABLE_ELEMENTS);
  7261. this.firstFocusableElement_ = focusableElements.length > 0 ? focusableElements[0] : null;
  7262. this.lastFocusableElement_ = focusableElements.length > 0 ? focusableElements[focusableElements.length - 1] : null;
  7263. this.foundation_.open();
  7264. } else {
  7265. this.foundation_.close();
  7266. }
  7267. }
  7268. }, {
  7269. key: 'quickOpen',
  7270. set: function set(quickOpen) {
  7271. this.foundation_.setQuickOpen(quickOpen);
  7272. }
  7273. }], [{
  7274. key: 'attachTo',
  7275. value: function attachTo(root) {
  7276. return new MDCMenuSurface(root);
  7277. }
  7278. }]);
  7279. return MDCMenuSurface;
  7280. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  7281. /***/ }),
  7282. /* 46 */
  7283. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7284. "use strict";
  7285. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  7286. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7287. /**
  7288. * @license
  7289. * Copyright 2017 Google Inc.
  7290. *
  7291. * Permission is hereby granted, free of charge, to any person obtaining a copy
  7292. * of this software and associated documentation files (the "Software"), to deal
  7293. * in the Software without restriction, including without limitation the rights
  7294. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7295. * copies of the Software, and to permit persons to whom the Software is
  7296. * furnished to do so, subject to the following conditions:
  7297. *
  7298. * The above copyright notice and this permission notice shall be included in
  7299. * all copies or substantial portions of the Software.
  7300. *
  7301. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  7302. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  7303. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  7304. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  7305. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  7306. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  7307. * THE SOFTWARE.
  7308. */
  7309. /* eslint no-unused-vars: [2, {"args": "none"}] */
  7310. /**
  7311. * Adapter for MDC Notched Outline.
  7312. *
  7313. * Defines the shape of the adapter expected by the foundation. Implement this
  7314. * adapter to integrate the Notched Outline into your framework. See
  7315. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  7316. * for more information.
  7317. *
  7318. * @record
  7319. */
  7320. var MDCNotchedOutlineAdapter = function () {
  7321. function MDCNotchedOutlineAdapter() {
  7322. _classCallCheck(this, MDCNotchedOutlineAdapter);
  7323. }
  7324. _createClass(MDCNotchedOutlineAdapter, [{
  7325. key: "addClass",
  7326. /**
  7327. * Adds a class to the root element.
  7328. * @param {string} className
  7329. */
  7330. value: function addClass(className) {}
  7331. /**
  7332. * Removes a class from the root element.
  7333. * @param {string} className
  7334. */
  7335. }, {
  7336. key: "removeClass",
  7337. value: function removeClass(className) {}
  7338. /**
  7339. * Sets the width style property of the notch element.
  7340. * @param {number} width
  7341. */
  7342. }, {
  7343. key: "setNotchWidthProperty",
  7344. value: function setNotchWidthProperty(width) {}
  7345. /**
  7346. * Removes the width style property from the notch element.
  7347. */
  7348. }, {
  7349. key: "removeNotchWidthProperty",
  7350. value: function removeNotchWidthProperty() {}
  7351. }]);
  7352. return MDCNotchedOutlineAdapter;
  7353. }();
  7354. /* unused harmony default export */ var _unused_webpack_default_export = (MDCNotchedOutlineAdapter);
  7355. /***/ }),
  7356. /* 47 */
  7357. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7358. "use strict";
  7359. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  7360. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; });
  7361. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; });
  7362. /**
  7363. * @license
  7364. * Copyright 2018 Google Inc.
  7365. *
  7366. * Permission is hereby granted, free of charge, to any person obtaining a copy
  7367. * of this software and associated documentation files (the "Software"), to deal
  7368. * in the Software without restriction, including without limitation the rights
  7369. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7370. * copies of the Software, and to permit persons to whom the Software is
  7371. * furnished to do so, subject to the following conditions:
  7372. *
  7373. * The above copyright notice and this permission notice shall be included in
  7374. * all copies or substantial portions of the Software.
  7375. *
  7376. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  7377. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  7378. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  7379. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  7380. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  7381. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  7382. * THE SOFTWARE.
  7383. */
  7384. /** @enum {string} */
  7385. var strings = {
  7386. NOTCH_ELEMENT_SELECTOR: '.mdc-notched-outline__notch'
  7387. };
  7388. /** @enum {number} */
  7389. var numbers = {
  7390. // This should stay in sync with $mdc-notched-outline-padding * 2.
  7391. NOTCH_ELEMENT_PADDING: 8
  7392. };
  7393. /** @enum {string} */
  7394. var cssClasses = {
  7395. OUTLINE_NOTCHED: 'mdc-notched-outline--notched',
  7396. OUTLINE_UPGRADED: 'mdc-notched-outline--upgraded',
  7397. NO_LABEL: 'mdc-notched-outline--no-label'
  7398. };
  7399. /***/ }),
  7400. /* 48 */
  7401. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7402. "use strict";
  7403. /* unused harmony export MDCSelectAdapter */
  7404. /* unused harmony export FoundationMapType */
  7405. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__icon_index__ = __webpack_require__(21);
  7406. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__helper_text_index__ = __webpack_require__(22);
  7407. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  7408. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7409. /**
  7410. * @license
  7411. * Copyright 2018 Google Inc.
  7412. *
  7413. * Permission is hereby granted, free of charge, to any person obtaining a copy
  7414. * of this software and associated documentation files (the "Software"), to deal
  7415. * in the Software without restriction, including without limitation the rights
  7416. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7417. * copies of the Software, and to permit persons to whom the Software is
  7418. * furnished to do so, subject to the following conditions:
  7419. *
  7420. * The above copyright notice and this permission notice shall be included in
  7421. * all copies or substantial portions of the Software.
  7422. *
  7423. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  7424. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  7425. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  7426. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  7427. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  7428. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  7429. * THE SOFTWARE.
  7430. */
  7431. /* eslint no-unused-vars: [2, {"args": "none"}] */
  7432. /* eslint-disable no-unused-vars */
  7433. /* eslint-enable no-unused-vars */
  7434. /**
  7435. * @typedef {{
  7436. * leadingIcon: (!MDCSelectIconFoundation|undefined),
  7437. * helperText: (!MDCSelectHelperTextFoundation|undefined),
  7438. * }}
  7439. */
  7440. var FoundationMapType = void 0;
  7441. /**
  7442. * Adapter for MDC Select. Provides an interface for managing
  7443. * - classes
  7444. * - dom
  7445. * - event handlers
  7446. *
  7447. * Additionally, provides type information for the adapter to the Closure
  7448. * compiler.
  7449. *
  7450. * Implement this adapter for your framework of choice to delegate updates to
  7451. * the component in your framework of choice. See architecture documentation
  7452. * for more details.
  7453. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  7454. *
  7455. * @record
  7456. */
  7457. var MDCSelectAdapter = function () {
  7458. function MDCSelectAdapter() {
  7459. _classCallCheck(this, MDCSelectAdapter);
  7460. }
  7461. _createClass(MDCSelectAdapter, [{
  7462. key: 'addClass',
  7463. /**
  7464. * Adds class to root element.
  7465. * @param {string} className
  7466. */
  7467. value: function addClass(className) {}
  7468. /**
  7469. * Removes a class from the root element.
  7470. * @param {string} className
  7471. */
  7472. }, {
  7473. key: 'removeClass',
  7474. value: function removeClass(className) {}
  7475. /**
  7476. * Returns true if the root element contains the given class name.
  7477. * @param {string} className
  7478. * @return {boolean}
  7479. */
  7480. }, {
  7481. key: 'hasClass',
  7482. value: function hasClass(className) {}
  7483. /**
  7484. * Activates the bottom line, showing a focused state.
  7485. */
  7486. }, {
  7487. key: 'activateBottomLine',
  7488. value: function activateBottomLine() {}
  7489. /**
  7490. * Deactivates the bottom line.
  7491. */
  7492. }, {
  7493. key: 'deactivateBottomLine',
  7494. value: function deactivateBottomLine() {}
  7495. /**
  7496. * Sets the value of the select.
  7497. * @param {string} value
  7498. */
  7499. }, {
  7500. key: 'setValue',
  7501. value: function setValue(value) {}
  7502. /**
  7503. * Returns the selected value of the select element.
  7504. * @return {string}
  7505. */
  7506. }, {
  7507. key: 'getValue',
  7508. value: function getValue() {}
  7509. /**
  7510. * Floats label determined based off of the shouldFloat argument.
  7511. * @param {boolean} shouldFloat
  7512. */
  7513. }, {
  7514. key: 'floatLabel',
  7515. value: function floatLabel(shouldFloat) {}
  7516. /**
  7517. * Returns width of label in pixels, if the label exists.
  7518. * @return {number}
  7519. */
  7520. }, {
  7521. key: 'getLabelWidth',
  7522. value: function getLabelWidth() {}
  7523. /**
  7524. * Returns true if outline element exists, false if it doesn't.
  7525. * @return {boolean}
  7526. */
  7527. }, {
  7528. key: 'hasOutline',
  7529. value: function hasOutline() {}
  7530. /**
  7531. * Only implement if outline element exists.
  7532. * @param {number} labelWidth
  7533. */
  7534. }, {
  7535. key: 'notchOutline',
  7536. value: function notchOutline(labelWidth) {}
  7537. /**
  7538. * Closes notch in outline element, if the outline exists.
  7539. */
  7540. }, {
  7541. key: 'closeOutline',
  7542. value: function closeOutline() {}
  7543. /**
  7544. * Opens the menu.
  7545. */
  7546. }, {
  7547. key: 'openMenu',
  7548. value: function openMenu() {}
  7549. /**
  7550. * Closes the menu.
  7551. */
  7552. }, {
  7553. key: 'closeMenu',
  7554. value: function closeMenu() {}
  7555. /**
  7556. * Returns true if the menu is currently open.
  7557. * @return {boolean}
  7558. */
  7559. }, {
  7560. key: 'isMenuOpen',
  7561. value: function isMenuOpen() {}
  7562. /**
  7563. * Sets the selected index of the select to the index provided.
  7564. * @param {number} index
  7565. */
  7566. }, {
  7567. key: 'setSelectedIndex',
  7568. value: function setSelectedIndex(index) {}
  7569. /**
  7570. * Sets the select to disabled.
  7571. * @param {boolean} isDisabled
  7572. */
  7573. }, {
  7574. key: 'setDisabled',
  7575. value: function setDisabled(isDisabled) {}
  7576. /**
  7577. * Sets the line ripple transform origin center.
  7578. * @param {number} normalizedX
  7579. */
  7580. }, {
  7581. key: 'setRippleCenter',
  7582. value: function setRippleCenter(normalizedX) {}
  7583. /**
  7584. * Emits a change event when an element is selected.
  7585. * @param {string} value
  7586. */
  7587. }, {
  7588. key: 'notifyChange',
  7589. value: function notifyChange(value) {}
  7590. /**
  7591. * Checks if the select is currently valid.
  7592. * @return {boolean} isValid
  7593. */
  7594. }, {
  7595. key: 'checkValidity',
  7596. value: function checkValidity() {}
  7597. /**
  7598. * Adds/Removes the invalid class.
  7599. * @param {boolean} isValid
  7600. */
  7601. }, {
  7602. key: 'setValid',
  7603. value: function setValid(isValid) {}
  7604. }]);
  7605. return MDCSelectAdapter;
  7606. }();
  7607. /***/ }),
  7608. /* 49 */
  7609. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7610. "use strict";
  7611. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  7612. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7613. /**
  7614. * @license
  7615. * Copyright 2018 Google Inc.
  7616. *
  7617. * Permission is hereby granted, free of charge, to any person obtaining a copy
  7618. * of this software and associated documentation files (the "Software"), to deal
  7619. * in the Software without restriction, including without limitation the rights
  7620. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7621. * copies of the Software, and to permit persons to whom the Software is
  7622. * furnished to do so, subject to the following conditions:
  7623. *
  7624. * The above copyright notice and this permission notice shall be included in
  7625. * all copies or substantial portions of the Software.
  7626. *
  7627. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  7628. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  7629. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  7630. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  7631. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  7632. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  7633. * THE SOFTWARE.
  7634. */
  7635. /* eslint no-unused-vars: [2, {"args": "none"}] */
  7636. /**
  7637. * Adapter for MDC Select Icon.
  7638. *
  7639. * Defines the shape of the adapter expected by the foundation. Implement this
  7640. * adapter to integrate the select icon into your framework. See
  7641. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  7642. * for more information.
  7643. *
  7644. * @record
  7645. */
  7646. var MDCSelectIconAdapter = function () {
  7647. function MDCSelectIconAdapter() {
  7648. _classCallCheck(this, MDCSelectIconAdapter);
  7649. }
  7650. _createClass(MDCSelectIconAdapter, [{
  7651. key: "getAttr",
  7652. /**
  7653. * Gets the value of an attribute on the icon element.
  7654. * @param {string} attr
  7655. * @return {string}
  7656. */
  7657. value: function getAttr(attr) {}
  7658. /**
  7659. * Sets an attribute on the icon element.
  7660. * @param {string} attr
  7661. * @param {string} value
  7662. */
  7663. }, {
  7664. key: "setAttr",
  7665. value: function setAttr(attr, value) {}
  7666. /**
  7667. * Removes an attribute from the icon element.
  7668. * @param {string} attr
  7669. */
  7670. }, {
  7671. key: "removeAttr",
  7672. value: function removeAttr(attr) {}
  7673. /**
  7674. * Sets the text content of the icon element.
  7675. * @param {string} content
  7676. */
  7677. }, {
  7678. key: "setContent",
  7679. value: function setContent(content) {}
  7680. /**
  7681. * Registers an event listener on the icon element for a given event.
  7682. * @param {string} evtType
  7683. * @param {function(!Event): undefined} handler
  7684. */
  7685. }, {
  7686. key: "registerInteractionHandler",
  7687. value: function registerInteractionHandler(evtType, handler) {}
  7688. /**
  7689. * Deregisters an event listener on the icon element for a given event.
  7690. * @param {string} evtType
  7691. * @param {function(!Event): undefined} handler
  7692. */
  7693. }, {
  7694. key: "deregisterInteractionHandler",
  7695. value: function deregisterInteractionHandler(evtType, handler) {}
  7696. /**
  7697. * Emits a custom event "MDCSelect:icon" denoting a user has clicked the icon.
  7698. */
  7699. }, {
  7700. key: "notifyIconAction",
  7701. value: function notifyIconAction() {}
  7702. }]);
  7703. return MDCSelectIconAdapter;
  7704. }();
  7705. /* unused harmony default export */ var _unused_webpack_default_export = (MDCSelectIconAdapter);
  7706. /***/ }),
  7707. /* 50 */
  7708. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7709. "use strict";
  7710. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  7711. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7712. /**
  7713. * @license
  7714. * Copyright 2018 Google Inc.
  7715. *
  7716. * Permission is hereby granted, free of charge, to any person obtaining a copy
  7717. * of this software and associated documentation files (the "Software"), to deal
  7718. * in the Software without restriction, including without limitation the rights
  7719. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7720. * copies of the Software, and to permit persons to whom the Software is
  7721. * furnished to do so, subject to the following conditions:
  7722. *
  7723. * The above copyright notice and this permission notice shall be included in
  7724. * all copies or substantial portions of the Software.
  7725. *
  7726. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  7727. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  7728. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  7729. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  7730. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  7731. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  7732. * THE SOFTWARE.
  7733. */
  7734. /* eslint no-unused-vars: [2, {"args": "none"}] */
  7735. /**
  7736. * Adapter for MDC Select Helper Text.
  7737. *
  7738. * Defines the shape of the adapter expected by the foundation. Implement this
  7739. * adapter to integrate the Select helper text into your framework. See
  7740. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  7741. * for more information.
  7742. *
  7743. * @record
  7744. */
  7745. var MDCSelectHelperTextAdapter = function () {
  7746. function MDCSelectHelperTextAdapter() {
  7747. _classCallCheck(this, MDCSelectHelperTextAdapter);
  7748. }
  7749. _createClass(MDCSelectHelperTextAdapter, [{
  7750. key: "addClass",
  7751. /**
  7752. * Adds a class to the helper text element.
  7753. * @param {string} className
  7754. */
  7755. value: function addClass(className) {}
  7756. /**
  7757. * Removes a class from the helper text element.
  7758. * @param {string} className
  7759. */
  7760. }, {
  7761. key: "removeClass",
  7762. value: function removeClass(className) {}
  7763. /**
  7764. * Returns whether or not the helper text element contains the given class.
  7765. * @param {string} className
  7766. * @return {boolean}
  7767. */
  7768. }, {
  7769. key: "hasClass",
  7770. value: function hasClass(className) {}
  7771. /**
  7772. * Sets an attribute with a given value on the helper text element.
  7773. * @param {string} attr
  7774. * @param {string} value
  7775. */
  7776. }, {
  7777. key: "setAttr",
  7778. value: function setAttr(attr, value) {}
  7779. /**
  7780. * Removes an attribute from the helper text element.
  7781. * @param {string} attr
  7782. */
  7783. }, {
  7784. key: "removeAttr",
  7785. value: function removeAttr(attr) {}
  7786. /**
  7787. * Sets the text content for the helper text element.
  7788. * @param {string} content
  7789. */
  7790. }, {
  7791. key: "setContent",
  7792. value: function setContent(content) {}
  7793. }]);
  7794. return MDCSelectHelperTextAdapter;
  7795. }();
  7796. /* unused harmony default export */ var _unused_webpack_default_export = (MDCSelectHelperTextAdapter);
  7797. /***/ }),
  7798. /* 51 */
  7799. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7800. "use strict";
  7801. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  7802. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; });
  7803. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; });
  7804. /**
  7805. * @license
  7806. * Copyright 2016 Google Inc.
  7807. *
  7808. * Permission is hereby granted, free of charge, to any person obtaining a copy
  7809. * of this software and associated documentation files (the "Software"), to deal
  7810. * in the Software without restriction, including without limitation the rights
  7811. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7812. * copies of the Software, and to permit persons to whom the Software is
  7813. * furnished to do so, subject to the following conditions:
  7814. *
  7815. * The above copyright notice and this permission notice shall be included in
  7816. * all copies or substantial portions of the Software.
  7817. *
  7818. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  7819. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  7820. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  7821. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  7822. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  7823. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  7824. * THE SOFTWARE.
  7825. */
  7826. /** @enum {string} */
  7827. var cssClasses = {
  7828. DISABLED: 'mdc-select--disabled',
  7829. ROOT: 'mdc-select',
  7830. OUTLINED: 'mdc-select--outlined',
  7831. FOCUSED: 'mdc-select--focused',
  7832. SELECTED_ITEM_CLASS: 'mdc-list-item--selected',
  7833. WITH_LEADING_ICON: 'mdc-select--with-leading-icon',
  7834. INVALID: 'mdc-select--invalid',
  7835. REQUIRED: 'mdc-select--required'
  7836. };
  7837. /** @enum {string} */
  7838. var strings = {
  7839. ARIA_CONTROLS: 'aria-controls',
  7840. CHANGE_EVENT: 'MDCSelect:change',
  7841. SELECTED_ITEM_SELECTOR: '.' + cssClasses.SELECTED_ITEM_CLASS,
  7842. LEADING_ICON_SELECTOR: '.mdc-select__icon',
  7843. SELECTED_TEXT_SELECTOR: '.mdc-select__selected-text',
  7844. HIDDEN_INPUT_SELECTOR: 'input[type="hidden"]',
  7845. MENU_SELECTOR: '.mdc-select__menu',
  7846. LINE_RIPPLE_SELECTOR: '.mdc-line-ripple',
  7847. LABEL_SELECTOR: '.mdc-floating-label',
  7848. NATIVE_CONTROL_SELECTOR: '.mdc-select__native-control',
  7849. OUTLINE_SELECTOR: '.mdc-notched-outline',
  7850. ENHANCED_VALUE_ATTR: 'data-value',
  7851. ARIA_SELECTED_ATTR: 'aria-selected'
  7852. };
  7853. /** @enum {number} */
  7854. var numbers = {
  7855. LABEL_SCALE: 0.75
  7856. };
  7857. /***/ }),
  7858. /* 52 */
  7859. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7860. "use strict";
  7861. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  7862. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; });
  7863. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; });
  7864. /**
  7865. * @license
  7866. * Copyright 2017 Google Inc.
  7867. *
  7868. * Permission is hereby granted, free of charge, to any person obtaining a copy
  7869. * of this software and associated documentation files (the "Software"), to deal
  7870. * in the Software without restriction, including without limitation the rights
  7871. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7872. * copies of the Software, and to permit persons to whom the Software is
  7873. * furnished to do so, subject to the following conditions:
  7874. *
  7875. * The above copyright notice and this permission notice shall be included in
  7876. * all copies or substantial portions of the Software.
  7877. *
  7878. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  7879. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  7880. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  7881. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  7882. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  7883. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  7884. * THE SOFTWARE.
  7885. */
  7886. /** @enum {string} */
  7887. var cssClasses = {
  7888. ACTIVE: 'mdc-slider--active',
  7889. DISABLED: 'mdc-slider--disabled',
  7890. DISCRETE: 'mdc-slider--discrete',
  7891. FOCUS: 'mdc-slider--focus',
  7892. IN_TRANSIT: 'mdc-slider--in-transit',
  7893. IS_DISCRETE: 'mdc-slider--discrete',
  7894. HAS_TRACK_MARKER: 'mdc-slider--display-markers'
  7895. };
  7896. /** @enum {string} */
  7897. var strings = {
  7898. TRACK_SELECTOR: '.mdc-slider__track',
  7899. TRACK_MARKER_CONTAINER_SELECTOR: '.mdc-slider__track-marker-container',
  7900. LAST_TRACK_MARKER_SELECTOR: '.mdc-slider__track-marker:last-child',
  7901. THUMB_CONTAINER_SELECTOR: '.mdc-slider__thumb-container',
  7902. PIN_VALUE_MARKER_SELECTOR: '.mdc-slider__pin-value-marker',
  7903. ARIA_VALUEMIN: 'aria-valuemin',
  7904. ARIA_VALUEMAX: 'aria-valuemax',
  7905. ARIA_VALUENOW: 'aria-valuenow',
  7906. ARIA_DISABLED: 'aria-disabled',
  7907. STEP_DATA_ATTR: 'data-step',
  7908. CHANGE_EVENT: 'MDCSlider:change',
  7909. INPUT_EVENT: 'MDCSlider:input'
  7910. };
  7911. /** @enum {number} */
  7912. var numbers = {
  7913. PAGE_FACTOR: 4
  7914. };
  7915. /***/ }),
  7916. /* 53 */
  7917. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7918. "use strict";
  7919. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  7920. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7921. /**
  7922. * @license
  7923. * Copyright 2017 Google Inc.
  7924. *
  7925. * Permission is hereby granted, free of charge, to any person obtaining a copy
  7926. * of this software and associated documentation files (the "Software"), to deal
  7927. * in the Software without restriction, including without limitation the rights
  7928. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7929. * copies of the Software, and to permit persons to whom the Software is
  7930. * furnished to do so, subject to the following conditions:
  7931. *
  7932. * The above copyright notice and this permission notice shall be included in
  7933. * all copies or substantial portions of the Software.
  7934. *
  7935. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  7936. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  7937. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  7938. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  7939. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  7940. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  7941. * THE SOFTWARE.
  7942. */
  7943. /* eslint-disable no-unused-vars */
  7944. /**
  7945. * Adapter for MDC Slider.
  7946. *
  7947. * Defines the shape of the adapter expected by the foundation. Implement this
  7948. * adapter to integrate the Slider into your framework. See
  7949. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  7950. * for more information.
  7951. *
  7952. * @record
  7953. */
  7954. var MDCSliderAdapter = function () {
  7955. function MDCSliderAdapter() {
  7956. _classCallCheck(this, MDCSliderAdapter);
  7957. }
  7958. _createClass(MDCSliderAdapter, [{
  7959. key: "hasClass",
  7960. /**
  7961. * Returns true if className exists for the slider Element
  7962. * @param {string} className
  7963. * @return {boolean}
  7964. */
  7965. value: function hasClass(className) {}
  7966. /**
  7967. * Adds a class to the slider Element
  7968. * @param {string} className
  7969. */
  7970. }, {
  7971. key: "addClass",
  7972. value: function addClass(className) {}
  7973. /**
  7974. * Removes a class from the slider Element
  7975. * @param {string} className
  7976. */
  7977. }, {
  7978. key: "removeClass",
  7979. value: function removeClass(className) {}
  7980. /**
  7981. * Returns a string if attribute name exists on the slider Element,
  7982. * otherwise returns null
  7983. * @param {string} name
  7984. * @return {?string}
  7985. */
  7986. }, {
  7987. key: "getAttribute",
  7988. value: function getAttribute(name) {}
  7989. /**
  7990. * Sets attribute name on slider Element to value
  7991. * @param {string} name
  7992. * @param {string} value
  7993. */
  7994. }, {
  7995. key: "setAttribute",
  7996. value: function setAttribute(name, value) {}
  7997. /**
  7998. * Removes attribute name from slider Element
  7999. * @param {string} name
  8000. */
  8001. }, {
  8002. key: "removeAttribute",
  8003. value: function removeAttribute(name) {}
  8004. /**
  8005. * Returns the bounding client rect for the slider Element
  8006. * @return {?ClientRect}
  8007. */
  8008. }, {
  8009. key: "computeBoundingRect",
  8010. value: function computeBoundingRect() {}
  8011. /**
  8012. * Returns the tab index of the slider Element
  8013. * @return {number}
  8014. */
  8015. }, {
  8016. key: "getTabIndex",
  8017. value: function getTabIndex() {}
  8018. /**
  8019. * Registers an event handler on the root element for a given event.
  8020. * @param {string} type
  8021. * @param {function(!Event): undefined} handler
  8022. */
  8023. }, {
  8024. key: "registerInteractionHandler",
  8025. value: function registerInteractionHandler(type, handler) {}
  8026. /**
  8027. * Deregisters an event handler on the root element for a given event.
  8028. * @param {string} type
  8029. * @param {function(!Event): undefined} handler
  8030. */
  8031. }, {
  8032. key: "deregisterInteractionHandler",
  8033. value: function deregisterInteractionHandler(type, handler) {}
  8034. /**
  8035. * Registers an event handler on the thumb container element for a given event.
  8036. * @param {string} type
  8037. * @param {function(!Event): undefined} handler
  8038. */
  8039. }, {
  8040. key: "registerThumbContainerInteractionHandler",
  8041. value: function registerThumbContainerInteractionHandler(type, handler) {}
  8042. /**
  8043. * Deregisters an event handler on the thumb container element for a given event.
  8044. * @param {string} type
  8045. * @param {function(!Event): undefined} handler
  8046. */
  8047. }, {
  8048. key: "deregisterThumbContainerInteractionHandler",
  8049. value: function deregisterThumbContainerInteractionHandler(type, handler) {}
  8050. /**
  8051. * Registers an event handler on the body for a given event.
  8052. * @param {string} type
  8053. * @param {function(!Event): undefined} handler
  8054. */
  8055. }, {
  8056. key: "registerBodyInteractionHandler",
  8057. value: function registerBodyInteractionHandler(type, handler) {}
  8058. /**
  8059. * Deregisters an event handler on the body for a given event.
  8060. * @param {string} type
  8061. * @param {function(!Event): undefined} handler
  8062. */
  8063. }, {
  8064. key: "deregisterBodyInteractionHandler",
  8065. value: function deregisterBodyInteractionHandler(type, handler) {}
  8066. /**
  8067. * Registers an event handler for the window resize event
  8068. * @param {function(!Event): undefined} handler
  8069. */
  8070. }, {
  8071. key: "registerResizeHandler",
  8072. value: function registerResizeHandler(handler) {}
  8073. /**
  8074. * Deregisters an event handler for the window resize event
  8075. * @param {function(!Event): undefined} handler
  8076. */
  8077. }, {
  8078. key: "deregisterResizeHandler",
  8079. value: function deregisterResizeHandler(handler) {}
  8080. /**
  8081. * Emits a custom event MDCSlider:input from the root
  8082. */
  8083. }, {
  8084. key: "notifyInput",
  8085. value: function notifyInput() {}
  8086. /**
  8087. * Emits a custom event MDCSlider:change from the root
  8088. */
  8089. }, {
  8090. key: "notifyChange",
  8091. value: function notifyChange() {}
  8092. /**
  8093. * Sets a style property of the thumb container element to the passed value
  8094. * @param {string} propertyName
  8095. * @param {string} value
  8096. */
  8097. }, {
  8098. key: "setThumbContainerStyleProperty",
  8099. value: function setThumbContainerStyleProperty(propertyName, value) {}
  8100. /**
  8101. * Sets a style property of the track element to the passed value
  8102. * @param {string} propertyName
  8103. * @param {string} value
  8104. */
  8105. }, {
  8106. key: "setTrackStyleProperty",
  8107. value: function setTrackStyleProperty(propertyName, value) {}
  8108. /**
  8109. * Sets the inner text of the pin marker to the passed value
  8110. * @param {number} value
  8111. */
  8112. }, {
  8113. key: "setMarkerValue",
  8114. value: function setMarkerValue(value) {}
  8115. /**
  8116. * Appends the passed number of track markers to the track mark container element
  8117. * @param {number} numMarkers
  8118. */
  8119. }, {
  8120. key: "appendTrackMarkers",
  8121. value: function appendTrackMarkers(numMarkers) {}
  8122. /**
  8123. * Removes all track markers fromt he track mark container element
  8124. */
  8125. }, {
  8126. key: "removeTrackMarkers",
  8127. value: function removeTrackMarkers() {}
  8128. /**
  8129. * Sets a style property of the last track marker to the passed value
  8130. * @param {string} propertyName
  8131. * @param {string} value
  8132. */
  8133. }, {
  8134. key: "setLastTrackMarkersStyleProperty",
  8135. value: function setLastTrackMarkersStyleProperty(propertyName, value) {}
  8136. /**
  8137. * Returns true if the root element is RTL, otherwise false
  8138. * @return {boolean}
  8139. */
  8140. }, {
  8141. key: "isRTL",
  8142. value: function isRTL() {}
  8143. }]);
  8144. return MDCSliderAdapter;
  8145. }();
  8146. /* unused harmony default export */ var _unused_webpack_default_export = (MDCSliderAdapter);
  8147. /***/ }),
  8148. /* 54 */
  8149. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8150. "use strict";
  8151. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  8152. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTab", function() { return MDCTab; });
  8153. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  8154. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__ = __webpack_require__(2);
  8155. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_tab_indicator_index__ = __webpack_require__(55);
  8156. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__adapter__ = __webpack_require__(10);
  8157. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation__ = __webpack_require__(140);
  8158. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTabFoundation", function() { return __WEBPACK_IMPORTED_MODULE_4__foundation__["a"]; });
  8159. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  8160. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  8161. var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
  8162. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8163. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  8164. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  8165. /**
  8166. * @license
  8167. * Copyright 2018 Google Inc.
  8168. *
  8169. * Permission is hereby granted, free of charge, to any person obtaining a copy
  8170. * of this software and associated documentation files (the "Software"), to deal
  8171. * in the Software without restriction, including without limitation the rights
  8172. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8173. * copies of the Software, and to permit persons to whom the Software is
  8174. * furnished to do so, subject to the following conditions:
  8175. *
  8176. * The above copyright notice and this permission notice shall be included in
  8177. * all copies or substantial portions of the Software.
  8178. *
  8179. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  8180. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  8181. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  8182. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  8183. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  8184. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  8185. * THE SOFTWARE.
  8186. */
  8187. /* eslint-disable no-unused-vars */
  8188. /* eslint-enable no-unused-vars */
  8189. /**
  8190. * @extends {MDCComponent<!MDCTabFoundation>}
  8191. * @final
  8192. */
  8193. var MDCTab = function (_MDCComponent) {
  8194. _inherits(MDCTab, _MDCComponent);
  8195. /**
  8196. * @param {...?} args
  8197. */
  8198. function MDCTab() {
  8199. var _ref;
  8200. _classCallCheck(this, MDCTab);
  8201. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  8202. args[_key] = arguments[_key];
  8203. }
  8204. /** @type {string} */
  8205. var _this = _possibleConstructorReturn(this, (_ref = MDCTab.__proto__ || Object.getPrototypeOf(MDCTab)).call.apply(_ref, [this].concat(args)));
  8206. _this.id;
  8207. /** @private {?MDCRipple} */
  8208. _this.ripple_;
  8209. /** @private {?MDCTabIndicator} */
  8210. _this.tabIndicator_;
  8211. /** @private {?Element} */
  8212. _this.content_;
  8213. /** @private {?Function} */
  8214. _this.handleClick_;
  8215. return _this;
  8216. }
  8217. /**
  8218. * @param {!Element} root
  8219. * @return {!MDCTab}
  8220. */
  8221. _createClass(MDCTab, [{
  8222. key: 'initialize',
  8223. value: function initialize() {
  8224. var rippleFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (el, foundation) {
  8225. return new __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRipple"](el, foundation);
  8226. };
  8227. var tabIndicatorFactory = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (el) {
  8228. return new __WEBPACK_IMPORTED_MODULE_2__material_tab_indicator_index__["MDCTabIndicator"](el);
  8229. };
  8230. this.id = this.root_.id;
  8231. var rippleSurface = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* default */].strings.RIPPLE_SELECTOR);
  8232. var rippleAdapter = _extends(__WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRipple"].createAdapter( /** @type {!RippleCapableSurface} */this), {
  8233. addClass: function addClass(className) {
  8234. return rippleSurface.classList.add(className);
  8235. },
  8236. removeClass: function removeClass(className) {
  8237. return rippleSurface.classList.remove(className);
  8238. },
  8239. updateCssVariable: function updateCssVariable(varName, value) {
  8240. return rippleSurface.style.setProperty(varName, value);
  8241. }
  8242. });
  8243. var rippleFoundation = new __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRippleFoundation"](rippleAdapter);
  8244. this.ripple_ = rippleFactory(this.root_, rippleFoundation);
  8245. var tabIndicatorElement = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* default */].strings.TAB_INDICATOR_SELECTOR);
  8246. this.tabIndicator_ = tabIndicatorFactory(tabIndicatorElement);
  8247. this.content_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* default */].strings.CONTENT_SELECTOR);
  8248. }
  8249. }, {
  8250. key: 'initialSyncWithDOM',
  8251. value: function initialSyncWithDOM() {
  8252. this.handleClick_ = this.foundation_.handleClick.bind(this.foundation_);
  8253. this.listen('click', this.handleClick_);
  8254. }
  8255. }, {
  8256. key: 'destroy',
  8257. value: function destroy() {
  8258. this.unlisten('click', /** @type {!Function} */this.handleClick_);
  8259. this.ripple_.destroy();
  8260. _get(MDCTab.prototype.__proto__ || Object.getPrototypeOf(MDCTab.prototype), 'destroy', this).call(this);
  8261. }
  8262. /**
  8263. * @return {!MDCTabFoundation}
  8264. */
  8265. }, {
  8266. key: 'getDefaultFoundation',
  8267. value: function getDefaultFoundation() {
  8268. var _this2 = this;
  8269. return new __WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* default */](
  8270. /** @type {!MDCTabAdapter} */{
  8271. setAttr: function setAttr(attr, value) {
  8272. return _this2.root_.setAttribute(attr, value);
  8273. },
  8274. addClass: function addClass(className) {
  8275. return _this2.root_.classList.add(className);
  8276. },
  8277. removeClass: function removeClass(className) {
  8278. return _this2.root_.classList.remove(className);
  8279. },
  8280. hasClass: function hasClass(className) {
  8281. return _this2.root_.classList.contains(className);
  8282. },
  8283. activateIndicator: function activateIndicator(previousIndicatorClientRect) {
  8284. return _this2.tabIndicator_.activate(previousIndicatorClientRect);
  8285. },
  8286. deactivateIndicator: function deactivateIndicator() {
  8287. return _this2.tabIndicator_.deactivate();
  8288. },
  8289. notifyInteracted: function notifyInteracted() {
  8290. return _this2.emit(__WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* default */].strings.INTERACTED_EVENT, { tabId: _this2.id }, true /* bubble */);
  8291. },
  8292. getOffsetLeft: function getOffsetLeft() {
  8293. return _this2.root_.offsetLeft;
  8294. },
  8295. getOffsetWidth: function getOffsetWidth() {
  8296. return _this2.root_.offsetWidth;
  8297. },
  8298. getContentOffsetLeft: function getContentOffsetLeft() {
  8299. return _this2.content_.offsetLeft;
  8300. },
  8301. getContentOffsetWidth: function getContentOffsetWidth() {
  8302. return _this2.content_.offsetWidth;
  8303. },
  8304. focus: function focus() {
  8305. return _this2.root_.focus();
  8306. }
  8307. });
  8308. }
  8309. /**
  8310. * Getter for the active state of the tab
  8311. * @return {boolean}
  8312. */
  8313. }, {
  8314. key: 'activate',
  8315. /**
  8316. * Activates the tab
  8317. * @param {!ClientRect=} computeIndicatorClientRect
  8318. */
  8319. value: function activate(computeIndicatorClientRect) {
  8320. this.foundation_.activate(computeIndicatorClientRect);
  8321. }
  8322. /**
  8323. * Deactivates the tab
  8324. */
  8325. }, {
  8326. key: 'deactivate',
  8327. value: function deactivate() {
  8328. this.foundation_.deactivate();
  8329. }
  8330. /**
  8331. * Returns the indicator's client rect
  8332. * @return {!ClientRect}
  8333. */
  8334. }, {
  8335. key: 'computeIndicatorClientRect',
  8336. value: function computeIndicatorClientRect() {
  8337. return this.tabIndicator_.computeContentClientRect();
  8338. }
  8339. /**
  8340. * @return {!MDCTabDimensions}
  8341. */
  8342. }, {
  8343. key: 'computeDimensions',
  8344. value: function computeDimensions() {
  8345. return this.foundation_.computeDimensions();
  8346. }
  8347. /**
  8348. * Focuses the tab
  8349. */
  8350. }, {
  8351. key: 'focus',
  8352. value: function focus() {
  8353. this.root_.focus();
  8354. }
  8355. }, {
  8356. key: 'active',
  8357. get: function get() {
  8358. return this.foundation_.isActive();
  8359. }
  8360. }, {
  8361. key: 'focusOnActivate',
  8362. set: function set(focusOnActivate) {
  8363. this.foundation_.setFocusOnActivate(focusOnActivate);
  8364. }
  8365. }], [{
  8366. key: 'attachTo',
  8367. value: function attachTo(root) {
  8368. return new MDCTab(root);
  8369. }
  8370. }]);
  8371. return MDCTab;
  8372. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  8373. /***/ }),
  8374. /* 55 */
  8375. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8376. "use strict";
  8377. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  8378. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTabIndicator", function() { return MDCTabIndicator; });
  8379. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  8380. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(56);
  8381. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(24);
  8382. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__sliding_foundation__ = __webpack_require__(138);
  8383. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__fading_foundation__ = __webpack_require__(139);
  8384. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTabIndicatorFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  8385. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSlidingTabIndicatorFoundation", function() { return __WEBPACK_IMPORTED_MODULE_3__sliding_foundation__["a"]; });
  8386. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCFadingTabIndicatorFoundation", function() { return __WEBPACK_IMPORTED_MODULE_4__fading_foundation__["a"]; });
  8387. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  8388. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  8389. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8390. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  8391. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  8392. /**
  8393. * @license
  8394. * Copyright 2018 Google Inc.
  8395. *
  8396. * Permission is hereby granted, free of charge, to any person obtaining a copy
  8397. * of this software and associated documentation files (the "Software"), to deal
  8398. * in the Software without restriction, including without limitation the rights
  8399. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8400. * copies of the Software, and to permit persons to whom the Software is
  8401. * furnished to do so, subject to the following conditions:
  8402. *
  8403. * The above copyright notice and this permission notice shall be included in
  8404. * all copies or substantial portions of the Software.
  8405. *
  8406. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  8407. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  8408. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  8409. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  8410. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  8411. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  8412. * THE SOFTWARE.
  8413. */
  8414. /**
  8415. * @extends {MDCComponent<!MDCTabIndicatorFoundation>}
  8416. * @final
  8417. */
  8418. var MDCTabIndicator = function (_MDCComponent) {
  8419. _inherits(MDCTabIndicator, _MDCComponent);
  8420. _createClass(MDCTabIndicator, null, [{
  8421. key: 'attachTo',
  8422. /**
  8423. * @param {!Element} root
  8424. * @return {!MDCTabIndicator}
  8425. */
  8426. value: function attachTo(root) {
  8427. return new MDCTabIndicator(root);
  8428. }
  8429. /**
  8430. * @param {...?} args
  8431. */
  8432. }]);
  8433. function MDCTabIndicator() {
  8434. var _ref;
  8435. _classCallCheck(this, MDCTabIndicator);
  8436. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  8437. args[_key] = arguments[_key];
  8438. }
  8439. /** @type {?Element} */
  8440. var _this = _possibleConstructorReturn(this, (_ref = MDCTabIndicator.__proto__ || Object.getPrototypeOf(MDCTabIndicator)).call.apply(_ref, [this].concat(args)));
  8441. _this.content_;
  8442. return _this;
  8443. }
  8444. _createClass(MDCTabIndicator, [{
  8445. key: 'initialize',
  8446. value: function initialize() {
  8447. this.content_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.CONTENT_SELECTOR);
  8448. }
  8449. /**
  8450. * @return {!ClientRect}
  8451. */
  8452. }, {
  8453. key: 'computeContentClientRect',
  8454. value: function computeContentClientRect() {
  8455. return this.foundation_.computeContentClientRect();
  8456. }
  8457. /**
  8458. * @return {!MDCTabIndicatorFoundation}
  8459. */
  8460. }, {
  8461. key: 'getDefaultFoundation',
  8462. value: function getDefaultFoundation() {
  8463. var _this2 = this;
  8464. var adapter = /** @type {!MDCTabIndicatorAdapter} */_extends({
  8465. addClass: function addClass(className) {
  8466. return _this2.root_.classList.add(className);
  8467. },
  8468. removeClass: function removeClass(className) {
  8469. return _this2.root_.classList.remove(className);
  8470. },
  8471. computeContentClientRect: function computeContentClientRect() {
  8472. return _this2.content_.getBoundingClientRect();
  8473. },
  8474. setContentStyleProperty: function setContentStyleProperty(prop, value) {
  8475. return _this2.content_.style.setProperty(prop, value);
  8476. }
  8477. });
  8478. if (this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].cssClasses.FADE)) {
  8479. return new __WEBPACK_IMPORTED_MODULE_4__fading_foundation__["a" /* default */](adapter);
  8480. }
  8481. // Default to the sliding indicator
  8482. return new __WEBPACK_IMPORTED_MODULE_3__sliding_foundation__["a" /* default */](adapter);
  8483. }
  8484. /**
  8485. * @param {!ClientRect=} previousIndicatorClientRect
  8486. */
  8487. }, {
  8488. key: 'activate',
  8489. value: function activate(previousIndicatorClientRect) {
  8490. this.foundation_.activate(previousIndicatorClientRect);
  8491. }
  8492. }, {
  8493. key: 'deactivate',
  8494. value: function deactivate() {
  8495. this.foundation_.deactivate();
  8496. }
  8497. }]);
  8498. return MDCTabIndicator;
  8499. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  8500. /***/ }),
  8501. /* 56 */
  8502. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8503. "use strict";
  8504. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  8505. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8506. /**
  8507. * @license
  8508. * Copyright 2018 Google Inc.
  8509. *
  8510. * Permission is hereby granted, free of charge, to any person obtaining a copy
  8511. * of this software and associated documentation files (the "Software"), to deal
  8512. * in the Software without restriction, including without limitation the rights
  8513. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8514. * copies of the Software, and to permit persons to whom the Software is
  8515. * furnished to do so, subject to the following conditions:
  8516. *
  8517. * The above copyright notice and this permission notice shall be included in
  8518. * all copies or substantial portions of the Software.
  8519. *
  8520. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  8521. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  8522. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  8523. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  8524. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  8525. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  8526. * THE SOFTWARE.
  8527. */
  8528. /* eslint no-unused-vars: [2, {"args": "none"}] */
  8529. /**
  8530. * Adapter for MDC Tab Indicator.
  8531. *
  8532. * Defines the shape of the adapter expected by the foundation. Implement this
  8533. * adapter to integrate the Tab Indicator into your framework. See
  8534. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  8535. * for more information.
  8536. *
  8537. * @record
  8538. */
  8539. var MDCTabIndicatorAdapter = function () {
  8540. function MDCTabIndicatorAdapter() {
  8541. _classCallCheck(this, MDCTabIndicatorAdapter);
  8542. }
  8543. _createClass(MDCTabIndicatorAdapter, [{
  8544. key: "addClass",
  8545. /**
  8546. * Adds the given className to the root element.
  8547. * @param {string} className The className to add
  8548. */
  8549. value: function addClass(className) {}
  8550. /**
  8551. * Removes the given className from the root element.
  8552. * @param {string} className The className to remove
  8553. */
  8554. }, {
  8555. key: "removeClass",
  8556. value: function removeClass(className) {}
  8557. /**
  8558. * Returns the client rect of the content element.
  8559. * @return {!ClientRect}
  8560. */
  8561. }, {
  8562. key: "computeContentClientRect",
  8563. value: function computeContentClientRect() {}
  8564. /**
  8565. * Sets a style property of the content element to the passed value
  8566. * @param {string} propName The style property name to set
  8567. * @param {string} value The style property value
  8568. */
  8569. }, {
  8570. key: "setContentStyleProperty",
  8571. value: function setContentStyleProperty(propName, value) {}
  8572. }]);
  8573. return MDCTabIndicatorAdapter;
  8574. }();
  8575. /* unused harmony default export */ var _unused_webpack_default_export = (MDCTabIndicatorAdapter);
  8576. /***/ }),
  8577. /* 57 */
  8578. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8579. "use strict";
  8580. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  8581. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTabScroller", function() { return MDCTabScroller; });
  8582. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  8583. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(4);
  8584. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(143);
  8585. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util__ = __webpack_require__(147);
  8586. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTabScrollerFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  8587. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "util", function() { return __WEBPACK_IMPORTED_MODULE_3__util__; });
  8588. var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
  8589. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  8590. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8591. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  8592. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  8593. /**
  8594. * @license
  8595. * Copyright 2018 Google Inc.
  8596. *
  8597. * Permission is hereby granted, free of charge, to any person obtaining a copy
  8598. * of this software and associated documentation files (the "Software"), to deal
  8599. * in the Software without restriction, including without limitation the rights
  8600. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8601. * copies of the Software, and to permit persons to whom the Software is
  8602. * furnished to do so, subject to the following conditions:
  8603. *
  8604. * The above copyright notice and this permission notice shall be included in
  8605. * all copies or substantial portions of the Software.
  8606. *
  8607. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  8608. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  8609. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  8610. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  8611. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  8612. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  8613. * THE SOFTWARE.
  8614. */
  8615. /**
  8616. * @extends {MDCComponent<!MDCTabScrollerFoundation>}
  8617. * @final
  8618. */
  8619. var MDCTabScroller = function (_MDCComponent) {
  8620. _inherits(MDCTabScroller, _MDCComponent);
  8621. _createClass(MDCTabScroller, null, [{
  8622. key: 'attachTo',
  8623. /**
  8624. * @param {!Element} root
  8625. * @return {!MDCTabScroller}
  8626. */
  8627. value: function attachTo(root) {
  8628. return new MDCTabScroller(root);
  8629. }
  8630. }]);
  8631. function MDCTabScroller() {
  8632. var _ref;
  8633. _classCallCheck(this, MDCTabScroller);
  8634. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  8635. args[_key] = arguments[_key];
  8636. }
  8637. /** @private {?Element} */
  8638. var _this = _possibleConstructorReturn(this, (_ref = MDCTabScroller.__proto__ || Object.getPrototypeOf(MDCTabScroller)).call.apply(_ref, [this].concat(args)));
  8639. _this.content_;
  8640. /** @private {?Element} */
  8641. _this.area_;
  8642. /** @private {?function(?Event): undefined} */
  8643. _this.handleInteraction_;
  8644. /** @private {?function(!Event): undefined} */
  8645. _this.handleTransitionEnd_;
  8646. return _this;
  8647. }
  8648. _createClass(MDCTabScroller, [{
  8649. key: 'initialize',
  8650. value: function initialize() {
  8651. this.area_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.AREA_SELECTOR);
  8652. this.content_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.CONTENT_SELECTOR);
  8653. }
  8654. }, {
  8655. key: 'initialSyncWithDOM',
  8656. value: function initialSyncWithDOM() {
  8657. var _this2 = this;
  8658. this.handleInteraction_ = function () {
  8659. return _this2.foundation_.handleInteraction();
  8660. };
  8661. this.handleTransitionEnd_ = function (evt) {
  8662. return _this2.foundation_.handleTransitionEnd(evt);
  8663. };
  8664. this.area_.addEventListener('wheel', this.handleInteraction_);
  8665. this.area_.addEventListener('touchstart', this.handleInteraction_);
  8666. this.area_.addEventListener('pointerdown', this.handleInteraction_);
  8667. this.area_.addEventListener('mousedown', this.handleInteraction_);
  8668. this.area_.addEventListener('keydown', this.handleInteraction_);
  8669. this.content_.addEventListener('transitionend', this.handleTransitionEnd_);
  8670. }
  8671. }, {
  8672. key: 'destroy',
  8673. value: function destroy() {
  8674. _get(MDCTabScroller.prototype.__proto__ || Object.getPrototypeOf(MDCTabScroller.prototype), 'destroy', this).call(this);
  8675. this.area_.removeEventListener('wheel', this.handleInteraction_);
  8676. this.area_.removeEventListener('touchstart', this.handleInteraction_);
  8677. this.area_.removeEventListener('pointerdown', this.handleInteraction_);
  8678. this.area_.removeEventListener('mousedown', this.handleInteraction_);
  8679. this.area_.removeEventListener('keydown', this.handleInteraction_);
  8680. this.content_.removeEventListener('transitionend', this.handleTransitionEnd_);
  8681. }
  8682. /**
  8683. * @return {!MDCTabScrollerFoundation}
  8684. */
  8685. }, {
  8686. key: 'getDefaultFoundation',
  8687. value: function getDefaultFoundation() {
  8688. var _this3 = this;
  8689. var adapter = /** @type {!MDCTabScrollerAdapter} */{
  8690. eventTargetMatchesSelector: function eventTargetMatchesSelector(evtTarget, selector) {
  8691. var MATCHES = __WEBPACK_IMPORTED_MODULE_3__util__["getMatchesProperty"](HTMLElement.prototype);
  8692. return evtTarget[MATCHES](selector);
  8693. },
  8694. addClass: function addClass(className) {
  8695. return _this3.root_.classList.add(className);
  8696. },
  8697. removeClass: function removeClass(className) {
  8698. return _this3.root_.classList.remove(className);
  8699. },
  8700. addScrollAreaClass: function addScrollAreaClass(className) {
  8701. return _this3.area_.classList.add(className);
  8702. },
  8703. setScrollAreaStyleProperty: function setScrollAreaStyleProperty(prop, value) {
  8704. return _this3.area_.style.setProperty(prop, value);
  8705. },
  8706. setScrollContentStyleProperty: function setScrollContentStyleProperty(prop, value) {
  8707. return _this3.content_.style.setProperty(prop, value);
  8708. },
  8709. getScrollContentStyleValue: function getScrollContentStyleValue(propName) {
  8710. return window.getComputedStyle(_this3.content_).getPropertyValue(propName);
  8711. },
  8712. setScrollAreaScrollLeft: function setScrollAreaScrollLeft(scrollX) {
  8713. return _this3.area_.scrollLeft = scrollX;
  8714. },
  8715. getScrollAreaScrollLeft: function getScrollAreaScrollLeft() {
  8716. return _this3.area_.scrollLeft;
  8717. },
  8718. getScrollContentOffsetWidth: function getScrollContentOffsetWidth() {
  8719. return _this3.content_.offsetWidth;
  8720. },
  8721. getScrollAreaOffsetWidth: function getScrollAreaOffsetWidth() {
  8722. return _this3.area_.offsetWidth;
  8723. },
  8724. computeScrollAreaClientRect: function computeScrollAreaClientRect() {
  8725. return _this3.area_.getBoundingClientRect();
  8726. },
  8727. computeScrollContentClientRect: function computeScrollContentClientRect() {
  8728. return _this3.content_.getBoundingClientRect();
  8729. },
  8730. computeHorizontalScrollbarHeight: function computeHorizontalScrollbarHeight() {
  8731. return __WEBPACK_IMPORTED_MODULE_3__util__["computeHorizontalScrollbarHeight"](document);
  8732. }
  8733. };
  8734. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */](adapter);
  8735. }
  8736. /**
  8737. * Returns the current visual scroll position
  8738. * @return {number}
  8739. */
  8740. }, {
  8741. key: 'getScrollPosition',
  8742. value: function getScrollPosition() {
  8743. return this.foundation_.getScrollPosition();
  8744. }
  8745. /**
  8746. * Returns the width of the scroll content
  8747. * @return {number}
  8748. */
  8749. }, {
  8750. key: 'getScrollContentWidth',
  8751. value: function getScrollContentWidth() {
  8752. return this.content_.offsetWidth;
  8753. }
  8754. /**
  8755. * Increments the scroll value by the given amount
  8756. * @param {number} scrollXIncrement The pixel value by which to increment the scroll value
  8757. */
  8758. }, {
  8759. key: 'incrementScroll',
  8760. value: function incrementScroll(scrollXIncrement) {
  8761. this.foundation_.incrementScroll(scrollXIncrement);
  8762. }
  8763. /**
  8764. * Scrolls to the given pixel position
  8765. * @param {number} scrollX The pixel value to scroll to
  8766. */
  8767. }, {
  8768. key: 'scrollTo',
  8769. value: function scrollTo(scrollX) {
  8770. this.foundation_.scrollTo(scrollX);
  8771. }
  8772. }]);
  8773. return MDCTabScroller;
  8774. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  8775. /***/ }),
  8776. /* 58 */
  8777. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8778. "use strict";
  8779. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  8780. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  8781. /**
  8782. * @license
  8783. * Copyright 2018 Google Inc.
  8784. *
  8785. * Permission is hereby granted, free of charge, to any person obtaining a copy
  8786. * of this software and associated documentation files (the "Software"), to deal
  8787. * in the Software without restriction, including without limitation the rights
  8788. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8789. * copies of the Software, and to permit persons to whom the Software is
  8790. * furnished to do so, subject to the following conditions:
  8791. *
  8792. * The above copyright notice and this permission notice shall be included in
  8793. * all copies or substantial portions of the Software.
  8794. *
  8795. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  8796. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  8797. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  8798. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  8799. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  8800. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  8801. * THE SOFTWARE.
  8802. */
  8803. /** @enum {string} */
  8804. var cssClasses = {
  8805. ANIMATING: 'mdc-tab-scroller--animating',
  8806. SCROLL_TEST: 'mdc-tab-scroller__test',
  8807. SCROLL_AREA_SCROLL: 'mdc-tab-scroller__scroll-area--scroll'
  8808. };
  8809. /** @enum {string} */
  8810. var strings = {
  8811. AREA_SELECTOR: '.mdc-tab-scroller__scroll-area',
  8812. CONTENT_SELECTOR: '.mdc-tab-scroller__scroll-content'
  8813. };
  8814. /***/ }),
  8815. /* 59 */
  8816. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8817. "use strict";
  8818. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_tab_adapter__ = __webpack_require__(10);
  8819. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  8820. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8821. /**
  8822. * @license
  8823. * Copyright 2018 Google Inc.
  8824. *
  8825. * Permission is hereby granted, free of charge, to any person obtaining a copy
  8826. * of this software and associated documentation files (the "Software"), to deal
  8827. * in the Software without restriction, including without limitation the rights
  8828. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8829. * copies of the Software, and to permit persons to whom the Software is
  8830. * furnished to do so, subject to the following conditions:
  8831. *
  8832. * The above copyright notice and this permission notice shall be included in
  8833. * all copies or substantial portions of the Software.
  8834. *
  8835. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  8836. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  8837. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  8838. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  8839. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  8840. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  8841. * THE SOFTWARE.
  8842. */
  8843. /* eslint no-unused-vars: [2, {"args": "none"}] */
  8844. /* eslint-disable no-unused-vars */
  8845. /* eslint-enable no-unused-vars */
  8846. /**
  8847. * Adapter for MDC Tab Bar.
  8848. *
  8849. * Defines the shape of the adapter expected by the foundation. Implement this
  8850. * adapter to integrate the Tab Bar into your framework. See
  8851. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  8852. * for more information.
  8853. *
  8854. * @record
  8855. */
  8856. var MDCTabBarAdapter = function () {
  8857. function MDCTabBarAdapter() {
  8858. _classCallCheck(this, MDCTabBarAdapter);
  8859. }
  8860. _createClass(MDCTabBarAdapter, [{
  8861. key: 'scrollTo',
  8862. /**
  8863. * Scrolls to the given position
  8864. * @param {number} scrollX The position to scroll to
  8865. */
  8866. value: function scrollTo(scrollX) {}
  8867. /**
  8868. * Increments the current scroll position by the given amount
  8869. * @param {number} scrollXIncrement The amount to increment scroll
  8870. */
  8871. }, {
  8872. key: 'incrementScroll',
  8873. value: function incrementScroll(scrollXIncrement) {}
  8874. /**
  8875. * Returns the current scroll position
  8876. * @return {number}
  8877. */
  8878. }, {
  8879. key: 'getScrollPosition',
  8880. value: function getScrollPosition() {}
  8881. /**
  8882. * Returns the width of the scroll content
  8883. * @return {number}
  8884. */
  8885. }, {
  8886. key: 'getScrollContentWidth',
  8887. value: function getScrollContentWidth() {}
  8888. /**
  8889. * Returns the root element's offsetWidth
  8890. * @return {number}
  8891. */
  8892. }, {
  8893. key: 'getOffsetWidth',
  8894. value: function getOffsetWidth() {}
  8895. /**
  8896. * Returns if the Tab Bar language direction is RTL
  8897. * @return {boolean}
  8898. */
  8899. }, {
  8900. key: 'isRTL',
  8901. value: function isRTL() {}
  8902. /**
  8903. * Sets the tab at the given index to be activated
  8904. * @param {number} index The index of the tab to activate
  8905. */
  8906. }, {
  8907. key: 'setActiveTab',
  8908. value: function setActiveTab(index) {}
  8909. /**
  8910. * Activates the tab at the given index with the given client rect
  8911. * @param {number} index The index of the tab to activate
  8912. * @param {!ClientRect} clientRect The client rect of the previously active Tab Indicator
  8913. */
  8914. }, {
  8915. key: 'activateTabAtIndex',
  8916. value: function activateTabAtIndex(index, clientRect) {}
  8917. /**
  8918. * Deactivates the tab at the given index
  8919. * @param {number} index The index of the tab to deactivate
  8920. */
  8921. }, {
  8922. key: 'deactivateTabAtIndex',
  8923. value: function deactivateTabAtIndex(index) {}
  8924. /**
  8925. * Focuses the tab at the given index
  8926. * @param {number} index The index of the tab to focus
  8927. */
  8928. }, {
  8929. key: 'focusTabAtIndex',
  8930. value: function focusTabAtIndex(index) {}
  8931. /**
  8932. * Returns the client rect of the tab's indicator
  8933. * @param {number} index The index of the tab
  8934. * @return {!ClientRect}
  8935. */
  8936. }, {
  8937. key: 'getTabIndicatorClientRectAtIndex',
  8938. value: function getTabIndicatorClientRectAtIndex(index) {}
  8939. /**
  8940. * Returns the tab dimensions of the tab at the given index
  8941. * @param {number} index The index of the tab
  8942. * @return {!MDCTabDimensions}
  8943. */
  8944. }, {
  8945. key: 'getTabDimensionsAtIndex',
  8946. value: function getTabDimensionsAtIndex(index) {}
  8947. /**
  8948. * Returns the length of the tab list
  8949. * @return {number}
  8950. */
  8951. }, {
  8952. key: 'getTabListLength',
  8953. value: function getTabListLength() {}
  8954. /**
  8955. * Returns the index of the previously active tab
  8956. * @return {number}
  8957. */
  8958. }, {
  8959. key: 'getPreviousActiveTabIndex',
  8960. value: function getPreviousActiveTabIndex() {}
  8961. /**
  8962. * Returns the index of the focused tab
  8963. * @return {number}
  8964. */
  8965. }, {
  8966. key: 'getFocusedTabIndex',
  8967. value: function getFocusedTabIndex() {}
  8968. /**
  8969. * Returns the index of the given tab
  8970. * @param {string} id The ID of the tab whose index to determine
  8971. * @return {number}
  8972. */
  8973. }, {
  8974. key: 'getIndexOfTabById',
  8975. value: function getIndexOfTabById(id) {}
  8976. /**
  8977. * Emits the MDCTabBar:activated event
  8978. * @param {number} index The index of the activated tab
  8979. */
  8980. }, {
  8981. key: 'notifyTabActivated',
  8982. value: function notifyTabActivated(index) {}
  8983. }]);
  8984. return MDCTabBarAdapter;
  8985. }();
  8986. /* unused harmony default export */ var _unused_webpack_default_export = (MDCTabBarAdapter);
  8987. /***/ }),
  8988. /* 60 */
  8989. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8990. "use strict";
  8991. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return cssClasses; });
  8992. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return strings; });
  8993. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return numbers; });
  8994. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return VALIDATION_ATTR_WHITELIST; });
  8995. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ALWAYS_FLOAT_TYPES; });
  8996. /**
  8997. * @license
  8998. * Copyright 2016 Google Inc.
  8999. *
  9000. * Permission is hereby granted, free of charge, to any person obtaining a copy
  9001. * of this software and associated documentation files (the "Software"), to deal
  9002. * in the Software without restriction, including without limitation the rights
  9003. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9004. * copies of the Software, and to permit persons to whom the Software is
  9005. * furnished to do so, subject to the following conditions:
  9006. *
  9007. * The above copyright notice and this permission notice shall be included in
  9008. * all copies or substantial portions of the Software.
  9009. *
  9010. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  9011. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  9012. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  9013. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  9014. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  9015. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  9016. * THE SOFTWARE.
  9017. */
  9018. /** @enum {string} */
  9019. var strings = {
  9020. ARIA_CONTROLS: 'aria-controls',
  9021. INPUT_SELECTOR: '.mdc-text-field__input',
  9022. LABEL_SELECTOR: '.mdc-floating-label',
  9023. ICON_SELECTOR: '.mdc-text-field__icon',
  9024. OUTLINE_SELECTOR: '.mdc-notched-outline',
  9025. LINE_RIPPLE_SELECTOR: '.mdc-line-ripple'
  9026. };
  9027. /** @enum {string} */
  9028. var cssClasses = {
  9029. ROOT: 'mdc-text-field',
  9030. DISABLED: 'mdc-text-field--disabled',
  9031. DENSE: 'mdc-text-field--dense',
  9032. FOCUSED: 'mdc-text-field--focused',
  9033. INVALID: 'mdc-text-field--invalid',
  9034. TEXTAREA: 'mdc-text-field--textarea',
  9035. OUTLINED: 'mdc-text-field--outlined',
  9036. WITH_LEADING_ICON: 'mdc-text-field--with-leading-icon',
  9037. HELPER_LINE: 'mdc-text-field-helper-line'
  9038. };
  9039. /** @enum {number} */
  9040. var numbers = {
  9041. LABEL_SCALE: 0.75,
  9042. DENSE_LABEL_SCALE: 0.923
  9043. };
  9044. // whitelist based off of https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation
  9045. // under section: `Validation-related attributes`
  9046. var VALIDATION_ATTR_WHITELIST = ['pattern', 'min', 'max', 'required', 'step', 'minlength', 'maxlength'];
  9047. // Label should always float for these types as they show some UI even if value is empty.
  9048. var ALWAYS_FLOAT_TYPES = ['color', 'date', 'datetime-local', 'month', 'range', 'time', 'week'];
  9049. /***/ }),
  9050. /* 61 */
  9051. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9052. "use strict";
  9053. /* unused harmony export MDCTextFieldAdapter */
  9054. /* unused harmony export NativeInputType */
  9055. /* unused harmony export FoundationMapType */
  9056. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__helper_text_foundation__ = __webpack_require__(25);
  9057. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__character_counter_foundation__ = __webpack_require__(26);
  9058. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__icon_foundation__ = __webpack_require__(27);
  9059. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  9060. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9061. /**
  9062. * @license
  9063. * Copyright 2017 Google Inc.
  9064. *
  9065. * Permission is hereby granted, free of charge, to any person obtaining a copy
  9066. * of this software and associated documentation files (the "Software"), to deal
  9067. * in the Software without restriction, including without limitation the rights
  9068. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9069. * copies of the Software, and to permit persons to whom the Software is
  9070. * furnished to do so, subject to the following conditions:
  9071. *
  9072. * The above copyright notice and this permission notice shall be included in
  9073. * all copies or substantial portions of the Software.
  9074. *
  9075. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  9076. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  9077. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  9078. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  9079. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  9080. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  9081. * THE SOFTWARE.
  9082. */
  9083. /* eslint-disable no-unused-vars */
  9084. /* eslint-disable no-unused-vars */
  9085. /* eslint no-unused-vars: [2, {"args": "none"}] */
  9086. /**
  9087. * @typedef {{
  9088. * value: string,
  9089. * disabled: boolean,
  9090. * badInput: boolean,
  9091. * validity: {
  9092. * badInput: boolean,
  9093. * valid: boolean,
  9094. * },
  9095. * }}
  9096. */
  9097. var NativeInputType = void 0;
  9098. /**
  9099. * @typedef {{
  9100. * helperText: (!MDCTextFieldHelperTextFoundation|undefined),
  9101. * characterCounter: (!MDCTextFieldCharacterCounterFoundation|undefined),
  9102. * leadingIcon: (!MDCTextFieldIconFoundation|undefined),
  9103. * trailingIcon: (!MDCTextFieldIconFoundation|undefined),
  9104. * }}
  9105. */
  9106. var FoundationMapType = void 0;
  9107. /**
  9108. * Adapter for MDC Text Field.
  9109. *
  9110. * Defines the shape of the adapter expected by the foundation. Implement this
  9111. * adapter to integrate the Text Field into your framework. See
  9112. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  9113. * for more information.
  9114. *
  9115. * @record
  9116. */
  9117. var MDCTextFieldAdapter = function () {
  9118. function MDCTextFieldAdapter() {
  9119. _classCallCheck(this, MDCTextFieldAdapter);
  9120. }
  9121. _createClass(MDCTextFieldAdapter, [{
  9122. key: 'addClass',
  9123. /**
  9124. * Adds a class to the root Element.
  9125. * @param {string} className
  9126. */
  9127. value: function addClass(className) {}
  9128. /**
  9129. * Removes a class from the root Element.
  9130. * @param {string} className
  9131. */
  9132. }, {
  9133. key: 'removeClass',
  9134. value: function removeClass(className) {}
  9135. /**
  9136. * Returns true if the root element contains the given class name.
  9137. * @param {string} className
  9138. * @return {boolean}
  9139. */
  9140. }, {
  9141. key: 'hasClass',
  9142. value: function hasClass(className) {}
  9143. /**
  9144. * Registers an event handler on the root element for a given event.
  9145. * @param {string} type
  9146. * @param {function(!Event): undefined} handler
  9147. */
  9148. }, {
  9149. key: 'registerTextFieldInteractionHandler',
  9150. value: function registerTextFieldInteractionHandler(type, handler) {}
  9151. /**
  9152. * Deregisters an event handler on the root element for a given event.
  9153. * @param {string} type
  9154. * @param {function(!Event): undefined} handler
  9155. */
  9156. }, {
  9157. key: 'deregisterTextFieldInteractionHandler',
  9158. value: function deregisterTextFieldInteractionHandler(type, handler) {}
  9159. /**
  9160. * Registers an event listener on the native input element for a given event.
  9161. * @param {string} evtType
  9162. * @param {function(!Event): undefined} handler
  9163. */
  9164. }, {
  9165. key: 'registerInputInteractionHandler',
  9166. value: function registerInputInteractionHandler(evtType, handler) {}
  9167. /**
  9168. * Deregisters an event listener on the native input element for a given event.
  9169. * @param {string} evtType
  9170. * @param {function(!Event): undefined} handler
  9171. */
  9172. }, {
  9173. key: 'deregisterInputInteractionHandler',
  9174. value: function deregisterInputInteractionHandler(evtType, handler) {}
  9175. /**
  9176. * Registers a validation attribute change listener on the input element.
  9177. * Handler accepts list of attribute names.
  9178. * @param {function(!Array<string>): undefined} handler
  9179. * @return {!MutationObserver}
  9180. */
  9181. }, {
  9182. key: 'registerValidationAttributeChangeHandler',
  9183. value: function registerValidationAttributeChangeHandler(handler) {}
  9184. /**
  9185. * Disconnects a validation attribute observer on the input element.
  9186. * @param {!MutationObserver} observer
  9187. */
  9188. }, {
  9189. key: 'deregisterValidationAttributeChangeHandler',
  9190. value: function deregisterValidationAttributeChangeHandler(observer) {}
  9191. /**
  9192. * Returns an object representing the native text input element, with a
  9193. * similar API shape. The object returned should include the value, disabled
  9194. * and badInput properties, as well as the checkValidity() function. We never
  9195. * alter the value within our code, however we do update the disabled
  9196. * property, so if you choose to duck-type the return value for this method
  9197. * in your implementation it's important to keep this in mind. Also note that
  9198. * this method can return null, which the foundation will handle gracefully.
  9199. * @return {?Element|?NativeInputType}
  9200. */
  9201. }, {
  9202. key: 'getNativeInput',
  9203. value: function getNativeInput() {}
  9204. /**
  9205. * Returns true if the textfield is focused.
  9206. * We achieve this via `document.activeElement === this.root_`.
  9207. * @return {boolean}
  9208. */
  9209. }, {
  9210. key: 'isFocused',
  9211. value: function isFocused() {}
  9212. /**
  9213. * Activates the line ripple.
  9214. */
  9215. }, {
  9216. key: 'activateLineRipple',
  9217. value: function activateLineRipple() {}
  9218. /**
  9219. * Deactivates the line ripple.
  9220. */
  9221. }, {
  9222. key: 'deactivateLineRipple',
  9223. value: function deactivateLineRipple() {}
  9224. /**
  9225. * Sets the transform origin of the line ripple.
  9226. * @param {number} normalizedX
  9227. */
  9228. }, {
  9229. key: 'setLineRippleTransformOrigin',
  9230. value: function setLineRippleTransformOrigin(normalizedX) {}
  9231. /**
  9232. * Only implement if label exists.
  9233. * Shakes label if shouldShake is true.
  9234. * @param {boolean} shouldShake
  9235. */
  9236. }, {
  9237. key: 'shakeLabel',
  9238. value: function shakeLabel(shouldShake) {}
  9239. /**
  9240. * Only implement if label exists.
  9241. * Floats the label above the input element if shouldFloat is true.
  9242. * @param {boolean} shouldFloat
  9243. */
  9244. }, {
  9245. key: 'floatLabel',
  9246. value: function floatLabel(shouldFloat) {}
  9247. /**
  9248. * Returns true if label element exists, false if it doesn't.
  9249. * @return {boolean}
  9250. */
  9251. }, {
  9252. key: 'hasLabel',
  9253. value: function hasLabel() {}
  9254. /**
  9255. * Only implement if label exists.
  9256. * Returns width of label in pixels.
  9257. * @return {number}
  9258. */
  9259. }, {
  9260. key: 'getLabelWidth',
  9261. value: function getLabelWidth() {}
  9262. /**
  9263. * Returns true if outline element exists, false if it doesn't.
  9264. * @return {boolean}
  9265. */
  9266. }, {
  9267. key: 'hasOutline',
  9268. value: function hasOutline() {}
  9269. /**
  9270. * Only implement if outline element exists.
  9271. * @param {number} labelWidth
  9272. */
  9273. }, {
  9274. key: 'notchOutline',
  9275. value: function notchOutline(labelWidth) {}
  9276. /**
  9277. * Only implement if outline element exists.
  9278. * Closes notch in outline element.
  9279. */
  9280. }, {
  9281. key: 'closeOutline',
  9282. value: function closeOutline() {}
  9283. }]);
  9284. return MDCTextFieldAdapter;
  9285. }();
  9286. /***/ }),
  9287. /* 62 */
  9288. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9289. "use strict";
  9290. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  9291. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9292. /**
  9293. * @license
  9294. * Copyright 2017 Google Inc.
  9295. *
  9296. * Permission is hereby granted, free of charge, to any person obtaining a copy
  9297. * of this software and associated documentation files (the "Software"), to deal
  9298. * in the Software without restriction, including without limitation the rights
  9299. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9300. * copies of the Software, and to permit persons to whom the Software is
  9301. * furnished to do so, subject to the following conditions:
  9302. *
  9303. * The above copyright notice and this permission notice shall be included in
  9304. * all copies or substantial portions of the Software.
  9305. *
  9306. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  9307. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  9308. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  9309. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  9310. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  9311. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  9312. * THE SOFTWARE.
  9313. */
  9314. /* eslint no-unused-vars: [2, {"args": "none"}] */
  9315. /**
  9316. * Adapter for MDC Text Field Helper Text.
  9317. *
  9318. * Defines the shape of the adapter expected by the foundation. Implement this
  9319. * adapter to integrate the TextField helper text into your framework. See
  9320. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  9321. * for more information.
  9322. *
  9323. * @record
  9324. */
  9325. var MDCTextFieldHelperTextAdapter = function () {
  9326. function MDCTextFieldHelperTextAdapter() {
  9327. _classCallCheck(this, MDCTextFieldHelperTextAdapter);
  9328. }
  9329. _createClass(MDCTextFieldHelperTextAdapter, [{
  9330. key: "addClass",
  9331. /**
  9332. * Adds a class to the helper text element.
  9333. * @param {string} className
  9334. */
  9335. value: function addClass(className) {}
  9336. /**
  9337. * Removes a class from the helper text element.
  9338. * @param {string} className
  9339. */
  9340. }, {
  9341. key: "removeClass",
  9342. value: function removeClass(className) {}
  9343. /**
  9344. * Returns whether or not the helper text element contains the given class.
  9345. * @param {string} className
  9346. * @return {boolean}
  9347. */
  9348. }, {
  9349. key: "hasClass",
  9350. value: function hasClass(className) {}
  9351. /**
  9352. * Sets an attribute with a given value on the helper text element.
  9353. * @param {string} attr
  9354. * @param {string} value
  9355. */
  9356. }, {
  9357. key: "setAttr",
  9358. value: function setAttr(attr, value) {}
  9359. /**
  9360. * Removes an attribute from the helper text element.
  9361. * @param {string} attr
  9362. */
  9363. }, {
  9364. key: "removeAttr",
  9365. value: function removeAttr(attr) {}
  9366. /**
  9367. * Sets the text content for the helper text element.
  9368. * @param {string} content
  9369. */
  9370. }, {
  9371. key: "setContent",
  9372. value: function setContent(content) {}
  9373. }]);
  9374. return MDCTextFieldHelperTextAdapter;
  9375. }();
  9376. /* unused harmony default export */ var _unused_webpack_default_export = (MDCTextFieldHelperTextAdapter);
  9377. /***/ }),
  9378. /* 63 */
  9379. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9380. "use strict";
  9381. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  9382. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9383. /**
  9384. * @license
  9385. * Copyright 2019 Google Inc.
  9386. *
  9387. * Permission is hereby granted, free of charge, to any person obtaining a copy
  9388. * of this software and associated documentation files (the "Software"), to deal
  9389. * in the Software without restriction, including without limitation the rights
  9390. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9391. * copies of the Software, and to permit persons to whom the Software is
  9392. * furnished to do so, subject to the following conditions:
  9393. *
  9394. * The above copyright notice and this permission notice shall be included in
  9395. * all copies or substantial portions of the Software.
  9396. *
  9397. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  9398. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  9399. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  9400. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  9401. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  9402. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  9403. * THE SOFTWARE.
  9404. */
  9405. /* eslint no-unused-vars: [2, {"args": "none"}] */
  9406. /**
  9407. * Adapter for MDC Text Field Character Counter.
  9408. *
  9409. * Defines the shape of the adapter expected by the foundation. Implement this
  9410. * adapter to integrate the TextField character counter into your framework. See
  9411. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  9412. * for more information.
  9413. *
  9414. * @record
  9415. */
  9416. var MDCTextFieldCharacterCounterAdapter = function () {
  9417. function MDCTextFieldCharacterCounterAdapter() {
  9418. _classCallCheck(this, MDCTextFieldCharacterCounterAdapter);
  9419. }
  9420. _createClass(MDCTextFieldCharacterCounterAdapter, [{
  9421. key: "setContent",
  9422. /**
  9423. * Sets the text content of character counter element.
  9424. * @param {string} content
  9425. */
  9426. value: function setContent(content) {}
  9427. }]);
  9428. return MDCTextFieldCharacterCounterAdapter;
  9429. }();
  9430. /* unused harmony default export */ var _unused_webpack_default_export = (MDCTextFieldCharacterCounterAdapter);
  9431. /***/ }),
  9432. /* 64 */
  9433. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9434. "use strict";
  9435. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  9436. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9437. /**
  9438. * @license
  9439. * Copyright 2017 Google Inc.
  9440. *
  9441. * Permission is hereby granted, free of charge, to any person obtaining a copy
  9442. * of this software and associated documentation files (the "Software"), to deal
  9443. * in the Software without restriction, including without limitation the rights
  9444. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9445. * copies of the Software, and to permit persons to whom the Software is
  9446. * furnished to do so, subject to the following conditions:
  9447. *
  9448. * The above copyright notice and this permission notice shall be included in
  9449. * all copies or substantial portions of the Software.
  9450. *
  9451. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  9452. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  9453. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  9454. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  9455. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  9456. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  9457. * THE SOFTWARE.
  9458. */
  9459. /* eslint no-unused-vars: [2, {"args": "none"}] */
  9460. /**
  9461. * Adapter for MDC Text Field Icon.
  9462. *
  9463. * Defines the shape of the adapter expected by the foundation. Implement this
  9464. * adapter to integrate the text field icon into your framework. See
  9465. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  9466. * for more information.
  9467. *
  9468. * @record
  9469. */
  9470. var MDCTextFieldIconAdapter = function () {
  9471. function MDCTextFieldIconAdapter() {
  9472. _classCallCheck(this, MDCTextFieldIconAdapter);
  9473. }
  9474. _createClass(MDCTextFieldIconAdapter, [{
  9475. key: "getAttr",
  9476. /**
  9477. * Gets the value of an attribute on the icon element.
  9478. * @param {string} attr
  9479. * @return {string}
  9480. */
  9481. value: function getAttr(attr) {}
  9482. /**
  9483. * Sets an attribute on the icon element.
  9484. * @param {string} attr
  9485. * @param {string} value
  9486. */
  9487. }, {
  9488. key: "setAttr",
  9489. value: function setAttr(attr, value) {}
  9490. /**
  9491. * Removes an attribute from the icon element.
  9492. * @param {string} attr
  9493. */
  9494. }, {
  9495. key: "removeAttr",
  9496. value: function removeAttr(attr) {}
  9497. /**
  9498. * Sets the text content of the icon element.
  9499. * @param {string} content
  9500. */
  9501. }, {
  9502. key: "setContent",
  9503. value: function setContent(content) {}
  9504. /**
  9505. * Registers an event listener on the icon element for a given event.
  9506. * @param {string} evtType
  9507. * @param {function(!Event): undefined} handler
  9508. */
  9509. }, {
  9510. key: "registerInteractionHandler",
  9511. value: function registerInteractionHandler(evtType, handler) {}
  9512. /**
  9513. * Deregisters an event listener on the icon element for a given event.
  9514. * @param {string} evtType
  9515. * @param {function(!Event): undefined} handler
  9516. */
  9517. }, {
  9518. key: "deregisterInteractionHandler",
  9519. value: function deregisterInteractionHandler(evtType, handler) {}
  9520. /**
  9521. * Emits a custom event "MDCTextField:icon" denoting a user has clicked the icon.
  9522. */
  9523. }, {
  9524. key: "notifyIconAction",
  9525. value: function notifyIconAction() {}
  9526. }]);
  9527. return MDCTextFieldIconAdapter;
  9528. }();
  9529. /* unused harmony default export */ var _unused_webpack_default_export = (MDCTextFieldIconAdapter);
  9530. /***/ }),
  9531. /* 65 */
  9532. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9533. "use strict";
  9534. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  9535. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__ = __webpack_require__(66);
  9536. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_index__ = __webpack_require__(67);
  9537. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_checkbox_index__ = __webpack_require__(68);
  9538. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_chips_index__ = __webpack_require__(74);
  9539. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__material_dialog_index__ = __webpack_require__(78);
  9540. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__material_dom_index__ = __webpack_require__(85);
  9541. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__material_drawer_index__ = __webpack_require__(86);
  9542. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__material_floating_label_index__ = __webpack_require__(9);
  9543. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__material_form_field_index__ = __webpack_require__(93);
  9544. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__material_grid_list_index__ = __webpack_require__(97);
  9545. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__material_icon_button_index__ = __webpack_require__(100);
  9546. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__material_icon_toggle_index__ = __webpack_require__(104);
  9547. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__material_linear_progress_index__ = __webpack_require__(108);
  9548. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__material_line_ripple_index__ = __webpack_require__(16);
  9549. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__material_list_index__ = __webpack_require__(14);
  9550. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__material_menu_index__ = __webpack_require__(43);
  9551. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__material_menu_surface_index__ = __webpack_require__(45);
  9552. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__material_notched_outline_index__ = __webpack_require__(20);
  9553. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__material_radio_index__ = __webpack_require__(117);
  9554. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__material_ripple_index__ = __webpack_require__(2);
  9555. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__material_select_index__ = __webpack_require__(121);
  9556. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_21__material_selection_control_index__ = __webpack_require__(3);
  9557. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_22__material_slider_index__ = __webpack_require__(127);
  9558. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_23__material_snackbar_index__ = __webpack_require__(129);
  9559. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_24__material_switch_index__ = __webpack_require__(133);
  9560. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_25__material_tab_index__ = __webpack_require__(54);
  9561. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_26__material_tab_bar_index__ = __webpack_require__(142);
  9562. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_27__material_tab_indicator_index__ = __webpack_require__(55);
  9563. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_28__material_tab_scroller_index__ = __webpack_require__(57);
  9564. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_29__material_textfield_index__ = __webpack_require__(150);
  9565. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_30__material_toolbar_index__ = __webpack_require__(158);
  9566. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_31__material_top_app_bar_index__ = __webpack_require__(161);
  9567. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "autoInit", function() { return __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a"]; });
  9568. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "base", function() { return __WEBPACK_IMPORTED_MODULE_1__material_base_index__; });
  9569. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "checkbox", function() { return __WEBPACK_IMPORTED_MODULE_2__material_checkbox_index__; });
  9570. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "chips", function() { return __WEBPACK_IMPORTED_MODULE_3__material_chips_index__; });
  9571. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "dialog", function() { return __WEBPACK_IMPORTED_MODULE_4__material_dialog_index__; });
  9572. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "dom", function() { return __WEBPACK_IMPORTED_MODULE_5__material_dom_index__; });
  9573. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "drawer", function() { return __WEBPACK_IMPORTED_MODULE_6__material_drawer_index__; });
  9574. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "floatingLabel", function() { return __WEBPACK_IMPORTED_MODULE_7__material_floating_label_index__; });
  9575. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "formField", function() { return __WEBPACK_IMPORTED_MODULE_8__material_form_field_index__; });
  9576. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "gridList", function() { return __WEBPACK_IMPORTED_MODULE_9__material_grid_list_index__; });
  9577. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "iconButton", function() { return __WEBPACK_IMPORTED_MODULE_10__material_icon_button_index__; });
  9578. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "iconToggle", function() { return __WEBPACK_IMPORTED_MODULE_11__material_icon_toggle_index__; });
  9579. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "lineRipple", function() { return __WEBPACK_IMPORTED_MODULE_13__material_line_ripple_index__; });
  9580. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "linearProgress", function() { return __WEBPACK_IMPORTED_MODULE_12__material_linear_progress_index__; });
  9581. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "list", function() { return __WEBPACK_IMPORTED_MODULE_14__material_list_index__; });
  9582. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "menu", function() { return __WEBPACK_IMPORTED_MODULE_15__material_menu_index__; });
  9583. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "menuSurface", function() { return __WEBPACK_IMPORTED_MODULE_16__material_menu_surface_index__; });
  9584. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "notchedOutline", function() { return __WEBPACK_IMPORTED_MODULE_17__material_notched_outline_index__; });
  9585. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "radio", function() { return __WEBPACK_IMPORTED_MODULE_18__material_radio_index__; });
  9586. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "ripple", function() { return __WEBPACK_IMPORTED_MODULE_19__material_ripple_index__; });
  9587. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "select", function() { return __WEBPACK_IMPORTED_MODULE_20__material_select_index__; });
  9588. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "selectionControl", function() { return __WEBPACK_IMPORTED_MODULE_21__material_selection_control_index__; });
  9589. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "slider", function() { return __WEBPACK_IMPORTED_MODULE_22__material_slider_index__; });
  9590. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "switchControl", function() { return __WEBPACK_IMPORTED_MODULE_24__material_switch_index__; });
  9591. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "snackbar", function() { return __WEBPACK_IMPORTED_MODULE_23__material_snackbar_index__; });
  9592. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "tab", function() { return __WEBPACK_IMPORTED_MODULE_25__material_tab_index__; });
  9593. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "tabBar", function() { return __WEBPACK_IMPORTED_MODULE_26__material_tab_bar_index__; });
  9594. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "tabIndicator", function() { return __WEBPACK_IMPORTED_MODULE_27__material_tab_indicator_index__; });
  9595. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "tabScroller", function() { return __WEBPACK_IMPORTED_MODULE_28__material_tab_scroller_index__; });
  9596. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "textField", function() { return __WEBPACK_IMPORTED_MODULE_29__material_textfield_index__; });
  9597. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "toolbar", function() { return __WEBPACK_IMPORTED_MODULE_30__material_toolbar_index__; });
  9598. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "topAppBar", function() { return __WEBPACK_IMPORTED_MODULE_31__material_top_app_bar_index__; });
  9599. /**
  9600. * @license
  9601. * Copyright 2016 Google Inc.
  9602. *
  9603. * Permission is hereby granted, free of charge, to any person obtaining a copy
  9604. * of this software and associated documentation files (the "Software"), to deal
  9605. * in the Software without restriction, including without limitation the rights
  9606. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9607. * copies of the Software, and to permit persons to whom the Software is
  9608. * furnished to do so, subject to the following conditions:
  9609. *
  9610. * The above copyright notice and this permission notice shall be included in
  9611. * all copies or substantial portions of the Software.
  9612. *
  9613. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  9614. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  9615. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  9616. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  9617. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  9618. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  9619. * THE SOFTWARE.
  9620. */
  9621. // Register all components
  9622. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCCheckbox', __WEBPACK_IMPORTED_MODULE_2__material_checkbox_index__["MDCCheckbox"]);
  9623. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCChip', __WEBPACK_IMPORTED_MODULE_3__material_chips_index__["MDCChip"]);
  9624. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCChipSet', __WEBPACK_IMPORTED_MODULE_3__material_chips_index__["MDCChipSet"]);
  9625. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCDialog', __WEBPACK_IMPORTED_MODULE_4__material_dialog_index__["MDCDialog"]);
  9626. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCDrawer', __WEBPACK_IMPORTED_MODULE_6__material_drawer_index__["MDCDrawer"]);
  9627. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCFloatingLabel', __WEBPACK_IMPORTED_MODULE_7__material_floating_label_index__["MDCFloatingLabel"]);
  9628. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCFormField', __WEBPACK_IMPORTED_MODULE_8__material_form_field_index__["MDCFormField"]);
  9629. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCRipple', __WEBPACK_IMPORTED_MODULE_19__material_ripple_index__["MDCRipple"]);
  9630. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCGridList', __WEBPACK_IMPORTED_MODULE_9__material_grid_list_index__["MDCGridList"]);
  9631. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCIconButtonToggle', __WEBPACK_IMPORTED_MODULE_10__material_icon_button_index__["MDCIconButtonToggle"]);
  9632. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCIconToggle', __WEBPACK_IMPORTED_MODULE_11__material_icon_toggle_index__["MDCIconToggle"]);
  9633. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCLineRipple', __WEBPACK_IMPORTED_MODULE_13__material_line_ripple_index__["MDCLineRipple"]);
  9634. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCLinearProgress', __WEBPACK_IMPORTED_MODULE_12__material_linear_progress_index__["MDCLinearProgress"]);
  9635. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCList', __WEBPACK_IMPORTED_MODULE_14__material_list_index__["MDCList"]);
  9636. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCNotchedOutline', __WEBPACK_IMPORTED_MODULE_17__material_notched_outline_index__["MDCNotchedOutline"]);
  9637. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCRadio', __WEBPACK_IMPORTED_MODULE_18__material_radio_index__["MDCRadio"]);
  9638. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCSnackbar', __WEBPACK_IMPORTED_MODULE_23__material_snackbar_index__["MDCSnackbar"]);
  9639. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCTabBar', __WEBPACK_IMPORTED_MODULE_26__material_tab_bar_index__["MDCTabBar"]);
  9640. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCTextField', __WEBPACK_IMPORTED_MODULE_29__material_textfield_index__["MDCTextField"]);
  9641. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCMenu', __WEBPACK_IMPORTED_MODULE_15__material_menu_index__["MDCMenu"]);
  9642. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCMenuSurface', __WEBPACK_IMPORTED_MODULE_16__material_menu_surface_index__["MDCMenuSurface"]);
  9643. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCSelect', __WEBPACK_IMPORTED_MODULE_20__material_select_index__["MDCSelect"]);
  9644. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCSlider', __WEBPACK_IMPORTED_MODULE_22__material_slider_index__["MDCSlider"]);
  9645. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCSwitch', __WEBPACK_IMPORTED_MODULE_24__material_switch_index__["MDCSwitch"]);
  9646. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCToolbar', __WEBPACK_IMPORTED_MODULE_30__material_toolbar_index__["MDCToolbar"]);
  9647. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCTopAppBar', __WEBPACK_IMPORTED_MODULE_31__material_top_app_bar_index__["MDCTopAppBar"]);
  9648. // Export all components.
  9649. /***/ }),
  9650. /* 66 */
  9651. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9652. "use strict";
  9653. /* harmony export (immutable) */ __webpack_exports__["a"] = mdcAutoInit;
  9654. /**
  9655. * @license
  9656. * Copyright 2016 Google Inc.
  9657. *
  9658. * Permission is hereby granted, free of charge, to any person obtaining a copy
  9659. * of this software and associated documentation files (the "Software"), to deal
  9660. * in the Software without restriction, including without limitation the rights
  9661. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9662. * copies of the Software, and to permit persons to whom the Software is
  9663. * furnished to do so, subject to the following conditions:
  9664. *
  9665. * The above copyright notice and this permission notice shall be included in
  9666. * all copies or substantial portions of the Software.
  9667. *
  9668. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  9669. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  9670. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  9671. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  9672. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  9673. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  9674. * THE SOFTWARE.
  9675. */
  9676. var registry = Object.create(null);
  9677. var CONSOLE_WARN = console.warn.bind(console);
  9678. function _emit(evtType, evtData) {
  9679. var shouldBubble = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  9680. var evt = void 0;
  9681. if (typeof CustomEvent === 'function') {
  9682. evt = new CustomEvent(evtType, {
  9683. detail: evtData,
  9684. bubbles: shouldBubble
  9685. });
  9686. } else {
  9687. evt = document.createEvent('CustomEvent');
  9688. evt.initCustomEvent(evtType, shouldBubble, false, evtData);
  9689. }
  9690. document.dispatchEvent(evt);
  9691. }
  9692. /**
  9693. * Auto-initializes all mdc components on a page.
  9694. */
  9695. function mdcAutoInit() {
  9696. var root = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document;
  9697. var warn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : CONSOLE_WARN;
  9698. var components = [];
  9699. var nodes = root.querySelectorAll('[data-mdc-auto-init]');
  9700. for (var i = 0, node; node = nodes[i]; i++) {
  9701. var ctorName = node.dataset.mdcAutoInit;
  9702. if (!ctorName) {
  9703. throw new Error('(mdc-auto-init) Constructor name must be given.');
  9704. }
  9705. var Ctor = registry[ctorName];
  9706. if (typeof Ctor !== 'function') {
  9707. throw new Error('(mdc-auto-init) Could not find constructor in registry for ' + ctorName);
  9708. }
  9709. if (node[ctorName]) {
  9710. warn('(mdc-auto-init) Component already initialized for ' + node + '. Skipping...');
  9711. continue;
  9712. }
  9713. // TODO: Should we make an eslint rule for an attachTo() static method?
  9714. var component = Ctor.attachTo(node);
  9715. Object.defineProperty(node, ctorName, {
  9716. value: component,
  9717. writable: false,
  9718. enumerable: false,
  9719. configurable: true
  9720. });
  9721. components.push(component);
  9722. }
  9723. _emit('MDCAutoInit:End', {});
  9724. return components;
  9725. }
  9726. mdcAutoInit.register = function (componentName, Ctor) {
  9727. var warn = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : CONSOLE_WARN;
  9728. if (typeof Ctor !== 'function') {
  9729. throw new Error('(mdc-auto-init) Invalid Ctor value ' + Ctor + '. Expected function');
  9730. }
  9731. if (registry[componentName]) {
  9732. warn('(mdc-auto-init) Overriding registration for ' + componentName + ' with ' + Ctor + '. ' + ('Was: ' + registry[componentName]));
  9733. }
  9734. registry[componentName] = Ctor;
  9735. };
  9736. mdcAutoInit.deregister = function (componentName) {
  9737. delete registry[componentName];
  9738. };
  9739. mdcAutoInit.deregisterAll = function () {
  9740. Object.keys(registry).forEach(this.deregister, this);
  9741. };
  9742. /***/ }),
  9743. /* 67 */
  9744. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9745. "use strict";
  9746. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  9747. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation__ = __webpack_require__(0);
  9748. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__component__ = __webpack_require__(1);
  9749. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCFoundation", function() { return __WEBPACK_IMPORTED_MODULE_0__foundation__["a"]; });
  9750. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCComponent", function() { return __WEBPACK_IMPORTED_MODULE_1__component__["a"]; });
  9751. /**
  9752. * @license
  9753. * Copyright 2016 Google Inc.
  9754. *
  9755. * Permission is hereby granted, free of charge, to any person obtaining a copy
  9756. * of this software and associated documentation files (the "Software"), to deal
  9757. * in the Software without restriction, including without limitation the rights
  9758. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9759. * copies of the Software, and to permit persons to whom the Software is
  9760. * furnished to do so, subject to the following conditions:
  9761. *
  9762. * The above copyright notice and this permission notice shall be included in
  9763. * all copies or substantial portions of the Software.
  9764. *
  9765. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  9766. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  9767. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  9768. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  9769. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  9770. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  9771. * THE SOFTWARE.
  9772. */
  9773. /***/ }),
  9774. /* 68 */
  9775. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9776. "use strict";
  9777. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  9778. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCCheckbox", function() { return MDCCheckbox; });
  9779. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_animation_index__ = __webpack_require__(13);
  9780. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_component__ = __webpack_require__(1);
  9781. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_selection_control_index__ = __webpack_require__(3);
  9782. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation__ = __webpack_require__(71);
  9783. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__material_ripple_index__ = __webpack_require__(2);
  9784. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__material_ripple_util__ = __webpack_require__(5);
  9785. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCCheckboxFoundation", function() { return __WEBPACK_IMPORTED_MODULE_3__foundation__["a"]; });
  9786. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  9787. var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
  9788. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  9789. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9790. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  9791. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  9792. /**
  9793. * @license
  9794. * Copyright 2016 Google Inc.
  9795. *
  9796. * Permission is hereby granted, free of charge, to any person obtaining a copy
  9797. * of this software and associated documentation files (the "Software"), to deal
  9798. * in the Software without restriction, including without limitation the rights
  9799. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9800. * copies of the Software, and to permit persons to whom the Software is
  9801. * furnished to do so, subject to the following conditions:
  9802. *
  9803. * The above copyright notice and this permission notice shall be included in
  9804. * all copies or substantial portions of the Software.
  9805. *
  9806. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  9807. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  9808. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  9809. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  9810. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  9811. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  9812. * THE SOFTWARE.
  9813. */
  9814. /* eslint-disable no-unused-vars */
  9815. /* eslint-enable no-unused-vars */
  9816. /** @const {!Array<string>} */
  9817. var CB_PROTO_PROPS = ['checked', 'indeterminate'];
  9818. /**
  9819. * @extends MDCComponent<!MDCCheckboxFoundation>
  9820. * @implements {MDCSelectionControl}
  9821. */
  9822. var MDCCheckbox = function (_MDCComponent) {
  9823. _inherits(MDCCheckbox, _MDCComponent);
  9824. _createClass(MDCCheckbox, [{
  9825. key: 'nativeCb_',
  9826. /**
  9827. * Returns the state of the native control element, or null if the native control element is not present.
  9828. * @return {!MDCSelectionControlState}
  9829. * @private
  9830. */
  9831. get: function get() {
  9832. var NATIVE_CONTROL_SELECTOR = __WEBPACK_IMPORTED_MODULE_3__foundation__["a" /* default */].strings.NATIVE_CONTROL_SELECTOR;
  9833. var cbEl = /** @type {!MDCSelectionControlState} */this.root_.querySelector(NATIVE_CONTROL_SELECTOR);
  9834. return cbEl;
  9835. }
  9836. }], [{
  9837. key: 'attachTo',
  9838. value: function attachTo(root) {
  9839. return new MDCCheckbox(root);
  9840. }
  9841. }]);
  9842. function MDCCheckbox() {
  9843. var _ref;
  9844. _classCallCheck(this, MDCCheckbox);
  9845. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  9846. args[_key] = arguments[_key];
  9847. }
  9848. /** @private {!MDCRipple} */
  9849. var _this = _possibleConstructorReturn(this, (_ref = MDCCheckbox.__proto__ || Object.getPrototypeOf(MDCCheckbox)).call.apply(_ref, [this].concat(args)));
  9850. _this.ripple_ = _this.initRipple_();
  9851. /** @private {!Function} */
  9852. _this.handleChange_;
  9853. /** @private {!Function} */
  9854. _this.handleAnimationEnd_;
  9855. return _this;
  9856. }
  9857. _createClass(MDCCheckbox, [{
  9858. key: 'initialSyncWithDOM',
  9859. value: function initialSyncWithDOM() {
  9860. var _this2 = this;
  9861. this.handleChange_ = function () {
  9862. return _this2.foundation_.handleChange();
  9863. };
  9864. this.handleAnimationEnd_ = function () {
  9865. return _this2.foundation_.handleAnimationEnd();
  9866. };
  9867. this.nativeCb_.addEventListener('change', this.handleChange_);
  9868. this.listen(Object(__WEBPACK_IMPORTED_MODULE_0__material_animation_index__["a" /* getCorrectEventName */])(window, 'animationend'), this.handleAnimationEnd_);
  9869. this.installPropertyChangeHooks_();
  9870. }
  9871. /**
  9872. * @return {!MDCRipple}
  9873. * @private
  9874. */
  9875. }, {
  9876. key: 'initRipple_',
  9877. value: function initRipple_() {
  9878. var _this3 = this;
  9879. var MATCHES = Object(__WEBPACK_IMPORTED_MODULE_5__material_ripple_util__["getMatchesProperty"])(HTMLElement.prototype);
  9880. var adapter = _extends(__WEBPACK_IMPORTED_MODULE_4__material_ripple_index__["MDCRipple"].createAdapter(this), {
  9881. isUnbounded: function isUnbounded() {
  9882. return true;
  9883. },
  9884. isSurfaceActive: function isSurfaceActive() {
  9885. return _this3.nativeCb_[MATCHES](':active');
  9886. },
  9887. registerInteractionHandler: function registerInteractionHandler(type, handler) {
  9888. return _this3.nativeCb_.addEventListener(type, handler);
  9889. },
  9890. deregisterInteractionHandler: function deregisterInteractionHandler(type, handler) {
  9891. return _this3.nativeCb_.removeEventListener(type, handler);
  9892. }
  9893. });
  9894. var foundation = new __WEBPACK_IMPORTED_MODULE_4__material_ripple_index__["MDCRippleFoundation"](adapter);
  9895. return new __WEBPACK_IMPORTED_MODULE_4__material_ripple_index__["MDCRipple"](this.root_, foundation);
  9896. }
  9897. /** @private */
  9898. }, {
  9899. key: 'installPropertyChangeHooks_',
  9900. value: function installPropertyChangeHooks_() {
  9901. var _this4 = this;
  9902. var nativeCb = this.nativeCb_;
  9903. var cbProto = Object.getPrototypeOf(nativeCb);
  9904. CB_PROTO_PROPS.forEach(function (controlState) {
  9905. var desc = Object.getOwnPropertyDescriptor(cbProto, controlState);
  9906. // We have to check for this descriptor, since some browsers (Safari) don't support its return.
  9907. // See: https://bugs.webkit.org/show_bug.cgi?id=49739
  9908. if (validDescriptor(desc)) {
  9909. var nativeCbDesc = /** @type {!ObjectPropertyDescriptor} */{
  9910. get: desc.get,
  9911. set: function set(state) {
  9912. desc.set.call(nativeCb, state);
  9913. _this4.foundation_.handleChange();
  9914. },
  9915. configurable: desc.configurable,
  9916. enumerable: desc.enumerable
  9917. };
  9918. Object.defineProperty(nativeCb, controlState, nativeCbDesc);
  9919. }
  9920. });
  9921. }
  9922. /** @private */
  9923. }, {
  9924. key: 'uninstallPropertyChangeHooks_',
  9925. value: function uninstallPropertyChangeHooks_() {
  9926. var nativeCb = this.nativeCb_;
  9927. var cbProto = Object.getPrototypeOf(nativeCb);
  9928. CB_PROTO_PROPS.forEach(function (controlState) {
  9929. var desc = /** @type {!ObjectPropertyDescriptor} */Object.getOwnPropertyDescriptor(cbProto, controlState);
  9930. if (validDescriptor(desc)) {
  9931. Object.defineProperty(nativeCb, controlState, desc);
  9932. }
  9933. });
  9934. }
  9935. /** @return {!MDCCheckboxFoundation} */
  9936. }, {
  9937. key: 'getDefaultFoundation',
  9938. value: function getDefaultFoundation() {
  9939. var _this5 = this;
  9940. return new __WEBPACK_IMPORTED_MODULE_3__foundation__["a" /* default */]({
  9941. addClass: function addClass(className) {
  9942. return _this5.root_.classList.add(className);
  9943. },
  9944. removeClass: function removeClass(className) {
  9945. return _this5.root_.classList.remove(className);
  9946. },
  9947. setNativeControlAttr: function setNativeControlAttr(attr, value) {
  9948. return _this5.nativeCb_.setAttribute(attr, value);
  9949. },
  9950. removeNativeControlAttr: function removeNativeControlAttr(attr) {
  9951. return _this5.nativeCb_.removeAttribute(attr);
  9952. },
  9953. isIndeterminate: function isIndeterminate() {
  9954. return _this5.indeterminate;
  9955. },
  9956. isChecked: function isChecked() {
  9957. return _this5.checked;
  9958. },
  9959. hasNativeControl: function hasNativeControl() {
  9960. return !!_this5.nativeCb_;
  9961. },
  9962. setNativeControlDisabled: function setNativeControlDisabled(disabled) {
  9963. return _this5.nativeCb_.disabled = disabled;
  9964. },
  9965. forceLayout: function forceLayout() {
  9966. return _this5.root_.offsetWidth;
  9967. },
  9968. isAttachedToDOM: function isAttachedToDOM() {
  9969. return Boolean(_this5.root_.parentNode);
  9970. }
  9971. });
  9972. }
  9973. /** @return {!MDCRipple} */
  9974. }, {
  9975. key: 'destroy',
  9976. value: function destroy() {
  9977. this.ripple_.destroy();
  9978. this.nativeCb_.removeEventListener('change', this.handleChange_);
  9979. this.unlisten(Object(__WEBPACK_IMPORTED_MODULE_0__material_animation_index__["a" /* getCorrectEventName */])(window, 'animationend'), this.handleAnimationEnd_);
  9980. this.uninstallPropertyChangeHooks_();
  9981. _get(MDCCheckbox.prototype.__proto__ || Object.getPrototypeOf(MDCCheckbox.prototype), 'destroy', this).call(this);
  9982. }
  9983. }, {
  9984. key: 'ripple',
  9985. get: function get() {
  9986. return this.ripple_;
  9987. }
  9988. /** @return {boolean} */
  9989. }, {
  9990. key: 'checked',
  9991. get: function get() {
  9992. return this.nativeCb_.checked;
  9993. }
  9994. /** @param {boolean} checked */
  9995. ,
  9996. set: function set(checked) {
  9997. this.nativeCb_.checked = checked;
  9998. }
  9999. /** @return {boolean} */
  10000. }, {
  10001. key: 'indeterminate',
  10002. get: function get() {
  10003. return this.nativeCb_.indeterminate;
  10004. }
  10005. /** @param {boolean} indeterminate */
  10006. ,
  10007. set: function set(indeterminate) {
  10008. this.nativeCb_.indeterminate = indeterminate;
  10009. }
  10010. /** @return {boolean} */
  10011. }, {
  10012. key: 'disabled',
  10013. get: function get() {
  10014. return this.nativeCb_.disabled;
  10015. }
  10016. /** @param {boolean} disabled */
  10017. ,
  10018. set: function set(disabled) {
  10019. this.foundation_.setDisabled(disabled);
  10020. }
  10021. /** @return {?string} */
  10022. }, {
  10023. key: 'value',
  10024. get: function get() {
  10025. return this.nativeCb_.value;
  10026. }
  10027. /** @param {?string} value */
  10028. ,
  10029. set: function set(value) {
  10030. this.nativeCb_.value = value;
  10031. }
  10032. }]);
  10033. return MDCCheckbox;
  10034. }(__WEBPACK_IMPORTED_MODULE_1__material_base_component__["a" /* default */]);
  10035. /**
  10036. * @param {ObjectPropertyDescriptor|undefined} inputPropDesc
  10037. * @return {boolean}
  10038. */
  10039. function validDescriptor(inputPropDesc) {
  10040. return !!inputPropDesc && typeof inputPropDesc.set === 'function';
  10041. }
  10042. /***/ }),
  10043. /* 69 */
  10044. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10045. "use strict";
  10046. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  10047. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(28);
  10048. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(70);
  10049. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util__ = __webpack_require__(5);
  10050. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  10051. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  10052. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  10053. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  10054. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  10055. /**
  10056. * @license
  10057. * Copyright 2016 Google Inc.
  10058. *
  10059. * Permission is hereby granted, free of charge, to any person obtaining a copy
  10060. * of this software and associated documentation files (the "Software"), to deal
  10061. * in the Software without restriction, including without limitation the rights
  10062. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10063. * copies of the Software, and to permit persons to whom the Software is
  10064. * furnished to do so, subject to the following conditions:
  10065. *
  10066. * The above copyright notice and this permission notice shall be included in
  10067. * all copies or substantial portions of the Software.
  10068. *
  10069. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  10070. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  10071. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  10072. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  10073. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  10074. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  10075. * THE SOFTWARE.
  10076. */
  10077. /**
  10078. * @typedef {{
  10079. * isActivated: (boolean|undefined),
  10080. * hasDeactivationUXRun: (boolean|undefined),
  10081. * wasActivatedByPointer: (boolean|undefined),
  10082. * wasElementMadeActive: (boolean|undefined),
  10083. * activationEvent: (!Event|undefined),
  10084. * isProgrammatic: (boolean|undefined)
  10085. * }}
  10086. */
  10087. var ActivationStateType = void 0;
  10088. /**
  10089. * @typedef {{
  10090. * activate: (string|undefined),
  10091. * deactivate: (string|undefined),
  10092. * focus: (string|undefined),
  10093. * blur: (string|undefined)
  10094. * }}
  10095. */
  10096. var ListenerInfoType = void 0;
  10097. /**
  10098. * @typedef {{
  10099. * activate: function(!Event),
  10100. * deactivate: function(!Event=),
  10101. * focus: function(),
  10102. * blur: function()
  10103. * }}
  10104. */
  10105. var ListenersType = void 0;
  10106. /**
  10107. * @typedef {{
  10108. * x: number,
  10109. * y: number
  10110. * }}
  10111. */
  10112. var PointType = void 0;
  10113. // Activation events registered on the root element of each instance for activation
  10114. var ACTIVATION_EVENT_TYPES = ['touchstart', 'pointerdown', 'mousedown', 'keydown'];
  10115. // Deactivation events registered on documentElement when a pointer-related down event occurs
  10116. var POINTER_DEACTIVATION_EVENT_TYPES = ['touchend', 'pointerup', 'mouseup', 'contextmenu'];
  10117. // Tracks activations that have occurred on the current frame, to avoid simultaneous nested activations
  10118. /** @type {!Array<!EventTarget>} */
  10119. var activatedTargets = [];
  10120. /**
  10121. * @extends {MDCFoundation<!MDCRippleAdapter>}
  10122. */
  10123. var MDCRippleFoundation = function (_MDCFoundation) {
  10124. _inherits(MDCRippleFoundation, _MDCFoundation);
  10125. _createClass(MDCRippleFoundation, null, [{
  10126. key: 'cssClasses',
  10127. get: function get() {
  10128. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  10129. }
  10130. }, {
  10131. key: 'strings',
  10132. get: function get() {
  10133. return __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */];
  10134. }
  10135. }, {
  10136. key: 'numbers',
  10137. get: function get() {
  10138. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */];
  10139. }
  10140. }, {
  10141. key: 'defaultAdapter',
  10142. get: function get() {
  10143. return {
  10144. browserSupportsCssVars: function browserSupportsCssVars() /* boolean - cached */{},
  10145. isUnbounded: function isUnbounded() /* boolean */{},
  10146. isSurfaceActive: function isSurfaceActive() /* boolean */{},
  10147. isSurfaceDisabled: function isSurfaceDisabled() /* boolean */{},
  10148. addClass: function addClass() /* className: string */{},
  10149. removeClass: function removeClass() /* className: string */{},
  10150. containsEventTarget: function containsEventTarget() /* target: !EventTarget */{},
  10151. registerInteractionHandler: function registerInteractionHandler() /* evtType: string, handler: EventListener */{},
  10152. deregisterInteractionHandler: function deregisterInteractionHandler() /* evtType: string, handler: EventListener */{},
  10153. registerDocumentInteractionHandler: function registerDocumentInteractionHandler() /* evtType: string, handler: EventListener */{},
  10154. deregisterDocumentInteractionHandler: function deregisterDocumentInteractionHandler() /* evtType: string, handler: EventListener */{},
  10155. registerResizeHandler: function registerResizeHandler() /* handler: EventListener */{},
  10156. deregisterResizeHandler: function deregisterResizeHandler() /* handler: EventListener */{},
  10157. updateCssVariable: function updateCssVariable() /* varName: string, value: string */{},
  10158. computeBoundingRect: function computeBoundingRect() /* ClientRect */{},
  10159. getWindowPageOffset: function getWindowPageOffset() /* {x: number, y: number} */{}
  10160. };
  10161. }
  10162. }]);
  10163. function MDCRippleFoundation(adapter) {
  10164. _classCallCheck(this, MDCRippleFoundation);
  10165. /** @private {number} */
  10166. var _this = _possibleConstructorReturn(this, (MDCRippleFoundation.__proto__ || Object.getPrototypeOf(MDCRippleFoundation)).call(this, _extends(MDCRippleFoundation.defaultAdapter, adapter)));
  10167. _this.layoutFrame_ = 0;
  10168. /** @private {!ClientRect} */
  10169. _this.frame_ = /** @type {!ClientRect} */{ width: 0, height: 0 };
  10170. /** @private {!ActivationStateType} */
  10171. _this.activationState_ = _this.defaultActivationState_();
  10172. /** @private {number} */
  10173. _this.initialSize_ = 0;
  10174. /** @private {number} */
  10175. _this.maxRadius_ = 0;
  10176. /** @private {function(!Event)} */
  10177. _this.activateHandler_ = function (e) {
  10178. return _this.activate_(e);
  10179. };
  10180. /** @private {function(!Event=)} */
  10181. _this.deactivateHandler_ = function () {
  10182. return _this.deactivate_();
  10183. };
  10184. /** @private {function(!Event=)} */
  10185. _this.focusHandler_ = function () {
  10186. return _this.handleFocus();
  10187. };
  10188. /** @private {function(!Event=)} */
  10189. _this.blurHandler_ = function () {
  10190. return _this.handleBlur();
  10191. };
  10192. /** @private {!Function} */
  10193. _this.resizeHandler_ = function () {
  10194. return _this.layout();
  10195. };
  10196. /** @private {{left: number, top:number}} */
  10197. _this.unboundedCoords_ = {
  10198. left: 0,
  10199. top: 0
  10200. };
  10201. /** @private {number} */
  10202. _this.fgScale_ = 0;
  10203. /** @private {number} */
  10204. _this.activationTimer_ = 0;
  10205. /** @private {number} */
  10206. _this.fgDeactivationRemovalTimer_ = 0;
  10207. /** @private {boolean} */
  10208. _this.activationAnimationHasEnded_ = false;
  10209. /** @private {!Function} */
  10210. _this.activationTimerCallback_ = function () {
  10211. _this.activationAnimationHasEnded_ = true;
  10212. _this.runDeactivationUXLogicIfReady_();
  10213. };
  10214. /** @private {!Event|undefined} */
  10215. _this.previousActivationEvent_;
  10216. return _this;
  10217. }
  10218. /**
  10219. * We compute this property so that we are not querying information about the client
  10220. * until the point in time where the foundation requests it. This prevents scenarios where
  10221. * client-side feature-detection may happen too early, such as when components are rendered on the server
  10222. * and then initialized at mount time on the client.
  10223. * @return {boolean}
  10224. * @private
  10225. */
  10226. _createClass(MDCRippleFoundation, [{
  10227. key: 'supportsPressRipple_',
  10228. value: function supportsPressRipple_() {
  10229. return this.adapter_.browserSupportsCssVars();
  10230. }
  10231. /**
  10232. * @return {!ActivationStateType}
  10233. */
  10234. }, {
  10235. key: 'defaultActivationState_',
  10236. value: function defaultActivationState_() {
  10237. return {
  10238. isActivated: false,
  10239. hasDeactivationUXRun: false,
  10240. wasActivatedByPointer: false,
  10241. wasElementMadeActive: false,
  10242. activationEvent: undefined,
  10243. isProgrammatic: false
  10244. };
  10245. }
  10246. /** @override */
  10247. }, {
  10248. key: 'init',
  10249. value: function init() {
  10250. var _this2 = this;
  10251. var supportsPressRipple = this.supportsPressRipple_();
  10252. this.registerRootHandlers_(supportsPressRipple);
  10253. if (supportsPressRipple) {
  10254. var _MDCRippleFoundation$ = MDCRippleFoundation.cssClasses,
  10255. ROOT = _MDCRippleFoundation$.ROOT,
  10256. UNBOUNDED = _MDCRippleFoundation$.UNBOUNDED;
  10257. requestAnimationFrame(function () {
  10258. _this2.adapter_.addClass(ROOT);
  10259. if (_this2.adapter_.isUnbounded()) {
  10260. _this2.adapter_.addClass(UNBOUNDED);
  10261. // Unbounded ripples need layout logic applied immediately to set coordinates for both shade and ripple
  10262. _this2.layoutInternal_();
  10263. }
  10264. });
  10265. }
  10266. }
  10267. /** @override */
  10268. }, {
  10269. key: 'destroy',
  10270. value: function destroy() {
  10271. var _this3 = this;
  10272. if (this.supportsPressRipple_()) {
  10273. if (this.activationTimer_) {
  10274. clearTimeout(this.activationTimer_);
  10275. this.activationTimer_ = 0;
  10276. this.adapter_.removeClass(MDCRippleFoundation.cssClasses.FG_ACTIVATION);
  10277. }
  10278. if (this.fgDeactivationRemovalTimer_) {
  10279. clearTimeout(this.fgDeactivationRemovalTimer_);
  10280. this.fgDeactivationRemovalTimer_ = 0;
  10281. this.adapter_.removeClass(MDCRippleFoundation.cssClasses.FG_DEACTIVATION);
  10282. }
  10283. var _MDCRippleFoundation$2 = MDCRippleFoundation.cssClasses,
  10284. ROOT = _MDCRippleFoundation$2.ROOT,
  10285. UNBOUNDED = _MDCRippleFoundation$2.UNBOUNDED;
  10286. requestAnimationFrame(function () {
  10287. _this3.adapter_.removeClass(ROOT);
  10288. _this3.adapter_.removeClass(UNBOUNDED);
  10289. _this3.removeCssVars_();
  10290. });
  10291. }
  10292. this.deregisterRootHandlers_();
  10293. this.deregisterDeactivationHandlers_();
  10294. }
  10295. /**
  10296. * @param {boolean} supportsPressRipple Passed from init to save a redundant function call
  10297. * @private
  10298. */
  10299. }, {
  10300. key: 'registerRootHandlers_',
  10301. value: function registerRootHandlers_(supportsPressRipple) {
  10302. var _this4 = this;
  10303. if (supportsPressRipple) {
  10304. ACTIVATION_EVENT_TYPES.forEach(function (type) {
  10305. _this4.adapter_.registerInteractionHandler(type, _this4.activateHandler_);
  10306. });
  10307. if (this.adapter_.isUnbounded()) {
  10308. this.adapter_.registerResizeHandler(this.resizeHandler_);
  10309. }
  10310. }
  10311. this.adapter_.registerInteractionHandler('focus', this.focusHandler_);
  10312. this.adapter_.registerInteractionHandler('blur', this.blurHandler_);
  10313. }
  10314. /**
  10315. * @param {!Event} e
  10316. * @private
  10317. */
  10318. }, {
  10319. key: 'registerDeactivationHandlers_',
  10320. value: function registerDeactivationHandlers_(e) {
  10321. var _this5 = this;
  10322. if (e.type === 'keydown') {
  10323. this.adapter_.registerInteractionHandler('keyup', this.deactivateHandler_);
  10324. } else {
  10325. POINTER_DEACTIVATION_EVENT_TYPES.forEach(function (type) {
  10326. _this5.adapter_.registerDocumentInteractionHandler(type, _this5.deactivateHandler_);
  10327. });
  10328. }
  10329. }
  10330. /** @private */
  10331. }, {
  10332. key: 'deregisterRootHandlers_',
  10333. value: function deregisterRootHandlers_() {
  10334. var _this6 = this;
  10335. ACTIVATION_EVENT_TYPES.forEach(function (type) {
  10336. _this6.adapter_.deregisterInteractionHandler(type, _this6.activateHandler_);
  10337. });
  10338. this.adapter_.deregisterInteractionHandler('focus', this.focusHandler_);
  10339. this.adapter_.deregisterInteractionHandler('blur', this.blurHandler_);
  10340. if (this.adapter_.isUnbounded()) {
  10341. this.adapter_.deregisterResizeHandler(this.resizeHandler_);
  10342. }
  10343. }
  10344. /** @private */
  10345. }, {
  10346. key: 'deregisterDeactivationHandlers_',
  10347. value: function deregisterDeactivationHandlers_() {
  10348. var _this7 = this;
  10349. this.adapter_.deregisterInteractionHandler('keyup', this.deactivateHandler_);
  10350. POINTER_DEACTIVATION_EVENT_TYPES.forEach(function (type) {
  10351. _this7.adapter_.deregisterDocumentInteractionHandler(type, _this7.deactivateHandler_);
  10352. });
  10353. }
  10354. /** @private */
  10355. }, {
  10356. key: 'removeCssVars_',
  10357. value: function removeCssVars_() {
  10358. var _this8 = this;
  10359. var strings = MDCRippleFoundation.strings;
  10360. Object.keys(strings).forEach(function (k) {
  10361. if (k.indexOf('VAR_') === 0) {
  10362. _this8.adapter_.updateCssVariable(strings[k], null);
  10363. }
  10364. });
  10365. }
  10366. /**
  10367. * @param {!Event=} e
  10368. * @private
  10369. */
  10370. }, {
  10371. key: 'activate_',
  10372. value: function activate_(e) {
  10373. var _this9 = this;
  10374. if (this.adapter_.isSurfaceDisabled()) {
  10375. return;
  10376. }
  10377. var activationState = this.activationState_;
  10378. if (activationState.isActivated) {
  10379. return;
  10380. }
  10381. // Avoid reacting to follow-on events fired by touch device after an already-processed user interaction
  10382. var previousActivationEvent = this.previousActivationEvent_;
  10383. var isSameInteraction = previousActivationEvent && e !== undefined && previousActivationEvent.type !== e.type;
  10384. if (isSameInteraction) {
  10385. return;
  10386. }
  10387. activationState.isActivated = true;
  10388. activationState.isProgrammatic = e === undefined;
  10389. activationState.activationEvent = e;
  10390. activationState.wasActivatedByPointer = activationState.isProgrammatic ? false : e !== undefined && (e.type === 'mousedown' || e.type === 'touchstart' || e.type === 'pointerdown');
  10391. var hasActivatedChild = e !== undefined && activatedTargets.length > 0 && activatedTargets.some(function (target) {
  10392. return _this9.adapter_.containsEventTarget(target);
  10393. });
  10394. if (hasActivatedChild) {
  10395. // Immediately reset activation state, while preserving logic that prevents touch follow-on events
  10396. this.resetActivationState_();
  10397. return;
  10398. }
  10399. if (e !== undefined) {
  10400. activatedTargets.push( /** @type {!EventTarget} */e.target);
  10401. this.registerDeactivationHandlers_(e);
  10402. }
  10403. activationState.wasElementMadeActive = this.checkElementMadeActive_(e);
  10404. if (activationState.wasElementMadeActive) {
  10405. this.animateActivation_();
  10406. }
  10407. requestAnimationFrame(function () {
  10408. // Reset array on next frame after the current event has had a chance to bubble to prevent ancestor ripples
  10409. activatedTargets = [];
  10410. if (!activationState.wasElementMadeActive && e !== undefined && (e.key === ' ' || e.keyCode === 32)) {
  10411. // If space was pressed, try again within an rAF call to detect :active, because different UAs report
  10412. // active states inconsistently when they're called within event handling code:
  10413. // - https://bugs.chromium.org/p/chromium/issues/detail?id=635971
  10414. // - https://bugzilla.mozilla.org/show_bug.cgi?id=1293741
  10415. // We try first outside rAF to support Edge, which does not exhibit this problem, but will crash if a CSS
  10416. // variable is set within a rAF callback for a submit button interaction (#2241).
  10417. activationState.wasElementMadeActive = _this9.checkElementMadeActive_(e);
  10418. if (activationState.wasElementMadeActive) {
  10419. _this9.animateActivation_();
  10420. }
  10421. }
  10422. if (!activationState.wasElementMadeActive) {
  10423. // Reset activation state immediately if element was not made active.
  10424. _this9.activationState_ = _this9.defaultActivationState_();
  10425. }
  10426. });
  10427. }
  10428. /**
  10429. * @param {!Event=} e
  10430. * @private
  10431. */
  10432. }, {
  10433. key: 'checkElementMadeActive_',
  10434. value: function checkElementMadeActive_(e) {
  10435. return e !== undefined && e.type === 'keydown' ? this.adapter_.isSurfaceActive() : true;
  10436. }
  10437. /**
  10438. * @param {!Event=} event Optional event containing position information.
  10439. */
  10440. }, {
  10441. key: 'activate',
  10442. value: function activate(event) {
  10443. this.activate_(event);
  10444. }
  10445. /** @private */
  10446. }, {
  10447. key: 'animateActivation_',
  10448. value: function animateActivation_() {
  10449. var _this10 = this;
  10450. var _MDCRippleFoundation$3 = MDCRippleFoundation.strings,
  10451. VAR_FG_TRANSLATE_START = _MDCRippleFoundation$3.VAR_FG_TRANSLATE_START,
  10452. VAR_FG_TRANSLATE_END = _MDCRippleFoundation$3.VAR_FG_TRANSLATE_END;
  10453. var _MDCRippleFoundation$4 = MDCRippleFoundation.cssClasses,
  10454. FG_DEACTIVATION = _MDCRippleFoundation$4.FG_DEACTIVATION,
  10455. FG_ACTIVATION = _MDCRippleFoundation$4.FG_ACTIVATION;
  10456. var DEACTIVATION_TIMEOUT_MS = MDCRippleFoundation.numbers.DEACTIVATION_TIMEOUT_MS;
  10457. this.layoutInternal_();
  10458. var translateStart = '';
  10459. var translateEnd = '';
  10460. if (!this.adapter_.isUnbounded()) {
  10461. var _getFgTranslationCoor = this.getFgTranslationCoordinates_(),
  10462. startPoint = _getFgTranslationCoor.startPoint,
  10463. endPoint = _getFgTranslationCoor.endPoint;
  10464. translateStart = startPoint.x + 'px, ' + startPoint.y + 'px';
  10465. translateEnd = endPoint.x + 'px, ' + endPoint.y + 'px';
  10466. }
  10467. this.adapter_.updateCssVariable(VAR_FG_TRANSLATE_START, translateStart);
  10468. this.adapter_.updateCssVariable(VAR_FG_TRANSLATE_END, translateEnd);
  10469. // Cancel any ongoing activation/deactivation animations
  10470. clearTimeout(this.activationTimer_);
  10471. clearTimeout(this.fgDeactivationRemovalTimer_);
  10472. this.rmBoundedActivationClasses_();
  10473. this.adapter_.removeClass(FG_DEACTIVATION);
  10474. // Force layout in order to re-trigger the animation.
  10475. this.adapter_.computeBoundingRect();
  10476. this.adapter_.addClass(FG_ACTIVATION);
  10477. this.activationTimer_ = setTimeout(function () {
  10478. return _this10.activationTimerCallback_();
  10479. }, DEACTIVATION_TIMEOUT_MS);
  10480. }
  10481. /**
  10482. * @private
  10483. * @return {{startPoint: PointType, endPoint: PointType}}
  10484. */
  10485. }, {
  10486. key: 'getFgTranslationCoordinates_',
  10487. value: function getFgTranslationCoordinates_() {
  10488. var _activationState_ = this.activationState_,
  10489. activationEvent = _activationState_.activationEvent,
  10490. wasActivatedByPointer = _activationState_.wasActivatedByPointer;
  10491. var startPoint = void 0;
  10492. if (wasActivatedByPointer) {
  10493. startPoint = Object(__WEBPACK_IMPORTED_MODULE_3__util__["getNormalizedEventCoords"])(
  10494. /** @type {!Event} */activationEvent, this.adapter_.getWindowPageOffset(), this.adapter_.computeBoundingRect());
  10495. } else {
  10496. startPoint = {
  10497. x: this.frame_.width / 2,
  10498. y: this.frame_.height / 2
  10499. };
  10500. }
  10501. // Center the element around the start point.
  10502. startPoint = {
  10503. x: startPoint.x - this.initialSize_ / 2,
  10504. y: startPoint.y - this.initialSize_ / 2
  10505. };
  10506. var endPoint = {
  10507. x: this.frame_.width / 2 - this.initialSize_ / 2,
  10508. y: this.frame_.height / 2 - this.initialSize_ / 2
  10509. };
  10510. return { startPoint: startPoint, endPoint: endPoint };
  10511. }
  10512. /** @private */
  10513. }, {
  10514. key: 'runDeactivationUXLogicIfReady_',
  10515. value: function runDeactivationUXLogicIfReady_() {
  10516. var _this11 = this;
  10517. // This method is called both when a pointing device is released, and when the activation animation ends.
  10518. // The deactivation animation should only run after both of those occur.
  10519. var FG_DEACTIVATION = MDCRippleFoundation.cssClasses.FG_DEACTIVATION;
  10520. var _activationState_2 = this.activationState_,
  10521. hasDeactivationUXRun = _activationState_2.hasDeactivationUXRun,
  10522. isActivated = _activationState_2.isActivated;
  10523. var activationHasEnded = hasDeactivationUXRun || !isActivated;
  10524. if (activationHasEnded && this.activationAnimationHasEnded_) {
  10525. this.rmBoundedActivationClasses_();
  10526. this.adapter_.addClass(FG_DEACTIVATION);
  10527. this.fgDeactivationRemovalTimer_ = setTimeout(function () {
  10528. _this11.adapter_.removeClass(FG_DEACTIVATION);
  10529. }, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].FG_DEACTIVATION_MS);
  10530. }
  10531. }
  10532. /** @private */
  10533. }, {
  10534. key: 'rmBoundedActivationClasses_',
  10535. value: function rmBoundedActivationClasses_() {
  10536. var FG_ACTIVATION = MDCRippleFoundation.cssClasses.FG_ACTIVATION;
  10537. this.adapter_.removeClass(FG_ACTIVATION);
  10538. this.activationAnimationHasEnded_ = false;
  10539. this.adapter_.computeBoundingRect();
  10540. }
  10541. }, {
  10542. key: 'resetActivationState_',
  10543. value: function resetActivationState_() {
  10544. var _this12 = this;
  10545. this.previousActivationEvent_ = this.activationState_.activationEvent;
  10546. this.activationState_ = this.defaultActivationState_();
  10547. // Touch devices may fire additional events for the same interaction within a short time.
  10548. // Store the previous event until it's safe to assume that subsequent events are for new interactions.
  10549. setTimeout(function () {
  10550. return _this12.previousActivationEvent_ = undefined;
  10551. }, MDCRippleFoundation.numbers.TAP_DELAY_MS);
  10552. }
  10553. /**
  10554. * @private
  10555. */
  10556. }, {
  10557. key: 'deactivate_',
  10558. value: function deactivate_() {
  10559. var _this13 = this;
  10560. var activationState = this.activationState_;
  10561. // This can happen in scenarios such as when you have a keyup event that blurs the element.
  10562. if (!activationState.isActivated) {
  10563. return;
  10564. }
  10565. var state = /** @type {!ActivationStateType} */_extends({}, activationState);
  10566. if (activationState.isProgrammatic) {
  10567. requestAnimationFrame(function () {
  10568. return _this13.animateDeactivation_(state);
  10569. });
  10570. this.resetActivationState_();
  10571. } else {
  10572. this.deregisterDeactivationHandlers_();
  10573. requestAnimationFrame(function () {
  10574. _this13.activationState_.hasDeactivationUXRun = true;
  10575. _this13.animateDeactivation_(state);
  10576. _this13.resetActivationState_();
  10577. });
  10578. }
  10579. }
  10580. }, {
  10581. key: 'deactivate',
  10582. value: function deactivate() {
  10583. this.deactivate_();
  10584. }
  10585. /**
  10586. * @param {!ActivationStateType} options
  10587. * @private
  10588. */
  10589. }, {
  10590. key: 'animateDeactivation_',
  10591. value: function animateDeactivation_(_ref) {
  10592. var wasActivatedByPointer = _ref.wasActivatedByPointer,
  10593. wasElementMadeActive = _ref.wasElementMadeActive;
  10594. if (wasActivatedByPointer || wasElementMadeActive) {
  10595. this.runDeactivationUXLogicIfReady_();
  10596. }
  10597. }
  10598. }, {
  10599. key: 'layout',
  10600. value: function layout() {
  10601. var _this14 = this;
  10602. if (this.layoutFrame_) {
  10603. cancelAnimationFrame(this.layoutFrame_);
  10604. }
  10605. this.layoutFrame_ = requestAnimationFrame(function () {
  10606. _this14.layoutInternal_();
  10607. _this14.layoutFrame_ = 0;
  10608. });
  10609. }
  10610. /** @private */
  10611. }, {
  10612. key: 'layoutInternal_',
  10613. value: function layoutInternal_() {
  10614. var _this15 = this;
  10615. this.frame_ = this.adapter_.computeBoundingRect();
  10616. var maxDim = Math.max(this.frame_.height, this.frame_.width);
  10617. // Surface diameter is treated differently for unbounded vs. bounded ripples.
  10618. // Unbounded ripple diameter is calculated smaller since the surface is expected to already be padded appropriately
  10619. // to extend the hitbox, and the ripple is expected to meet the edges of the padded hitbox (which is typically
  10620. // square). Bounded ripples, on the other hand, are fully expected to expand beyond the surface's longest diameter
  10621. // (calculated based on the diagonal plus a constant padding), and are clipped at the surface's border via
  10622. // `overflow: hidden`.
  10623. var getBoundedRadius = function getBoundedRadius() {
  10624. var hypotenuse = Math.sqrt(Math.pow(_this15.frame_.width, 2) + Math.pow(_this15.frame_.height, 2));
  10625. return hypotenuse + MDCRippleFoundation.numbers.PADDING;
  10626. };
  10627. this.maxRadius_ = this.adapter_.isUnbounded() ? maxDim : getBoundedRadius();
  10628. // Ripple is sized as a fraction of the largest dimension of the surface, then scales up using a CSS scale transform
  10629. this.initialSize_ = Math.floor(maxDim * MDCRippleFoundation.numbers.INITIAL_ORIGIN_SCALE);
  10630. this.fgScale_ = this.maxRadius_ / this.initialSize_;
  10631. this.updateLayoutCssVars_();
  10632. }
  10633. /** @private */
  10634. }, {
  10635. key: 'updateLayoutCssVars_',
  10636. value: function updateLayoutCssVars_() {
  10637. var _MDCRippleFoundation$5 = MDCRippleFoundation.strings,
  10638. VAR_FG_SIZE = _MDCRippleFoundation$5.VAR_FG_SIZE,
  10639. VAR_LEFT = _MDCRippleFoundation$5.VAR_LEFT,
  10640. VAR_TOP = _MDCRippleFoundation$5.VAR_TOP,
  10641. VAR_FG_SCALE = _MDCRippleFoundation$5.VAR_FG_SCALE;
  10642. this.adapter_.updateCssVariable(VAR_FG_SIZE, this.initialSize_ + 'px');
  10643. this.adapter_.updateCssVariable(VAR_FG_SCALE, this.fgScale_);
  10644. if (this.adapter_.isUnbounded()) {
  10645. this.unboundedCoords_ = {
  10646. left: Math.round(this.frame_.width / 2 - this.initialSize_ / 2),
  10647. top: Math.round(this.frame_.height / 2 - this.initialSize_ / 2)
  10648. };
  10649. this.adapter_.updateCssVariable(VAR_LEFT, this.unboundedCoords_.left + 'px');
  10650. this.adapter_.updateCssVariable(VAR_TOP, this.unboundedCoords_.top + 'px');
  10651. }
  10652. }
  10653. /** @param {boolean} unbounded */
  10654. }, {
  10655. key: 'setUnbounded',
  10656. value: function setUnbounded(unbounded) {
  10657. var UNBOUNDED = MDCRippleFoundation.cssClasses.UNBOUNDED;
  10658. if (unbounded) {
  10659. this.adapter_.addClass(UNBOUNDED);
  10660. } else {
  10661. this.adapter_.removeClass(UNBOUNDED);
  10662. }
  10663. }
  10664. }, {
  10665. key: 'handleFocus',
  10666. value: function handleFocus() {
  10667. var _this16 = this;
  10668. requestAnimationFrame(function () {
  10669. return _this16.adapter_.addClass(MDCRippleFoundation.cssClasses.BG_FOCUSED);
  10670. });
  10671. }
  10672. }, {
  10673. key: 'handleBlur',
  10674. value: function handleBlur() {
  10675. var _this17 = this;
  10676. requestAnimationFrame(function () {
  10677. return _this17.adapter_.removeClass(MDCRippleFoundation.cssClasses.BG_FOCUSED);
  10678. });
  10679. }
  10680. }]);
  10681. return MDCRippleFoundation;
  10682. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  10683. /* harmony default export */ __webpack_exports__["a"] = (MDCRippleFoundation);
  10684. /***/ }),
  10685. /* 70 */
  10686. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10687. "use strict";
  10688. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  10689. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; });
  10690. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; });
  10691. /**
  10692. * @license
  10693. * Copyright 2016 Google Inc.
  10694. *
  10695. * Permission is hereby granted, free of charge, to any person obtaining a copy
  10696. * of this software and associated documentation files (the "Software"), to deal
  10697. * in the Software without restriction, including without limitation the rights
  10698. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10699. * copies of the Software, and to permit persons to whom the Software is
  10700. * furnished to do so, subject to the following conditions:
  10701. *
  10702. * The above copyright notice and this permission notice shall be included in
  10703. * all copies or substantial portions of the Software.
  10704. *
  10705. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  10706. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  10707. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  10708. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  10709. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  10710. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  10711. * THE SOFTWARE.
  10712. */
  10713. var cssClasses = {
  10714. // Ripple is a special case where the "root" component is really a "mixin" of sorts,
  10715. // given that it's an 'upgrade' to an existing component. That being said it is the root
  10716. // CSS class that all other CSS classes derive from.
  10717. ROOT: 'mdc-ripple-upgraded',
  10718. UNBOUNDED: 'mdc-ripple-upgraded--unbounded',
  10719. BG_FOCUSED: 'mdc-ripple-upgraded--background-focused',
  10720. FG_ACTIVATION: 'mdc-ripple-upgraded--foreground-activation',
  10721. FG_DEACTIVATION: 'mdc-ripple-upgraded--foreground-deactivation'
  10722. };
  10723. var strings = {
  10724. VAR_LEFT: '--mdc-ripple-left',
  10725. VAR_TOP: '--mdc-ripple-top',
  10726. VAR_FG_SIZE: '--mdc-ripple-fg-size',
  10727. VAR_FG_SCALE: '--mdc-ripple-fg-scale',
  10728. VAR_FG_TRANSLATE_START: '--mdc-ripple-fg-translate-start',
  10729. VAR_FG_TRANSLATE_END: '--mdc-ripple-fg-translate-end'
  10730. };
  10731. var numbers = {
  10732. PADDING: 10,
  10733. INITIAL_ORIGIN_SCALE: 0.6,
  10734. DEACTIVATION_TIMEOUT_MS: 225, // Corresponds to $mdc-ripple-translate-duration (i.e. activation animation duration)
  10735. FG_DEACTIVATION_MS: 150, // Corresponds to $mdc-ripple-fade-out-duration (i.e. deactivation animation duration)
  10736. TAP_DELAY_MS: 300 };
  10737. /***/ }),
  10738. /* 71 */
  10739. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10740. "use strict";
  10741. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  10742. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_selection_control_index__ = __webpack_require__(3);
  10743. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__adapter__ = __webpack_require__(72);
  10744. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__constants__ = __webpack_require__(73);
  10745. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  10746. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  10747. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  10748. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  10749. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  10750. /**
  10751. * @license
  10752. * Copyright 2016 Google Inc.
  10753. *
  10754. * Permission is hereby granted, free of charge, to any person obtaining a copy
  10755. * of this software and associated documentation files (the "Software"), to deal
  10756. * in the Software without restriction, including without limitation the rights
  10757. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10758. * copies of the Software, and to permit persons to whom the Software is
  10759. * furnished to do so, subject to the following conditions:
  10760. *
  10761. * The above copyright notice and this permission notice shall be included in
  10762. * all copies or substantial portions of the Software.
  10763. *
  10764. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  10765. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  10766. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  10767. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  10768. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  10769. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  10770. * THE SOFTWARE.
  10771. */
  10772. /* eslint-disable no-unused-vars */
  10773. /* eslint-enable no-unused-vars */
  10774. /**
  10775. * @extends {MDCFoundation<!MDCCheckboxAdapter>}
  10776. */
  10777. var MDCCheckboxFoundation = function (_MDCFoundation) {
  10778. _inherits(MDCCheckboxFoundation, _MDCFoundation);
  10779. _createClass(MDCCheckboxFoundation, null, [{
  10780. key: 'cssClasses',
  10781. /** @return enum {cssClasses} */
  10782. get: function get() {
  10783. return __WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */];
  10784. }
  10785. /** @return enum {strings} */
  10786. }, {
  10787. key: 'strings',
  10788. get: function get() {
  10789. return __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */];
  10790. }
  10791. /** @return enum {numbers} */
  10792. }, {
  10793. key: 'numbers',
  10794. get: function get() {
  10795. return __WEBPACK_IMPORTED_MODULE_3__constants__["b" /* numbers */];
  10796. }
  10797. /** @return {!MDCCheckboxAdapter} */
  10798. }, {
  10799. key: 'defaultAdapter',
  10800. get: function get() {
  10801. return (/** @type {!MDCCheckboxAdapter} */{
  10802. addClass: function addClass() /* className: string */{},
  10803. removeClass: function removeClass() /* className: string */{},
  10804. setNativeControlAttr: function setNativeControlAttr() /* attr: string, value: string */{},
  10805. removeNativeControlAttr: function removeNativeControlAttr() /* attr: string */{},
  10806. forceLayout: function forceLayout() {},
  10807. isAttachedToDOM: function isAttachedToDOM() /* boolean */{},
  10808. isIndeterminate: function isIndeterminate() /* boolean */{},
  10809. isChecked: function isChecked() /* boolean */{},
  10810. hasNativeControl: function hasNativeControl() /* boolean */{},
  10811. setNativeControlDisabled: function setNativeControlDisabled() /* disabled: boolean */{}
  10812. }
  10813. );
  10814. }
  10815. }]);
  10816. function MDCCheckboxFoundation(adapter) {
  10817. _classCallCheck(this, MDCCheckboxFoundation);
  10818. /** @private {string} */
  10819. var _this = _possibleConstructorReturn(this, (MDCCheckboxFoundation.__proto__ || Object.getPrototypeOf(MDCCheckboxFoundation)).call(this, _extends(MDCCheckboxFoundation.defaultAdapter, adapter)));
  10820. _this.currentCheckState_ = __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].TRANSITION_STATE_INIT;
  10821. /** @private {string} */
  10822. _this.currentAnimationClass_ = '';
  10823. /** @private {number} */
  10824. _this.animEndLatchTimer_ = 0;
  10825. /** @private {boolean} */
  10826. _this.enableAnimationEndHandler_ = false;
  10827. return _this;
  10828. }
  10829. /** @override */
  10830. _createClass(MDCCheckboxFoundation, [{
  10831. key: 'init',
  10832. value: function init() {
  10833. this.currentCheckState_ = this.determineCheckState_();
  10834. this.updateAriaChecked_();
  10835. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].UPGRADED);
  10836. }
  10837. /** @override */
  10838. }, {
  10839. key: 'destroy',
  10840. value: function destroy() {
  10841. clearTimeout(this.animEndLatchTimer_);
  10842. }
  10843. /** @param {boolean} disabled */
  10844. }, {
  10845. key: 'setDisabled',
  10846. value: function setDisabled(disabled) {
  10847. this.adapter_.setNativeControlDisabled(disabled);
  10848. if (disabled) {
  10849. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].DISABLED);
  10850. } else {
  10851. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].DISABLED);
  10852. }
  10853. }
  10854. /**
  10855. * Handles the animationend event for the checkbox
  10856. */
  10857. }, {
  10858. key: 'handleAnimationEnd',
  10859. value: function handleAnimationEnd() {
  10860. var _this2 = this;
  10861. if (!this.enableAnimationEndHandler_) return;
  10862. clearTimeout(this.animEndLatchTimer_);
  10863. this.animEndLatchTimer_ = setTimeout(function () {
  10864. _this2.adapter_.removeClass(_this2.currentAnimationClass_);
  10865. _this2.enableAnimationEndHandler_ = false;
  10866. }, __WEBPACK_IMPORTED_MODULE_3__constants__["b" /* numbers */].ANIM_END_LATCH_MS);
  10867. }
  10868. /**
  10869. * Handles the change event for the checkbox
  10870. */
  10871. }, {
  10872. key: 'handleChange',
  10873. value: function handleChange() {
  10874. this.transitionCheckState_();
  10875. }
  10876. /** @private */
  10877. }, {
  10878. key: 'transitionCheckState_',
  10879. value: function transitionCheckState_() {
  10880. if (!this.adapter_.hasNativeControl()) {
  10881. return;
  10882. }
  10883. var oldState = this.currentCheckState_;
  10884. var newState = this.determineCheckState_();
  10885. if (oldState === newState) {
  10886. return;
  10887. }
  10888. this.updateAriaChecked_();
  10889. // Check to ensure that there isn't a previously existing animation class, in case for example
  10890. // the user interacted with the checkbox before the animation was finished.
  10891. if (this.currentAnimationClass_.length > 0) {
  10892. clearTimeout(this.animEndLatchTimer_);
  10893. this.adapter_.forceLayout();
  10894. this.adapter_.removeClass(this.currentAnimationClass_);
  10895. }
  10896. this.currentAnimationClass_ = this.getTransitionAnimationClass_(oldState, newState);
  10897. this.currentCheckState_ = newState;
  10898. // Check for parentNode so that animations are only run when the element is attached
  10899. // to the DOM.
  10900. if (this.adapter_.isAttachedToDOM() && this.currentAnimationClass_.length > 0) {
  10901. this.adapter_.addClass(this.currentAnimationClass_);
  10902. this.enableAnimationEndHandler_ = true;
  10903. }
  10904. }
  10905. /**
  10906. * @return {string}
  10907. * @private
  10908. */
  10909. }, {
  10910. key: 'determineCheckState_',
  10911. value: function determineCheckState_() {
  10912. var TRANSITION_STATE_INDETERMINATE = __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].TRANSITION_STATE_INDETERMINATE,
  10913. TRANSITION_STATE_CHECKED = __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].TRANSITION_STATE_CHECKED,
  10914. TRANSITION_STATE_UNCHECKED = __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].TRANSITION_STATE_UNCHECKED;
  10915. if (this.adapter_.isIndeterminate()) {
  10916. return TRANSITION_STATE_INDETERMINATE;
  10917. }
  10918. return this.adapter_.isChecked() ? TRANSITION_STATE_CHECKED : TRANSITION_STATE_UNCHECKED;
  10919. }
  10920. /**
  10921. * @param {string} oldState
  10922. * @param {string} newState
  10923. * @return {string}
  10924. */
  10925. }, {
  10926. key: 'getTransitionAnimationClass_',
  10927. value: function getTransitionAnimationClass_(oldState, newState) {
  10928. var TRANSITION_STATE_INIT = __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].TRANSITION_STATE_INIT,
  10929. TRANSITION_STATE_CHECKED = __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].TRANSITION_STATE_CHECKED,
  10930. TRANSITION_STATE_UNCHECKED = __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].TRANSITION_STATE_UNCHECKED;
  10931. var _MDCCheckboxFoundatio = MDCCheckboxFoundation.cssClasses,
  10932. ANIM_UNCHECKED_CHECKED = _MDCCheckboxFoundatio.ANIM_UNCHECKED_CHECKED,
  10933. ANIM_UNCHECKED_INDETERMINATE = _MDCCheckboxFoundatio.ANIM_UNCHECKED_INDETERMINATE,
  10934. ANIM_CHECKED_UNCHECKED = _MDCCheckboxFoundatio.ANIM_CHECKED_UNCHECKED,
  10935. ANIM_CHECKED_INDETERMINATE = _MDCCheckboxFoundatio.ANIM_CHECKED_INDETERMINATE,
  10936. ANIM_INDETERMINATE_CHECKED = _MDCCheckboxFoundatio.ANIM_INDETERMINATE_CHECKED,
  10937. ANIM_INDETERMINATE_UNCHECKED = _MDCCheckboxFoundatio.ANIM_INDETERMINATE_UNCHECKED;
  10938. switch (oldState) {
  10939. case TRANSITION_STATE_INIT:
  10940. if (newState === TRANSITION_STATE_UNCHECKED) {
  10941. return '';
  10942. }
  10943. // fallthrough
  10944. case TRANSITION_STATE_UNCHECKED:
  10945. return newState === TRANSITION_STATE_CHECKED ? ANIM_UNCHECKED_CHECKED : ANIM_UNCHECKED_INDETERMINATE;
  10946. case TRANSITION_STATE_CHECKED:
  10947. return newState === TRANSITION_STATE_UNCHECKED ? ANIM_CHECKED_UNCHECKED : ANIM_CHECKED_INDETERMINATE;
  10948. // TRANSITION_STATE_INDETERMINATE
  10949. default:
  10950. return newState === TRANSITION_STATE_CHECKED ? ANIM_INDETERMINATE_CHECKED : ANIM_INDETERMINATE_UNCHECKED;
  10951. }
  10952. }
  10953. }, {
  10954. key: 'updateAriaChecked_',
  10955. value: function updateAriaChecked_() {
  10956. // Ensure aria-checked is set to mixed if checkbox is in indeterminate state.
  10957. if (this.adapter_.isIndeterminate()) {
  10958. this.adapter_.setNativeControlAttr(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].ARIA_CHECKED_ATTR, __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].ARIA_CHECKED_INDETERMINATE_VALUE);
  10959. } else {
  10960. // The on/off state does not need to keep track of aria-checked, since
  10961. // the screenreader uses the checked property on the checkbox element.
  10962. this.adapter_.removeNativeControlAttr(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].ARIA_CHECKED_ATTR);
  10963. }
  10964. }
  10965. }]);
  10966. return MDCCheckboxFoundation;
  10967. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  10968. /* harmony default export */ __webpack_exports__["a"] = (MDCCheckboxFoundation);
  10969. /***/ }),
  10970. /* 72 */
  10971. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10972. "use strict";
  10973. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_selection_control_index__ = __webpack_require__(3);
  10974. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  10975. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  10976. /**
  10977. * @license
  10978. * Copyright 2016 Google Inc.
  10979. *
  10980. * Permission is hereby granted, free of charge, to any person obtaining a copy
  10981. * of this software and associated documentation files (the "Software"), to deal
  10982. * in the Software without restriction, including without limitation the rights
  10983. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10984. * copies of the Software, and to permit persons to whom the Software is
  10985. * furnished to do so, subject to the following conditions:
  10986. *
  10987. * The above copyright notice and this permission notice shall be included in
  10988. * all copies or substantial portions of the Software.
  10989. *
  10990. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  10991. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  10992. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  10993. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  10994. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  10995. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  10996. * THE SOFTWARE.
  10997. */
  10998. /* eslint-disable no-unused-vars */
  10999. /* eslint no-unused-vars: [2, {"args": "none"}] */
  11000. /**
  11001. * Adapter for MDC Checkbox. Provides an interface for managing
  11002. * - classes
  11003. * - dom
  11004. * - event handlers
  11005. *
  11006. * Additionally, provides type information for the adapter to the Closure
  11007. * compiler.
  11008. *
  11009. * Implement this adapter for your framework of choice to delegate updates to
  11010. * the component in your framework of choice. See architecture documentation
  11011. * for more details.
  11012. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  11013. *
  11014. * @record
  11015. */
  11016. var MDCCheckboxAdapter = function () {
  11017. function MDCCheckboxAdapter() {
  11018. _classCallCheck(this, MDCCheckboxAdapter);
  11019. }
  11020. _createClass(MDCCheckboxAdapter, [{
  11021. key: 'addClass',
  11022. /** @param {string} className */
  11023. value: function addClass(className) {}
  11024. /** @param {string} className */
  11025. }, {
  11026. key: 'removeClass',
  11027. value: function removeClass(className) {}
  11028. /**
  11029. * Sets an attribute with a given value on the input element.
  11030. * @param {string} attr
  11031. * @param {string} value
  11032. */
  11033. }, {
  11034. key: 'setNativeControlAttr',
  11035. value: function setNativeControlAttr(attr, value) {}
  11036. /**
  11037. * Removes an attribute from the input element.
  11038. * @param {string} attr
  11039. */
  11040. }, {
  11041. key: 'removeNativeControlAttr',
  11042. value: function removeNativeControlAttr(attr) {}
  11043. }, {
  11044. key: 'forceLayout',
  11045. value: function forceLayout() {}
  11046. /** @return {boolean} */
  11047. }, {
  11048. key: 'isAttachedToDOM',
  11049. value: function isAttachedToDOM() {}
  11050. /** @return {boolean} */
  11051. }, {
  11052. key: 'isIndeterminate',
  11053. value: function isIndeterminate() {}
  11054. /** @return {boolean} */
  11055. }, {
  11056. key: 'isChecked',
  11057. value: function isChecked() {}
  11058. /** @return {boolean} */
  11059. }, {
  11060. key: 'hasNativeControl',
  11061. value: function hasNativeControl() {}
  11062. /** @param {boolean} disabled */
  11063. }, {
  11064. key: 'setNativeControlDisabled',
  11065. value: function setNativeControlDisabled(disabled) {}
  11066. }]);
  11067. return MDCCheckboxAdapter;
  11068. }();
  11069. /* unused harmony default export */ var _unused_webpack_default_export = (MDCCheckboxAdapter);
  11070. /***/ }),
  11071. /* 73 */
  11072. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11073. "use strict";
  11074. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  11075. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; });
  11076. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; });
  11077. /**
  11078. * @license
  11079. * Copyright 2016 Google Inc.
  11080. *
  11081. * Permission is hereby granted, free of charge, to any person obtaining a copy
  11082. * of this software and associated documentation files (the "Software"), to deal
  11083. * in the Software without restriction, including without limitation the rights
  11084. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  11085. * copies of the Software, and to permit persons to whom the Software is
  11086. * furnished to do so, subject to the following conditions:
  11087. *
  11088. * The above copyright notice and this permission notice shall be included in
  11089. * all copies or substantial portions of the Software.
  11090. *
  11091. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  11092. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  11093. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  11094. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  11095. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  11096. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  11097. * THE SOFTWARE.
  11098. */
  11099. /** @const {string} */
  11100. var ROOT = 'mdc-checkbox';
  11101. /** @enum {string} */
  11102. var cssClasses = {
  11103. UPGRADED: 'mdc-checkbox--upgraded',
  11104. CHECKED: 'mdc-checkbox--checked',
  11105. INDETERMINATE: 'mdc-checkbox--indeterminate',
  11106. DISABLED: 'mdc-checkbox--disabled',
  11107. ANIM_UNCHECKED_CHECKED: 'mdc-checkbox--anim-unchecked-checked',
  11108. ANIM_UNCHECKED_INDETERMINATE: 'mdc-checkbox--anim-unchecked-indeterminate',
  11109. ANIM_CHECKED_UNCHECKED: 'mdc-checkbox--anim-checked-unchecked',
  11110. ANIM_CHECKED_INDETERMINATE: 'mdc-checkbox--anim-checked-indeterminate',
  11111. ANIM_INDETERMINATE_CHECKED: 'mdc-checkbox--anim-indeterminate-checked',
  11112. ANIM_INDETERMINATE_UNCHECKED: 'mdc-checkbox--anim-indeterminate-unchecked'
  11113. };
  11114. /** @enum {string} */
  11115. var strings = {
  11116. NATIVE_CONTROL_SELECTOR: '.' + ROOT + '__native-control',
  11117. TRANSITION_STATE_INIT: 'init',
  11118. TRANSITION_STATE_CHECKED: 'checked',
  11119. TRANSITION_STATE_UNCHECKED: 'unchecked',
  11120. TRANSITION_STATE_INDETERMINATE: 'indeterminate',
  11121. ARIA_CHECKED_ATTR: 'aria-checked',
  11122. ARIA_CHECKED_INDETERMINATE_VALUE: 'mixed'
  11123. };
  11124. /** @enum {number} */
  11125. var numbers = {
  11126. ANIM_END_LATCH_MS: 250
  11127. };
  11128. /***/ }),
  11129. /* 74 */
  11130. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11131. "use strict";
  11132. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  11133. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__chip_index__ = __webpack_require__(29);
  11134. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__chip_set_index__ = __webpack_require__(75);
  11135. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCChipFoundation", function() { return __WEBPACK_IMPORTED_MODULE_0__chip_index__["b"]; });
  11136. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCChip", function() { return __WEBPACK_IMPORTED_MODULE_0__chip_index__["a"]; });
  11137. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCChipSetFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__chip_set_index__["b"]; });
  11138. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCChipSet", function() { return __WEBPACK_IMPORTED_MODULE_1__chip_set_index__["a"]; });
  11139. /**
  11140. * @license
  11141. * Copyright 2017 Google Inc.
  11142. *
  11143. * Permission is hereby granted, free of charge, to any person obtaining a copy
  11144. * of this software and associated documentation files (the "Software"), to deal
  11145. * in the Software without restriction, including without limitation the rights
  11146. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  11147. * copies of the Software, and to permit persons to whom the Software is
  11148. * furnished to do so, subject to the following conditions:
  11149. *
  11150. * The above copyright notice and this permission notice shall be included in
  11151. * all copies or substantial portions of the Software.
  11152. *
  11153. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  11154. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  11155. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  11156. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  11157. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  11158. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  11159. * THE SOFTWARE.
  11160. */
  11161. /***/ }),
  11162. /* 75 */
  11163. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11164. "use strict";
  11165. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCChipSet; });
  11166. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  11167. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(33);
  11168. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(76);
  11169. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__chip_index__ = __webpack_require__(29);
  11170. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  11171. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  11172. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  11173. var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
  11174. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11175. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  11176. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  11177. /**
  11178. * @license
  11179. * Copyright 2016 Google Inc.
  11180. *
  11181. * Permission is hereby granted, free of charge, to any person obtaining a copy
  11182. * of this software and associated documentation files (the "Software"), to deal
  11183. * in the Software without restriction, including without limitation the rights
  11184. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  11185. * copies of the Software, and to permit persons to whom the Software is
  11186. * furnished to do so, subject to the following conditions:
  11187. *
  11188. * The above copyright notice and this permission notice shall be included in
  11189. * all copies or substantial portions of the Software.
  11190. *
  11191. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  11192. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  11193. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  11194. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  11195. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  11196. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  11197. * THE SOFTWARE.
  11198. */
  11199. var idCounter = 0;
  11200. /**
  11201. * @extends {MDCComponent<!MDCChipSetFoundation>}
  11202. * @final
  11203. */
  11204. var MDCChipSet = function (_MDCComponent) {
  11205. _inherits(MDCChipSet, _MDCComponent);
  11206. /**
  11207. * @param {...?} args
  11208. */
  11209. function MDCChipSet() {
  11210. var _ref;
  11211. _classCallCheck(this, MDCChipSet);
  11212. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  11213. args[_key] = arguments[_key];
  11214. }
  11215. /** @type {!Array<!MDCChip>} */
  11216. var _this = _possibleConstructorReturn(this, (_ref = MDCChipSet.__proto__ || Object.getPrototypeOf(MDCChipSet)).call.apply(_ref, [this].concat(args)));
  11217. _this.chips;
  11218. /** @private {(function(!Element): !MDCChip)} */
  11219. _this.chipFactory_;
  11220. /** @private {?function(?Event): undefined} */
  11221. _this.handleChipInteraction_;
  11222. /** @private {?function(?Event): undefined} */
  11223. _this.handleChipSelection_;
  11224. /** @private {?function(?Event): undefined} */
  11225. _this.handleChipRemoval_;
  11226. return _this;
  11227. }
  11228. /**
  11229. * @param {!Element} root
  11230. * @return {!MDCChipSet}
  11231. */
  11232. _createClass(MDCChipSet, [{
  11233. key: 'initialize',
  11234. /**
  11235. * @param {(function(!Element): !MDCChip)=} chipFactory A function which
  11236. * creates a new MDCChip.
  11237. */
  11238. value: function initialize() {
  11239. var chipFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (el) {
  11240. return new __WEBPACK_IMPORTED_MODULE_3__chip_index__["a" /* MDCChip */](el);
  11241. };
  11242. this.chipFactory_ = chipFactory;
  11243. this.chips = this.instantiateChips_(this.chipFactory_);
  11244. }
  11245. }, {
  11246. key: 'initialSyncWithDOM',
  11247. value: function initialSyncWithDOM() {
  11248. var _this2 = this;
  11249. this.chips.forEach(function (chip) {
  11250. if (chip.selected) {
  11251. _this2.foundation_.select(chip.id);
  11252. }
  11253. });
  11254. this.handleChipInteraction_ = function (evt) {
  11255. return _this2.foundation_.handleChipInteraction(evt.detail.chipId);
  11256. };
  11257. this.handleChipSelection_ = function (evt) {
  11258. return _this2.foundation_.handleChipSelection(evt.detail.chipId, evt.detail.selected);
  11259. };
  11260. this.handleChipRemoval_ = function (evt) {
  11261. return _this2.foundation_.handleChipRemoval(evt.detail.chipId);
  11262. };
  11263. this.root_.addEventListener(__WEBPACK_IMPORTED_MODULE_3__chip_index__["b" /* MDCChipFoundation */].strings.INTERACTION_EVENT, this.handleChipInteraction_);
  11264. this.root_.addEventListener(__WEBPACK_IMPORTED_MODULE_3__chip_index__["b" /* MDCChipFoundation */].strings.SELECTION_EVENT, this.handleChipSelection_);
  11265. this.root_.addEventListener(__WEBPACK_IMPORTED_MODULE_3__chip_index__["b" /* MDCChipFoundation */].strings.REMOVAL_EVENT, this.handleChipRemoval_);
  11266. }
  11267. }, {
  11268. key: 'destroy',
  11269. value: function destroy() {
  11270. this.chips.forEach(function (chip) {
  11271. chip.destroy();
  11272. });
  11273. this.root_.removeEventListener(__WEBPACK_IMPORTED_MODULE_3__chip_index__["b" /* MDCChipFoundation */].strings.INTERACTION_EVENT, this.handleChipInteraction_);
  11274. this.root_.removeEventListener(__WEBPACK_IMPORTED_MODULE_3__chip_index__["b" /* MDCChipFoundation */].strings.SELECTION_EVENT, this.handleChipSelection_);
  11275. this.root_.removeEventListener(__WEBPACK_IMPORTED_MODULE_3__chip_index__["b" /* MDCChipFoundation */].strings.REMOVAL_EVENT, this.handleChipRemoval_);
  11276. _get(MDCChipSet.prototype.__proto__ || Object.getPrototypeOf(MDCChipSet.prototype), 'destroy', this).call(this);
  11277. }
  11278. /**
  11279. * Adds a new chip object to the chip set from the given chip element.
  11280. * @param {!Element} chipEl
  11281. */
  11282. }, {
  11283. key: 'addChip',
  11284. value: function addChip(chipEl) {
  11285. chipEl.id = chipEl.id || 'mdc-chip-' + ++idCounter;
  11286. this.chips.push(this.chipFactory_(chipEl));
  11287. }
  11288. /**
  11289. * Returns an array of the IDs of all selected chips.
  11290. * @return {!Array<string>}
  11291. */
  11292. }, {
  11293. key: 'getDefaultFoundation',
  11294. /**
  11295. * @return {!MDCChipSetFoundation}
  11296. */
  11297. value: function getDefaultFoundation() {
  11298. var _this3 = this;
  11299. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]( /** @type {!MDCChipSetAdapter} */_extends({
  11300. hasClass: function hasClass(className) {
  11301. return _this3.root_.classList.contains(className);
  11302. },
  11303. removeChip: function removeChip(chipId) {
  11304. var index = _this3.findChipIndex_(chipId);
  11305. if (index >= 0) {
  11306. _this3.chips[index].destroy();
  11307. _this3.chips.splice(index, 1);
  11308. }
  11309. },
  11310. setSelected: function setSelected(chipId, selected) {
  11311. var index = _this3.findChipIndex_(chipId);
  11312. if (index >= 0) {
  11313. _this3.chips[index].selected = selected;
  11314. }
  11315. }
  11316. }));
  11317. }
  11318. /**
  11319. * Instantiates chip components on all of the chip set's child chip elements.
  11320. * @param {(function(!Element): !MDCChip)} chipFactory
  11321. * @return {!Array<!MDCChip>}
  11322. */
  11323. }, {
  11324. key: 'instantiateChips_',
  11325. value: function instantiateChips_(chipFactory) {
  11326. var chipElements = [].slice.call(this.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.CHIP_SELECTOR));
  11327. return chipElements.map(function (el) {
  11328. el.id = el.id || 'mdc-chip-' + ++idCounter;
  11329. return chipFactory(el);
  11330. });
  11331. }
  11332. /**
  11333. * Returns the index of the chip with the given id, or -1 if the chip does not exist.
  11334. * @param {string} chipId
  11335. * @return {number}
  11336. */
  11337. }, {
  11338. key: 'findChipIndex_',
  11339. value: function findChipIndex_(chipId) {
  11340. for (var i = 0; i < this.chips.length; i++) {
  11341. if (this.chips[i].id === chipId) {
  11342. return i;
  11343. }
  11344. }
  11345. return -1;
  11346. }
  11347. }, {
  11348. key: 'selectedChipIds',
  11349. get: function get() {
  11350. return this.foundation_.getSelectedChipIds();
  11351. }
  11352. }], [{
  11353. key: 'attachTo',
  11354. value: function attachTo(root) {
  11355. return new MDCChipSet(root);
  11356. }
  11357. }]);
  11358. return MDCChipSet;
  11359. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  11360. /***/ }),
  11361. /* 76 */
  11362. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11363. "use strict";
  11364. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  11365. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(33);
  11366. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__chip_foundation__ = __webpack_require__(31);
  11367. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__constants__ = __webpack_require__(77);
  11368. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  11369. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  11370. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11371. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  11372. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  11373. /**
  11374. * @license
  11375. * Copyright 2017 Google Inc.
  11376. *
  11377. * Permission is hereby granted, free of charge, to any person obtaining a copy
  11378. * of this software and associated documentation files (the "Software"), to deal
  11379. * in the Software without restriction, including without limitation the rights
  11380. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  11381. * copies of the Software, and to permit persons to whom the Software is
  11382. * furnished to do so, subject to the following conditions:
  11383. *
  11384. * The above copyright notice and this permission notice shall be included in
  11385. * all copies or substantial portions of the Software.
  11386. *
  11387. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  11388. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  11389. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  11390. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  11391. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  11392. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  11393. * THE SOFTWARE.
  11394. */
  11395. // eslint-disable-next-line no-unused-vars
  11396. /**
  11397. * @extends {MDCFoundation<!MDCChipSetAdapter>}
  11398. * @final
  11399. */
  11400. var MDCChipSetFoundation = function (_MDCFoundation) {
  11401. _inherits(MDCChipSetFoundation, _MDCFoundation);
  11402. _createClass(MDCChipSetFoundation, null, [{
  11403. key: 'strings',
  11404. /** @return enum {string} */
  11405. get: function get() {
  11406. return __WEBPACK_IMPORTED_MODULE_3__constants__["b" /* strings */];
  11407. }
  11408. /** @return enum {string} */
  11409. }, {
  11410. key: 'cssClasses',
  11411. get: function get() {
  11412. return __WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */];
  11413. }
  11414. /**
  11415. * {@see MDCChipSetAdapter} for typing information on parameters and return
  11416. * types.
  11417. * @return {!MDCChipSetAdapter}
  11418. */
  11419. }, {
  11420. key: 'defaultAdapter',
  11421. get: function get() {
  11422. return (/** @type {!MDCChipSetAdapter} */{
  11423. hasClass: function hasClass() {},
  11424. removeChip: function removeChip() {},
  11425. setSelected: function setSelected() {}
  11426. }
  11427. );
  11428. }
  11429. /**
  11430. * @param {!MDCChipSetAdapter} adapter
  11431. */
  11432. }]);
  11433. function MDCChipSetFoundation(adapter) {
  11434. _classCallCheck(this, MDCChipSetFoundation);
  11435. /**
  11436. * The ids of the selected chips in the set. Only used for choice chip set or filter chip set.
  11437. * @private {!Array<string>}
  11438. */
  11439. var _this = _possibleConstructorReturn(this, (MDCChipSetFoundation.__proto__ || Object.getPrototypeOf(MDCChipSetFoundation)).call(this, _extends(MDCChipSetFoundation.defaultAdapter, adapter)));
  11440. _this.selectedChipIds_ = [];
  11441. return _this;
  11442. }
  11443. /**
  11444. * Returns an array of the IDs of all selected chips.
  11445. * @return {!Array<string>}
  11446. */
  11447. _createClass(MDCChipSetFoundation, [{
  11448. key: 'getSelectedChipIds',
  11449. value: function getSelectedChipIds() {
  11450. return this.selectedChipIds_;
  11451. }
  11452. /**
  11453. * Toggles selection of the chip with the given id.
  11454. * @private
  11455. * @param {string} chipId
  11456. */
  11457. }, {
  11458. key: 'toggleSelect_',
  11459. value: function toggleSelect_(chipId) {
  11460. if (this.selectedChipIds_.indexOf(chipId) >= 0) {
  11461. this.deselect_(chipId);
  11462. } else {
  11463. this.select(chipId);
  11464. }
  11465. }
  11466. /**
  11467. * Selects the chip with the given id. Deselects all other chips if the chip set is of the choice variant.
  11468. * @param {string} chipId
  11469. */
  11470. }, {
  11471. key: 'select',
  11472. value: function select(chipId) {
  11473. if (this.selectedChipIds_.indexOf(chipId) >= 0) {
  11474. return;
  11475. }
  11476. if (this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].CHOICE) && this.selectedChipIds_.length > 0) {
  11477. var previouslySelectedChip = this.selectedChipIds_[0];
  11478. this.selectedChipIds_.length = 0;
  11479. this.adapter_.setSelected(previouslySelectedChip, false);
  11480. }
  11481. this.selectedChipIds_.push(chipId);
  11482. this.adapter_.setSelected(chipId, true);
  11483. }
  11484. /**
  11485. * Deselects the chip with the given id.
  11486. * @private
  11487. * @param {string} chipId
  11488. */
  11489. }, {
  11490. key: 'deselect_',
  11491. value: function deselect_(chipId) {
  11492. var index = this.selectedChipIds_.indexOf(chipId);
  11493. if (index >= 0) {
  11494. this.selectedChipIds_.splice(index, 1);
  11495. this.adapter_.setSelected(chipId, false);
  11496. }
  11497. }
  11498. /**
  11499. * Handles a chip interaction event
  11500. * @param {string} chipId
  11501. */
  11502. }, {
  11503. key: 'handleChipInteraction',
  11504. value: function handleChipInteraction(chipId) {
  11505. if (this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].CHOICE) || this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].FILTER)) {
  11506. this.toggleSelect_(chipId);
  11507. }
  11508. }
  11509. /**
  11510. * Handles a chip selection event, used to handle discrepancy when selection state is set directly on the Chip.
  11511. * @param {string} chipId
  11512. * @param {boolean} selected
  11513. */
  11514. }, {
  11515. key: 'handleChipSelection',
  11516. value: function handleChipSelection(chipId, selected) {
  11517. var chipIsSelected = this.selectedChipIds_.indexOf(chipId) >= 0;
  11518. if (selected && !chipIsSelected) {
  11519. this.select(chipId);
  11520. } else if (!selected && chipIsSelected) {
  11521. this.deselect_(chipId);
  11522. }
  11523. }
  11524. /**
  11525. * Handles the event when a chip is removed.
  11526. * @param {string} chipId
  11527. */
  11528. }, {
  11529. key: 'handleChipRemoval',
  11530. value: function handleChipRemoval(chipId) {
  11531. this.deselect_(chipId);
  11532. this.adapter_.removeChip(chipId);
  11533. }
  11534. }]);
  11535. return MDCChipSetFoundation;
  11536. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  11537. /* harmony default export */ __webpack_exports__["a"] = (MDCChipSetFoundation);
  11538. /***/ }),
  11539. /* 77 */
  11540. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11541. "use strict";
  11542. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  11543. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  11544. /**
  11545. * @license
  11546. * Copyright 2016 Google Inc.
  11547. *
  11548. * Permission is hereby granted, free of charge, to any person obtaining a copy
  11549. * of this software and associated documentation files (the "Software"), to deal
  11550. * in the Software without restriction, including without limitation the rights
  11551. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  11552. * copies of the Software, and to permit persons to whom the Software is
  11553. * furnished to do so, subject to the following conditions:
  11554. *
  11555. * The above copyright notice and this permission notice shall be included in
  11556. * all copies or substantial portions of the Software.
  11557. *
  11558. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  11559. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  11560. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  11561. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  11562. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  11563. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  11564. * THE SOFTWARE.
  11565. */
  11566. /** @enum {string} */
  11567. var strings = {
  11568. CHIP_SELECTOR: '.mdc-chip'
  11569. };
  11570. /** @enum {string} */
  11571. var cssClasses = {
  11572. CHOICE: 'mdc-chip-set--choice',
  11573. FILTER: 'mdc-chip-set--filter'
  11574. };
  11575. /***/ }),
  11576. /* 78 */
  11577. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11578. "use strict";
  11579. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  11580. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCDialog", function() { return MDCDialog; });
  11581. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  11582. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__ = __webpack_require__(2);
  11583. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(79);
  11584. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util__ = __webpack_require__(82);
  11585. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__material_dom_ponyfill__ = __webpack_require__(8);
  11586. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_focus_trap__ = __webpack_require__(34);
  11587. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_focus_trap___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_focus_trap__);
  11588. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCDialogFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  11589. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "util", function() { return __WEBPACK_IMPORTED_MODULE_3__util__; });
  11590. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  11591. var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
  11592. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11593. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  11594. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  11595. /**
  11596. * @license
  11597. * Copyright 2017 Google Inc.
  11598. *
  11599. * Permission is hereby granted, free of charge, to any person obtaining a copy
  11600. * of this software and associated documentation files (the "Software"), to deal
  11601. * in the Software without restriction, including without limitation the rights
  11602. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  11603. * copies of the Software, and to permit persons to whom the Software is
  11604. * furnished to do so, subject to the following conditions:
  11605. *
  11606. * The above copyright notice and this permission notice shall be included in
  11607. * all copies or substantial portions of the Software.
  11608. *
  11609. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  11610. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  11611. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  11612. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  11613. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  11614. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  11615. * THE SOFTWARE.
  11616. */
  11617. var strings = __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings;
  11618. var MDCDialog = function (_MDCComponent) {
  11619. _inherits(MDCDialog, _MDCComponent);
  11620. function MDCDialog() {
  11621. var _ref;
  11622. _classCallCheck(this, MDCDialog);
  11623. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  11624. args[_key] = arguments[_key];
  11625. }
  11626. /**
  11627. * @type {!Array<!MDCRipple>}
  11628. * @private
  11629. */
  11630. var _this = _possibleConstructorReturn(this, (_ref = MDCDialog.__proto__ || Object.getPrototypeOf(MDCDialog)).call.apply(_ref, [this].concat(args)));
  11631. _this.buttonRipples_;
  11632. /** @private {!Array<!Element>} */
  11633. _this.buttons_;
  11634. /** @private {?Element} */
  11635. _this.defaultButton_;
  11636. /** @private {!Element} */
  11637. _this.container_;
  11638. /** @private {?Element} */
  11639. _this.content_;
  11640. /** @private {?Element} */
  11641. _this.initialFocusEl_;
  11642. /** @private {!Function} */
  11643. _this.focusTrapFactory_;
  11644. /** @private {!FocusTrapInstance} */
  11645. _this.focusTrap_;
  11646. /** @private {!Function} */
  11647. _this.handleInteraction_;
  11648. /** @private {!Function} */
  11649. _this.handleDocumentKeydown_;
  11650. /** @private {!Function} */
  11651. _this.handleOpening_;
  11652. /** @private {!Function} */
  11653. _this.handleClosing_;
  11654. /** @private {Function} */
  11655. _this.layout_;
  11656. return _this;
  11657. }
  11658. _createClass(MDCDialog, [{
  11659. key: 'initialize',
  11660. value: function initialize() {
  11661. var focusTrapFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : __WEBPACK_IMPORTED_MODULE_5_focus_trap___default.a;
  11662. var initialFocusEl = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
  11663. this.container_ = /** @type {!Element} */this.root_.querySelector(strings.CONTAINER_SELECTOR);
  11664. this.content_ = this.root_.querySelector(strings.CONTENT_SELECTOR);
  11665. this.buttons_ = [].slice.call(this.root_.querySelectorAll(strings.BUTTON_SELECTOR));
  11666. this.defaultButton_ = this.root_.querySelector(strings.DEFAULT_BUTTON_SELECTOR);
  11667. this.buttonRipples_ = [];
  11668. this.focusTrapFactory_ = focusTrapFactory;
  11669. this.initialFocusEl_ = initialFocusEl;
  11670. for (var i = 0, buttonEl; buttonEl = this.buttons_[i]; i++) {
  11671. this.buttonRipples_.push(new __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRipple"](buttonEl));
  11672. }
  11673. }
  11674. }, {
  11675. key: 'initialSyncWithDOM',
  11676. value: function initialSyncWithDOM() {
  11677. var _this2 = this;
  11678. this.focusTrap_ = __WEBPACK_IMPORTED_MODULE_3__util__["createFocusTrapInstance"](this.container_, this.focusTrapFactory_, this.initialFocusEl_);
  11679. this.handleInteraction_ = this.foundation_.handleInteraction.bind(this.foundation_);
  11680. this.handleDocumentKeydown_ = this.foundation_.handleDocumentKeydown.bind(this.foundation_);
  11681. this.layout_ = this.layout.bind(this);
  11682. var LAYOUT_EVENTS = ['resize', 'orientationchange'];
  11683. this.handleOpening_ = function () {
  11684. LAYOUT_EVENTS.forEach(function (type) {
  11685. return window.addEventListener(type, _this2.layout_);
  11686. });
  11687. document.addEventListener('keydown', _this2.handleDocumentKeydown_);
  11688. };
  11689. this.handleClosing_ = function () {
  11690. LAYOUT_EVENTS.forEach(function (type) {
  11691. return window.removeEventListener(type, _this2.layout_);
  11692. });
  11693. document.removeEventListener('keydown', _this2.handleDocumentKeydown_);
  11694. };
  11695. this.listen('click', this.handleInteraction_);
  11696. this.listen('keydown', this.handleInteraction_);
  11697. this.listen(strings.OPENING_EVENT, this.handleOpening_);
  11698. this.listen(strings.CLOSING_EVENT, this.handleClosing_);
  11699. }
  11700. }, {
  11701. key: 'destroy',
  11702. value: function destroy() {
  11703. this.unlisten('click', this.handleInteraction_);
  11704. this.unlisten('keydown', this.handleInteraction_);
  11705. this.unlisten(strings.OPENING_EVENT, this.handleOpening_);
  11706. this.unlisten(strings.CLOSING_EVENT, this.handleClosing_);
  11707. this.handleClosing_();
  11708. this.buttonRipples_.forEach(function (ripple) {
  11709. return ripple.destroy();
  11710. });
  11711. _get(MDCDialog.prototype.__proto__ || Object.getPrototypeOf(MDCDialog.prototype), 'destroy', this).call(this);
  11712. }
  11713. }, {
  11714. key: 'layout',
  11715. value: function layout() {
  11716. this.foundation_.layout();
  11717. }
  11718. }, {
  11719. key: 'open',
  11720. value: function open() {
  11721. this.foundation_.open();
  11722. }
  11723. /**
  11724. * @param {string=} action
  11725. */
  11726. }, {
  11727. key: 'close',
  11728. value: function close() {
  11729. var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  11730. this.foundation_.close(action);
  11731. }
  11732. }, {
  11733. key: 'getDefaultFoundation',
  11734. value: function getDefaultFoundation() {
  11735. var _this3 = this;
  11736. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]({
  11737. addClass: function addClass(className) {
  11738. return _this3.root_.classList.add(className);
  11739. },
  11740. removeClass: function removeClass(className) {
  11741. return _this3.root_.classList.remove(className);
  11742. },
  11743. hasClass: function hasClass(className) {
  11744. return _this3.root_.classList.contains(className);
  11745. },
  11746. addBodyClass: function addBodyClass(className) {
  11747. return document.body.classList.add(className);
  11748. },
  11749. removeBodyClass: function removeBodyClass(className) {
  11750. return document.body.classList.remove(className);
  11751. },
  11752. eventTargetMatches: function eventTargetMatches(target, selector) {
  11753. return Object(__WEBPACK_IMPORTED_MODULE_4__material_dom_ponyfill__["matches"])(target, selector);
  11754. },
  11755. trapFocus: function trapFocus() {
  11756. return _this3.focusTrap_.activate();
  11757. },
  11758. releaseFocus: function releaseFocus() {
  11759. return _this3.focusTrap_.deactivate();
  11760. },
  11761. isContentScrollable: function isContentScrollable() {
  11762. return !!_this3.content_ && __WEBPACK_IMPORTED_MODULE_3__util__["isScrollable"]( /** @type {!Element} */_this3.content_);
  11763. },
  11764. areButtonsStacked: function areButtonsStacked() {
  11765. return __WEBPACK_IMPORTED_MODULE_3__util__["areTopsMisaligned"](_this3.buttons_);
  11766. },
  11767. getActionFromEvent: function getActionFromEvent(event) {
  11768. var element = Object(__WEBPACK_IMPORTED_MODULE_4__material_dom_ponyfill__["closest"])(event.target, '[' + strings.ACTION_ATTRIBUTE + ']');
  11769. return element && element.getAttribute(strings.ACTION_ATTRIBUTE);
  11770. },
  11771. clickDefaultButton: function clickDefaultButton() {
  11772. if (_this3.defaultButton_) {
  11773. _this3.defaultButton_.click();
  11774. }
  11775. },
  11776. reverseButtons: function reverseButtons() {
  11777. _this3.buttons_.reverse();
  11778. _this3.buttons_.forEach(function (button) {
  11779. return button.parentElement.appendChild(button);
  11780. });
  11781. },
  11782. notifyOpening: function notifyOpening() {
  11783. return _this3.emit(strings.OPENING_EVENT, {});
  11784. },
  11785. notifyOpened: function notifyOpened() {
  11786. return _this3.emit(strings.OPENED_EVENT, {});
  11787. },
  11788. notifyClosing: function notifyClosing(action) {
  11789. return _this3.emit(strings.CLOSING_EVENT, action ? { action: action } : {});
  11790. },
  11791. notifyClosed: function notifyClosed(action) {
  11792. return _this3.emit(strings.CLOSED_EVENT, action ? { action: action } : {});
  11793. }
  11794. });
  11795. }
  11796. }, {
  11797. key: 'isOpen',
  11798. get: function get() {
  11799. return this.foundation_.isOpen();
  11800. }
  11801. }, {
  11802. key: 'escapeKeyAction',
  11803. get: function get() {
  11804. return this.foundation_.getEscapeKeyAction();
  11805. },
  11806. set: function set(action) {
  11807. this.foundation_.setEscapeKeyAction(action);
  11808. }
  11809. }, {
  11810. key: 'scrimClickAction',
  11811. get: function get() {
  11812. return this.foundation_.getScrimClickAction();
  11813. },
  11814. set: function set(action) {
  11815. this.foundation_.setScrimClickAction(action);
  11816. }
  11817. }, {
  11818. key: 'autoStackButtons',
  11819. get: function get() {
  11820. return this.foundation_.getAutoStackButtons();
  11821. },
  11822. set: function set(autoStack) {
  11823. this.foundation_.setAutoStackButtons(autoStack);
  11824. }
  11825. }], [{
  11826. key: 'attachTo',
  11827. value: function attachTo(root) {
  11828. return new MDCDialog(root);
  11829. }
  11830. }]);
  11831. return MDCDialog;
  11832. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  11833. /***/ }),
  11834. /* 79 */
  11835. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11836. "use strict";
  11837. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  11838. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(80);
  11839. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(81);
  11840. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  11841. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  11842. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11843. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  11844. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  11845. /**
  11846. * @license
  11847. * Copyright 2017 Google Inc.
  11848. *
  11849. * Permission is hereby granted, free of charge, to any person obtaining a copy
  11850. * of this software and associated documentation files (the "Software"), to deal
  11851. * in the Software without restriction, including without limitation the rights
  11852. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  11853. * copies of the Software, and to permit persons to whom the Software is
  11854. * furnished to do so, subject to the following conditions:
  11855. *
  11856. * The above copyright notice and this permission notice shall be included in
  11857. * all copies or substantial portions of the Software.
  11858. *
  11859. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  11860. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  11861. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  11862. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  11863. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  11864. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  11865. * THE SOFTWARE.
  11866. */
  11867. var MDCDialogFoundation = function (_MDCFoundation) {
  11868. _inherits(MDCDialogFoundation, _MDCFoundation);
  11869. _createClass(MDCDialogFoundation, null, [{
  11870. key: 'cssClasses',
  11871. get: function get() {
  11872. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  11873. }
  11874. }, {
  11875. key: 'strings',
  11876. get: function get() {
  11877. return __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */];
  11878. }
  11879. }, {
  11880. key: 'numbers',
  11881. get: function get() {
  11882. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */];
  11883. }
  11884. }, {
  11885. key: 'defaultAdapter',
  11886. get: function get() {
  11887. return (/** @type {!MDCDialogAdapter} */{
  11888. addClass: function addClass() /* className: string */{},
  11889. removeClass: function removeClass() /* className: string */{},
  11890. hasClass: function hasClass() /* className: string */{},
  11891. addBodyClass: function addBodyClass() /* className: string */{},
  11892. removeBodyClass: function removeBodyClass() /* className: string */{},
  11893. eventTargetMatches: function eventTargetMatches() /* target: !EventTarget, selector: string */{},
  11894. trapFocus: function trapFocus() {},
  11895. releaseFocus: function releaseFocus() {},
  11896. isContentScrollable: function isContentScrollable() {},
  11897. areButtonsStacked: function areButtonsStacked() {},
  11898. getActionFromEvent: function getActionFromEvent() /* event: !Event */{},
  11899. clickDefaultButton: function clickDefaultButton() {},
  11900. reverseButtons: function reverseButtons() {},
  11901. notifyOpening: function notifyOpening() {},
  11902. notifyOpened: function notifyOpened() {},
  11903. notifyClosing: function notifyClosing() /* action: ?string */{},
  11904. notifyClosed: function notifyClosed() /* action: ?string */{}
  11905. }
  11906. );
  11907. }
  11908. /**
  11909. * @param {!MDCDialogAdapter=} adapter
  11910. */
  11911. }]);
  11912. function MDCDialogFoundation(adapter) {
  11913. _classCallCheck(this, MDCDialogFoundation);
  11914. /** @private {boolean} */
  11915. var _this = _possibleConstructorReturn(this, (MDCDialogFoundation.__proto__ || Object.getPrototypeOf(MDCDialogFoundation)).call(this, _extends(MDCDialogFoundation.defaultAdapter, adapter)));
  11916. _this.isOpen_ = false;
  11917. /** @private {number} */
  11918. _this.animationFrame_ = 0;
  11919. /** @private {number} */
  11920. _this.animationTimer_ = 0;
  11921. /** @private {number} */
  11922. _this.layoutFrame_ = 0;
  11923. /** @private {string} */
  11924. _this.escapeKeyAction_ = __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].CLOSE_ACTION;
  11925. /** @private {string} */
  11926. _this.scrimClickAction_ = __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].CLOSE_ACTION;
  11927. /** @private {boolean} */
  11928. _this.autoStackButtons_ = true;
  11929. /** @private {boolean} */
  11930. _this.areButtonsStacked_ = false;
  11931. return _this;
  11932. }
  11933. _createClass(MDCDialogFoundation, [{
  11934. key: 'init',
  11935. value: function init() {
  11936. if (this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].STACKED)) {
  11937. this.setAutoStackButtons(false);
  11938. }
  11939. }
  11940. }, {
  11941. key: 'destroy',
  11942. value: function destroy() {
  11943. if (this.isOpen_) {
  11944. this.close(__WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].DESTROY_ACTION);
  11945. }
  11946. if (this.animationTimer_) {
  11947. clearTimeout(this.animationTimer_);
  11948. this.handleAnimationTimerEnd_();
  11949. }
  11950. if (this.layoutFrame_) {
  11951. cancelAnimationFrame(this.layoutFrame_);
  11952. this.layoutFrame_ = 0;
  11953. }
  11954. }
  11955. }, {
  11956. key: 'open',
  11957. value: function open() {
  11958. var _this2 = this;
  11959. this.isOpen_ = true;
  11960. this.adapter_.notifyOpening();
  11961. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].OPENING);
  11962. // Wait a frame once display is no longer "none", to establish basis for animation
  11963. this.runNextAnimationFrame_(function () {
  11964. _this2.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].OPEN);
  11965. _this2.adapter_.addBodyClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SCROLL_LOCK);
  11966. _this2.layout();
  11967. _this2.animationTimer_ = setTimeout(function () {
  11968. _this2.handleAnimationTimerEnd_();
  11969. _this2.adapter_.trapFocus();
  11970. _this2.adapter_.notifyOpened();
  11971. }, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].DIALOG_ANIMATION_OPEN_TIME_MS);
  11972. });
  11973. }
  11974. /**
  11975. * @param {string=} action
  11976. */
  11977. }, {
  11978. key: 'close',
  11979. value: function close() {
  11980. var _this3 = this;
  11981. var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  11982. if (!this.isOpen_) {
  11983. // Avoid redundant close calls (and events), e.g. from keydown on elements that inherently emit click
  11984. return;
  11985. }
  11986. this.isOpen_ = false;
  11987. this.adapter_.notifyClosing(action);
  11988. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CLOSING);
  11989. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].OPEN);
  11990. this.adapter_.removeBodyClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SCROLL_LOCK);
  11991. cancelAnimationFrame(this.animationFrame_);
  11992. this.animationFrame_ = 0;
  11993. clearTimeout(this.animationTimer_);
  11994. this.animationTimer_ = setTimeout(function () {
  11995. _this3.adapter_.releaseFocus();
  11996. _this3.handleAnimationTimerEnd_();
  11997. _this3.adapter_.notifyClosed(action);
  11998. }, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].DIALOG_ANIMATION_CLOSE_TIME_MS);
  11999. }
  12000. }, {
  12001. key: 'isOpen',
  12002. value: function isOpen() {
  12003. return this.isOpen_;
  12004. }
  12005. /** @return {string} */
  12006. }, {
  12007. key: 'getEscapeKeyAction',
  12008. value: function getEscapeKeyAction() {
  12009. return this.escapeKeyAction_;
  12010. }
  12011. /** @param {string} action */
  12012. }, {
  12013. key: 'setEscapeKeyAction',
  12014. value: function setEscapeKeyAction(action) {
  12015. this.escapeKeyAction_ = action;
  12016. }
  12017. /** @return {string} */
  12018. }, {
  12019. key: 'getScrimClickAction',
  12020. value: function getScrimClickAction() {
  12021. return this.scrimClickAction_;
  12022. }
  12023. /** @param {string} action */
  12024. }, {
  12025. key: 'setScrimClickAction',
  12026. value: function setScrimClickAction(action) {
  12027. this.scrimClickAction_ = action;
  12028. }
  12029. /** @return {boolean} */
  12030. }, {
  12031. key: 'getAutoStackButtons',
  12032. value: function getAutoStackButtons() {
  12033. return this.autoStackButtons_;
  12034. }
  12035. /** @param {boolean} autoStack */
  12036. }, {
  12037. key: 'setAutoStackButtons',
  12038. value: function setAutoStackButtons(autoStack) {
  12039. this.autoStackButtons_ = autoStack;
  12040. }
  12041. }, {
  12042. key: 'layout',
  12043. value: function layout() {
  12044. var _this4 = this;
  12045. if (this.layoutFrame_) {
  12046. cancelAnimationFrame(this.layoutFrame_);
  12047. }
  12048. this.layoutFrame_ = requestAnimationFrame(function () {
  12049. _this4.layoutInternal_();
  12050. _this4.layoutFrame_ = 0;
  12051. });
  12052. }
  12053. }, {
  12054. key: 'layoutInternal_',
  12055. value: function layoutInternal_() {
  12056. if (this.autoStackButtons_) {
  12057. this.detectStackedButtons_();
  12058. }
  12059. this.detectScrollableContent_();
  12060. }
  12061. /** @private */
  12062. }, {
  12063. key: 'detectStackedButtons_',
  12064. value: function detectStackedButtons_() {
  12065. // Remove the class first to let us measure the buttons' natural positions.
  12066. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].STACKED);
  12067. var areButtonsStacked = this.adapter_.areButtonsStacked();
  12068. if (areButtonsStacked) {
  12069. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].STACKED);
  12070. }
  12071. if (areButtonsStacked !== this.areButtonsStacked_) {
  12072. this.adapter_.reverseButtons();
  12073. this.areButtonsStacked_ = areButtonsStacked;
  12074. }
  12075. }
  12076. /** @private */
  12077. }, {
  12078. key: 'detectScrollableContent_',
  12079. value: function detectScrollableContent_() {
  12080. // Remove the class first to let us measure the natural height of the content.
  12081. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SCROLLABLE);
  12082. if (this.adapter_.isContentScrollable()) {
  12083. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SCROLLABLE);
  12084. }
  12085. }
  12086. /**
  12087. * @param {!Event} evt
  12088. * @private
  12089. */
  12090. }, {
  12091. key: 'handleInteraction',
  12092. value: function handleInteraction(evt) {
  12093. var isClick = evt.type === 'click';
  12094. var isEnter = evt.key === 'Enter' || evt.keyCode === 13;
  12095. // Check for scrim click first since it doesn't require querying ancestors
  12096. if (isClick && this.adapter_.eventTargetMatches(evt.target, __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].SCRIM_SELECTOR) && this.scrimClickAction_ !== '') {
  12097. this.close(this.scrimClickAction_);
  12098. } else if (isClick || evt.key === 'Space' || evt.keyCode === 32 || isEnter) {
  12099. var action = this.adapter_.getActionFromEvent(evt);
  12100. if (action) {
  12101. this.close(action);
  12102. } else if (isEnter && !this.adapter_.eventTargetMatches(evt.target, __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].SUPPRESS_DEFAULT_PRESS_SELECTOR)) {
  12103. this.adapter_.clickDefaultButton();
  12104. }
  12105. }
  12106. }
  12107. /**
  12108. * @param {!KeyboardEvent} evt
  12109. * @private
  12110. */
  12111. }, {
  12112. key: 'handleDocumentKeydown',
  12113. value: function handleDocumentKeydown(evt) {
  12114. if ((evt.key === 'Escape' || evt.keyCode === 27) && this.escapeKeyAction_ !== '') {
  12115. this.close(this.escapeKeyAction_);
  12116. }
  12117. }
  12118. /** @private */
  12119. }, {
  12120. key: 'handleAnimationTimerEnd_',
  12121. value: function handleAnimationTimerEnd_() {
  12122. this.animationTimer_ = 0;
  12123. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].OPENING);
  12124. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CLOSING);
  12125. }
  12126. /**
  12127. * Runs the given logic on the next animation frame, using setTimeout to factor in Firefox reflow behavior.
  12128. * @param {Function} callback
  12129. * @private
  12130. */
  12131. }, {
  12132. key: 'runNextAnimationFrame_',
  12133. value: function runNextAnimationFrame_(callback) {
  12134. var _this5 = this;
  12135. cancelAnimationFrame(this.animationFrame_);
  12136. this.animationFrame_ = requestAnimationFrame(function () {
  12137. _this5.animationFrame_ = 0;
  12138. clearTimeout(_this5.animationTimer_);
  12139. _this5.animationTimer_ = setTimeout(callback, 0);
  12140. });
  12141. }
  12142. }]);
  12143. return MDCDialogFoundation;
  12144. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  12145. /* harmony default export */ __webpack_exports__["a"] = (MDCDialogFoundation);
  12146. /***/ }),
  12147. /* 80 */
  12148. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12149. "use strict";
  12150. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  12151. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  12152. /**
  12153. * @license
  12154. * Copyright 2018 Google Inc.
  12155. *
  12156. * Permission is hereby granted, free of charge, to any person obtaining a copy
  12157. * of this software and associated documentation files (the "Software"), to deal
  12158. * in the Software without restriction, including without limitation the rights
  12159. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  12160. * copies of the Software, and to permit persons to whom the Software is
  12161. * furnished to do so, subject to the following conditions:
  12162. *
  12163. * The above copyright notice and this permission notice shall be included in
  12164. * all copies or substantial portions of the Software.
  12165. *
  12166. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  12167. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  12168. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  12169. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  12170. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  12171. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  12172. * THE SOFTWARE.
  12173. */
  12174. /* eslint no-unused-vars: [2, {"args": "none"}] */
  12175. /**
  12176. * Adapter for MDC Dialog. Provides an interface for managing:
  12177. * - CSS classes
  12178. * - DOM
  12179. * - Event handlers
  12180. *
  12181. * Additionally, provides type information for the adapter to the Closure
  12182. * compiler.
  12183. *
  12184. * Implement this adapter for your framework of choice to delegate updates to
  12185. * the component in your framework of choice. See architecture documentation
  12186. * for more details.
  12187. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  12188. *
  12189. * @record
  12190. */
  12191. var MDCDialogAdapter = function () {
  12192. function MDCDialogAdapter() {
  12193. _classCallCheck(this, MDCDialogAdapter);
  12194. }
  12195. _createClass(MDCDialogAdapter, [{
  12196. key: "addClass",
  12197. /** @param {string} className */
  12198. value: function addClass(className) {}
  12199. /** @param {string} className */
  12200. }, {
  12201. key: "removeClass",
  12202. value: function removeClass(className) {}
  12203. /**
  12204. * @param {string} className
  12205. * @return {boolean}
  12206. */
  12207. }, {
  12208. key: "hasClass",
  12209. value: function hasClass(className) {}
  12210. /** @param {string} className */
  12211. }, {
  12212. key: "addBodyClass",
  12213. value: function addBodyClass(className) {}
  12214. /** @param {string} className */
  12215. }, {
  12216. key: "removeBodyClass",
  12217. value: function removeBodyClass(className) {}
  12218. /**
  12219. * @param {!EventTarget} target
  12220. * @param {string} selector
  12221. * @return {boolean}
  12222. */
  12223. }, {
  12224. key: "eventTargetMatches",
  12225. value: function eventTargetMatches(target, selector) {}
  12226. }, {
  12227. key: "trapFocus",
  12228. value: function trapFocus() {}
  12229. }, {
  12230. key: "releaseFocus",
  12231. value: function releaseFocus() {}
  12232. /** @return {boolean} */
  12233. }, {
  12234. key: "isContentScrollable",
  12235. value: function isContentScrollable() {}
  12236. /** @return {boolean} */
  12237. }, {
  12238. key: "areButtonsStacked",
  12239. value: function areButtonsStacked() {}
  12240. /**
  12241. * @param {!Event} event
  12242. * @return {?string}
  12243. */
  12244. }, {
  12245. key: "getActionFromEvent",
  12246. value: function getActionFromEvent(event) {}
  12247. }, {
  12248. key: "clickDefaultButton",
  12249. value: function clickDefaultButton() {}
  12250. }, {
  12251. key: "reverseButtons",
  12252. value: function reverseButtons() {}
  12253. }, {
  12254. key: "notifyOpening",
  12255. value: function notifyOpening() {}
  12256. }, {
  12257. key: "notifyOpened",
  12258. value: function notifyOpened() {}
  12259. /**
  12260. * @param {string} action
  12261. */
  12262. }, {
  12263. key: "notifyClosing",
  12264. value: function notifyClosing(action) {}
  12265. /**
  12266. * @param {string} action
  12267. */
  12268. }, {
  12269. key: "notifyClosed",
  12270. value: function notifyClosed(action) {}
  12271. }]);
  12272. return MDCDialogAdapter;
  12273. }();
  12274. /* unused harmony default export */ var _unused_webpack_default_export = (MDCDialogAdapter);
  12275. /***/ }),
  12276. /* 81 */
  12277. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12278. "use strict";
  12279. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  12280. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; });
  12281. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; });
  12282. /**
  12283. * @license
  12284. * Copyright 2016 Google Inc.
  12285. *
  12286. * Permission is hereby granted, free of charge, to any person obtaining a copy
  12287. * of this software and associated documentation files (the "Software"), to deal
  12288. * in the Software without restriction, including without limitation the rights
  12289. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  12290. * copies of the Software, and to permit persons to whom the Software is
  12291. * furnished to do so, subject to the following conditions:
  12292. *
  12293. * The above copyright notice and this permission notice shall be included in
  12294. * all copies or substantial portions of the Software.
  12295. *
  12296. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  12297. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  12298. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  12299. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  12300. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  12301. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  12302. * THE SOFTWARE.
  12303. */
  12304. var cssClasses = {
  12305. OPEN: 'mdc-dialog--open',
  12306. OPENING: 'mdc-dialog--opening',
  12307. CLOSING: 'mdc-dialog--closing',
  12308. SCROLLABLE: 'mdc-dialog--scrollable',
  12309. STACKED: 'mdc-dialog--stacked',
  12310. SCROLL_LOCK: 'mdc-dialog-scroll-lock'
  12311. };
  12312. var strings = {
  12313. SCRIM_SELECTOR: '.mdc-dialog__scrim',
  12314. CONTAINER_SELECTOR: '.mdc-dialog__container',
  12315. SURFACE_SELECTOR: '.mdc-dialog__surface',
  12316. CONTENT_SELECTOR: '.mdc-dialog__content',
  12317. BUTTON_SELECTOR: '.mdc-dialog__button',
  12318. DEFAULT_BUTTON_SELECTOR: '.mdc-dialog__button--default',
  12319. SUPPRESS_DEFAULT_PRESS_SELECTOR: ['textarea', '.mdc-menu .mdc-list-item'].join(', '),
  12320. OPENING_EVENT: 'MDCDialog:opening',
  12321. OPENED_EVENT: 'MDCDialog:opened',
  12322. CLOSING_EVENT: 'MDCDialog:closing',
  12323. CLOSED_EVENT: 'MDCDialog:closed',
  12324. ACTION_ATTRIBUTE: 'data-mdc-dialog-action',
  12325. CLOSE_ACTION: 'close',
  12326. DESTROY_ACTION: 'destroy'
  12327. };
  12328. var numbers = {
  12329. DIALOG_ANIMATION_OPEN_TIME_MS: 150,
  12330. DIALOG_ANIMATION_CLOSE_TIME_MS: 75
  12331. };
  12332. /***/ }),
  12333. /* 82 */
  12334. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12335. "use strict";
  12336. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  12337. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFocusTrapInstance", function() { return createFocusTrapInstance; });
  12338. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isScrollable", function() { return isScrollable; });
  12339. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "areTopsMisaligned", function() { return areTopsMisaligned; });
  12340. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_focus_trap__ = __webpack_require__(34);
  12341. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_focus_trap___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_focus_trap__);
  12342. /**
  12343. * @license
  12344. * Copyright 2016 Google Inc.
  12345. *
  12346. * Permission is hereby granted, free of charge, to any person obtaining a copy
  12347. * of this software and associated documentation files (the "Software"), to deal
  12348. * in the Software without restriction, including without limitation the rights
  12349. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  12350. * copies of the Software, and to permit persons to whom the Software is
  12351. * furnished to do so, subject to the following conditions:
  12352. *
  12353. * The above copyright notice and this permission notice shall be included in
  12354. * all copies or substantial portions of the Software.
  12355. *
  12356. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  12357. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  12358. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  12359. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  12360. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  12361. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  12362. * THE SOFTWARE.
  12363. */
  12364. /**
  12365. * @param {!Element} surfaceEl
  12366. * @param {?Element=} initialFocusEl
  12367. * @param {function(!Element, !FocusTrapCreateOptions): !FocusTrapInstance} focusTrapFactory
  12368. * @return {!FocusTrapInstance}
  12369. */
  12370. function createFocusTrapInstance(surfaceEl) {
  12371. var focusTrapFactory = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : __WEBPACK_IMPORTED_MODULE_0_focus_trap___default.a;
  12372. var initialFocusEl = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  12373. return focusTrapFactory(surfaceEl, {
  12374. initialFocus: initialFocusEl,
  12375. escapeDeactivates: false, // Dialog foundation handles escape key
  12376. clickOutsideDeactivates: true });
  12377. }
  12378. /**
  12379. * @param {!Element} el
  12380. * @return {boolean}
  12381. */
  12382. function isScrollable(el) {
  12383. return el.scrollHeight > el.offsetHeight;
  12384. }
  12385. /**
  12386. * @param {!Array<!Element>|!NodeList} els
  12387. * @return {boolean}
  12388. */
  12389. function areTopsMisaligned(els) {
  12390. var tops = new Set();
  12391. [].forEach.call(els, function (el) {
  12392. return tops.add(el.offsetTop);
  12393. });
  12394. return tops.size > 1;
  12395. }
  12396. /***/ }),
  12397. /* 83 */
  12398. /***/ (function(module, exports) {
  12399. var candidateSelectors = [
  12400. 'input',
  12401. 'select',
  12402. 'textarea',
  12403. 'a[href]',
  12404. 'button',
  12405. '[tabindex]',
  12406. 'audio[controls]',
  12407. 'video[controls]',
  12408. '[contenteditable]:not([contenteditable="false"])',
  12409. ];
  12410. var candidateSelector = candidateSelectors.join(',');
  12411. var matches = typeof Element === 'undefined'
  12412. ? function () {}
  12413. : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
  12414. function tabbable(el, options) {
  12415. options = options || {};
  12416. var elementDocument = el.ownerDocument || el;
  12417. var regularTabbables = [];
  12418. var orderedTabbables = [];
  12419. var untouchabilityChecker = new UntouchabilityChecker(elementDocument);
  12420. var candidates = el.querySelectorAll(candidateSelector);
  12421. if (options.includeContainer) {
  12422. if (matches.call(el, candidateSelector)) {
  12423. candidates = Array.prototype.slice.apply(candidates);
  12424. candidates.unshift(el);
  12425. }
  12426. }
  12427. var i, candidate, candidateTabindex;
  12428. for (i = 0; i < candidates.length; i++) {
  12429. candidate = candidates[i];
  12430. if (!isNodeMatchingSelectorTabbable(candidate, untouchabilityChecker)) continue;
  12431. candidateTabindex = getTabindex(candidate);
  12432. if (candidateTabindex === 0) {
  12433. regularTabbables.push(candidate);
  12434. } else {
  12435. orderedTabbables.push({
  12436. documentOrder: i,
  12437. tabIndex: candidateTabindex,
  12438. node: candidate,
  12439. });
  12440. }
  12441. }
  12442. var tabbableNodes = orderedTabbables
  12443. .sort(sortOrderedTabbables)
  12444. .map(function(a) { return a.node })
  12445. .concat(regularTabbables);
  12446. return tabbableNodes;
  12447. }
  12448. tabbable.isTabbable = isTabbable;
  12449. tabbable.isFocusable = isFocusable;
  12450. function isNodeMatchingSelectorTabbable(node, untouchabilityChecker) {
  12451. if (
  12452. !isNodeMatchingSelectorFocusable(node, untouchabilityChecker)
  12453. || isNonTabbableRadio(node)
  12454. || getTabindex(node) < 0
  12455. ) {
  12456. return false;
  12457. }
  12458. return true;
  12459. }
  12460. function isTabbable(node, untouchabilityChecker) {
  12461. if (!node) throw new Error('No node provided');
  12462. if (matches.call(node, candidateSelector) === false) return false;
  12463. return isNodeMatchingSelectorTabbable(node, untouchabilityChecker);
  12464. }
  12465. function isNodeMatchingSelectorFocusable(node, untouchabilityChecker) {
  12466. untouchabilityChecker = untouchabilityChecker || new UntouchabilityChecker(node.ownerDocument || node);
  12467. if (
  12468. node.disabled
  12469. || isHiddenInput(node)
  12470. || untouchabilityChecker.isUntouchable(node)
  12471. ) {
  12472. return false;
  12473. }
  12474. return true;
  12475. }
  12476. var focusableCandidateSelector = candidateSelectors.concat('iframe').join(',');
  12477. function isFocusable(node, untouchabilityChecker) {
  12478. if (!node) throw new Error('No node provided');
  12479. if (matches.call(node, focusableCandidateSelector) === false) return false;
  12480. return isNodeMatchingSelectorFocusable(node, untouchabilityChecker);
  12481. }
  12482. function getTabindex(node) {
  12483. var tabindexAttr = parseInt(node.getAttribute('tabindex'), 10);
  12484. if (!isNaN(tabindexAttr)) return tabindexAttr;
  12485. // Browsers do not return `tabIndex` correctly for contentEditable nodes;
  12486. // so if they don't have a tabindex attribute specifically set, assume it's 0.
  12487. if (isContentEditable(node)) return 0;
  12488. return node.tabIndex;
  12489. }
  12490. function sortOrderedTabbables(a, b) {
  12491. return a.tabIndex === b.tabIndex ? a.documentOrder - b.documentOrder : a.tabIndex - b.tabIndex;
  12492. }
  12493. // Array.prototype.find not available in IE.
  12494. function find(list, predicate) {
  12495. for (var i = 0, length = list.length; i < length; i++) {
  12496. if (predicate(list[i])) return list[i];
  12497. }
  12498. }
  12499. function isContentEditable(node) {
  12500. return node.contentEditable === 'true';
  12501. }
  12502. function isInput(node) {
  12503. return node.tagName === 'INPUT';
  12504. }
  12505. function isHiddenInput(node) {
  12506. return isInput(node) && node.type === 'hidden';
  12507. }
  12508. function isRadio(node) {
  12509. return isInput(node) && node.type === 'radio';
  12510. }
  12511. function isNonTabbableRadio(node) {
  12512. return isRadio(node) && !isTabbableRadio(node);
  12513. }
  12514. function getCheckedRadio(nodes) {
  12515. for (var i = 0; i < nodes.length; i++) {
  12516. if (nodes[i].checked) {
  12517. return nodes[i];
  12518. }
  12519. }
  12520. }
  12521. function isTabbableRadio(node) {
  12522. if (!node.name) return true;
  12523. // This won't account for the edge case where you have radio groups with the same
  12524. // in separate forms on the same page.
  12525. var radioSet = node.ownerDocument.querySelectorAll('input[type="radio"][name="' + node.name + '"]');
  12526. var checked = getCheckedRadio(radioSet);
  12527. return !checked || checked === node;
  12528. }
  12529. // An element is "untouchable" if *it or one of its ancestors* has
  12530. // `visibility: hidden` or `display: none`.
  12531. function UntouchabilityChecker(elementDocument) {
  12532. this.doc = elementDocument;
  12533. // Node cache must be refreshed on every check, in case
  12534. // the content of the element has changed. The cache contains tuples
  12535. // mapping nodes to their boolean result.
  12536. this.cache = [];
  12537. }
  12538. // getComputedStyle accurately reflects `visibility: hidden` of ancestors
  12539. // but not `display: none`, so we need to recursively check parents.
  12540. UntouchabilityChecker.prototype.hasDisplayNone = function hasDisplayNone(node, nodeComputedStyle) {
  12541. if (node.nodeType !== Node.ELEMENT_NODE) return false;
  12542. // Search for a cached result.
  12543. var cached = find(this.cache, function(item) {
  12544. return item === node;
  12545. });
  12546. if (cached) return cached[1];
  12547. nodeComputedStyle = nodeComputedStyle || this.doc.defaultView.getComputedStyle(node);
  12548. var result = false;
  12549. if (nodeComputedStyle.display === 'none') {
  12550. result = true;
  12551. } else if (node.parentNode) {
  12552. result = this.hasDisplayNone(node.parentNode);
  12553. }
  12554. this.cache.push([node, result]);
  12555. return result;
  12556. }
  12557. UntouchabilityChecker.prototype.isUntouchable = function isUntouchable(node) {
  12558. if (node === this.doc.documentElement) return false;
  12559. var computedStyle = this.doc.defaultView.getComputedStyle(node);
  12560. if (this.hasDisplayNone(node, computedStyle)) return true;
  12561. return computedStyle.visibility === 'hidden';
  12562. }
  12563. module.exports = tabbable;
  12564. /***/ }),
  12565. /* 84 */
  12566. /***/ (function(module, exports) {
  12567. module.exports = extend
  12568. var hasOwnProperty = Object.prototype.hasOwnProperty;
  12569. function extend() {
  12570. var target = {}
  12571. for (var i = 0; i < arguments.length; i++) {
  12572. var source = arguments[i]
  12573. for (var key in source) {
  12574. if (hasOwnProperty.call(source, key)) {
  12575. target[key] = source[key]
  12576. }
  12577. }
  12578. }
  12579. return target
  12580. }
  12581. /***/ }),
  12582. /* 85 */
  12583. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12584. "use strict";
  12585. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  12586. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__ponyfill__ = __webpack_require__(8);
  12587. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "ponyfill", function() { return __WEBPACK_IMPORTED_MODULE_0__ponyfill__; });
  12588. /**
  12589. * @license
  12590. * Copyright 2018 Google Inc.
  12591. *
  12592. * Permission is hereby granted, free of charge, to any person obtaining a copy
  12593. * of this software and associated documentation files (the "Software"), to deal
  12594. * in the Software without restriction, including without limitation the rights
  12595. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  12596. * copies of the Software, and to permit persons to whom the Software is
  12597. * furnished to do so, subject to the following conditions:
  12598. *
  12599. * The above copyright notice and this permission notice shall be included in
  12600. * all copies or substantial portions of the Software.
  12601. *
  12602. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  12603. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  12604. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  12605. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  12606. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  12607. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  12608. * THE SOFTWARE.
  12609. */
  12610. /***/ }),
  12611. /* 86 */
  12612. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12613. "use strict";
  12614. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  12615. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCDrawer", function() { return MDCDrawer; });
  12616. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  12617. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__dismissible_foundation__ = __webpack_require__(35);
  12618. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__modal_foundation__ = __webpack_require__(87);
  12619. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__adapter__ = __webpack_require__(36);
  12620. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__material_list_index__ = __webpack_require__(14);
  12621. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__material_list_foundation__ = __webpack_require__(15);
  12622. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__constants__ = __webpack_require__(37);
  12623. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__util__ = __webpack_require__(88);
  12624. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_focus_trap__ = __webpack_require__(40);
  12625. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_focus_trap___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_focus_trap__);
  12626. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCDismissibleDrawerFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__dismissible_foundation__["a"]; });
  12627. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCModalDrawerFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__modal_foundation__["a"]; });
  12628. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "util", function() { return __WEBPACK_IMPORTED_MODULE_7__util__; });
  12629. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  12630. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  12631. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  12632. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  12633. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  12634. /**
  12635. * @license
  12636. * Copyright 2016 Google Inc.
  12637. *
  12638. * Permission is hereby granted, free of charge, to any person obtaining a copy
  12639. * of this software and associated documentation files (the "Software"), to deal
  12640. * in the Software without restriction, including without limitation the rights
  12641. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  12642. * copies of the Software, and to permit persons to whom the Software is
  12643. * furnished to do so, subject to the following conditions:
  12644. *
  12645. * The above copyright notice and this permission notice shall be included in
  12646. * all copies or substantial portions of the Software.
  12647. *
  12648. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  12649. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  12650. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  12651. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  12652. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  12653. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  12654. * THE SOFTWARE.
  12655. */
  12656. /**
  12657. * @extends {MDCComponent<!MDCDismissibleDrawerFoundation>}
  12658. * @final
  12659. */
  12660. var MDCDrawer = function (_MDCComponent) {
  12661. _inherits(MDCDrawer, _MDCComponent);
  12662. /**
  12663. * @param {...?} args
  12664. */
  12665. function MDCDrawer() {
  12666. var _ref;
  12667. _classCallCheck(this, MDCDrawer);
  12668. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  12669. args[_key] = arguments[_key];
  12670. }
  12671. /** @private {!Element} */
  12672. var _this = _possibleConstructorReturn(this, (_ref = MDCDrawer.__proto__ || Object.getPrototypeOf(MDCDrawer)).call.apply(_ref, [this].concat(args)));
  12673. _this.previousFocus_;
  12674. /** @private {!Function} */
  12675. _this.handleKeydown_;
  12676. /** @private {!Function} */
  12677. _this.handleTransitionEnd_;
  12678. /** @private {!Function} */
  12679. _this.focusTrapFactory_;
  12680. /** @private {!FocusTrapInstance} */
  12681. _this.focusTrap_;
  12682. /** @private {?Element} */
  12683. _this.scrim_;
  12684. /** @private {?Function} */
  12685. _this.handleScrimClick_;
  12686. /** @private {?MDCList} */
  12687. _this.list_;
  12688. return _this;
  12689. }
  12690. /**
  12691. * @param {!Element} root
  12692. * @return {!MDCDrawer}
  12693. */
  12694. _createClass(MDCDrawer, [{
  12695. key: 'initialize',
  12696. value: function initialize() {
  12697. var focusTrapFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : __WEBPACK_IMPORTED_MODULE_8_focus_trap___default.a;
  12698. var listFactory = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (el) {
  12699. return new __WEBPACK_IMPORTED_MODULE_4__material_list_index__["MDCList"](el);
  12700. };
  12701. var listEl = /** @type {!Element} */this.root_.querySelector('.' + __WEBPACK_IMPORTED_MODULE_5__material_list_foundation__["a" /* default */].cssClasses.ROOT);
  12702. if (listEl) {
  12703. this.list_ = listFactory(listEl);
  12704. this.list_.wrapFocus = true;
  12705. }
  12706. this.focusTrapFactory_ = focusTrapFactory;
  12707. }
  12708. }, {
  12709. key: 'initialSyncWithDOM',
  12710. value: function initialSyncWithDOM() {
  12711. var _this2 = this;
  12712. var MODAL = __WEBPACK_IMPORTED_MODULE_1__dismissible_foundation__["a" /* default */].cssClasses.MODAL;
  12713. if (this.root_.classList.contains(MODAL)) {
  12714. var SCRIM_SELECTOR = __WEBPACK_IMPORTED_MODULE_1__dismissible_foundation__["a" /* default */].strings.SCRIM_SELECTOR;
  12715. this.scrim_ = /** @type {!Element} */this.root_.parentNode.querySelector(SCRIM_SELECTOR);
  12716. this.handleScrimClick_ = function () {
  12717. return (/** @type {!MDCModalDrawerFoundation} */_this2.foundation_.handleScrimClick()
  12718. );
  12719. };
  12720. this.scrim_.addEventListener('click', this.handleScrimClick_);
  12721. this.focusTrap_ = __WEBPACK_IMPORTED_MODULE_7__util__["createFocusTrapInstance"](this.root_, this.focusTrapFactory_);
  12722. }
  12723. this.handleKeydown_ = function (evt) {
  12724. return _this2.foundation_.handleKeydown(evt);
  12725. };
  12726. this.handleTransitionEnd_ = function (evt) {
  12727. return _this2.foundation_.handleTransitionEnd(evt);
  12728. };
  12729. this.root_.addEventListener('keydown', this.handleKeydown_);
  12730. this.root_.addEventListener('transitionend', this.handleTransitionEnd_);
  12731. }
  12732. }, {
  12733. key: 'destroy',
  12734. value: function destroy() {
  12735. this.root_.removeEventListener('keydown', this.handleKeydown_);
  12736. this.root_.removeEventListener('transitionend', this.handleTransitionEnd_);
  12737. if (this.list_) {
  12738. this.list_.destroy();
  12739. }
  12740. var MODAL = __WEBPACK_IMPORTED_MODULE_1__dismissible_foundation__["a" /* default */].cssClasses.MODAL;
  12741. if (this.root_.classList.contains(MODAL)) {
  12742. this.scrim_.removeEventListener('click', /** @type {!Function} */this.handleScrimClick_);
  12743. // Ensure drawer is closed to hide scrim and release focus
  12744. this.open = false;
  12745. }
  12746. }
  12747. }, {
  12748. key: 'getDefaultFoundation',
  12749. value: function getDefaultFoundation() {
  12750. var _this3 = this;
  12751. /** @type {!MDCDrawerAdapter} */
  12752. var adapter = /** @type {!MDCDrawerAdapter} */_extends({
  12753. addClass: function addClass(className) {
  12754. return _this3.root_.classList.add(className);
  12755. },
  12756. removeClass: function removeClass(className) {
  12757. return _this3.root_.classList.remove(className);
  12758. },
  12759. hasClass: function hasClass(className) {
  12760. return _this3.root_.classList.contains(className);
  12761. },
  12762. elementHasClass: function elementHasClass(element, className) {
  12763. return element.classList.contains(className);
  12764. },
  12765. saveFocus: function saveFocus() {
  12766. _this3.previousFocus_ = document.activeElement;
  12767. },
  12768. restoreFocus: function restoreFocus() {
  12769. var previousFocus = _this3.previousFocus_ && _this3.previousFocus_.focus;
  12770. if (_this3.root_.contains(document.activeElement) && previousFocus) {
  12771. _this3.previousFocus_.focus();
  12772. }
  12773. },
  12774. focusActiveNavigationItem: function focusActiveNavigationItem() {
  12775. var activeNavItemEl = _this3.root_.querySelector('.' + __WEBPACK_IMPORTED_MODULE_5__material_list_foundation__["a" /* default */].cssClasses.LIST_ITEM_ACTIVATED_CLASS);
  12776. if (activeNavItemEl) {
  12777. activeNavItemEl.focus();
  12778. }
  12779. },
  12780. notifyClose: function notifyClose() {
  12781. return _this3.emit(__WEBPACK_IMPORTED_MODULE_6__constants__["b" /* strings */].CLOSE_EVENT, {}, true /* shouldBubble */);
  12782. },
  12783. notifyOpen: function notifyOpen() {
  12784. return _this3.emit(__WEBPACK_IMPORTED_MODULE_6__constants__["b" /* strings */].OPEN_EVENT, {}, true /* shouldBubble */);
  12785. },
  12786. trapFocus: function trapFocus() {
  12787. return _this3.focusTrap_.activate();
  12788. },
  12789. releaseFocus: function releaseFocus() {
  12790. return _this3.focusTrap_.deactivate();
  12791. }
  12792. });
  12793. var _MDCDismissibleDrawer = __WEBPACK_IMPORTED_MODULE_1__dismissible_foundation__["a" /* default */].cssClasses,
  12794. DISMISSIBLE = _MDCDismissibleDrawer.DISMISSIBLE,
  12795. MODAL = _MDCDismissibleDrawer.MODAL;
  12796. if (this.root_.classList.contains(DISMISSIBLE)) {
  12797. return new __WEBPACK_IMPORTED_MODULE_1__dismissible_foundation__["a" /* default */](adapter);
  12798. } else if (this.root_.classList.contains(MODAL)) {
  12799. return new __WEBPACK_IMPORTED_MODULE_2__modal_foundation__["a" /* default */](adapter);
  12800. } else {
  12801. throw new Error('MDCDrawer: Failed to instantiate component. Supported variants are ' + DISMISSIBLE + ' and ' + MODAL + '.');
  12802. }
  12803. }
  12804. }, {
  12805. key: 'open',
  12806. /**
  12807. * Returns true if drawer is in the open position.
  12808. * @return {boolean}
  12809. */
  12810. get: function get() {
  12811. return this.foundation_.isOpen();
  12812. }
  12813. /**
  12814. * Toggles the drawer open and closed.
  12815. * @param {boolean} isOpen
  12816. */
  12817. ,
  12818. set: function set(isOpen) {
  12819. if (isOpen) {
  12820. this.foundation_.open();
  12821. } else {
  12822. this.foundation_.close();
  12823. }
  12824. }
  12825. }], [{
  12826. key: 'attachTo',
  12827. value: function attachTo(root) {
  12828. return new MDCDrawer(root);
  12829. }
  12830. }]);
  12831. return MDCDrawer;
  12832. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  12833. /***/ }),
  12834. /* 87 */
  12835. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12836. "use strict";
  12837. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__dismissible_foundation__ = __webpack_require__(35);
  12838. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  12839. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  12840. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  12841. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  12842. /**
  12843. * @license
  12844. * Copyright 2018 Google Inc.
  12845. *
  12846. * Permission is hereby granted, free of charge, to any person obtaining a copy
  12847. * of this software and associated documentation files (the "Software"), to deal
  12848. * in the Software without restriction, including without limitation the rights
  12849. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  12850. * copies of the Software, and to permit persons to whom the Software is
  12851. * furnished to do so, subject to the following conditions:
  12852. *
  12853. * The above copyright notice and this permission notice shall be included in
  12854. * all copies or substantial portions of the Software.
  12855. *
  12856. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  12857. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  12858. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  12859. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  12860. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  12861. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  12862. * THE SOFTWARE.
  12863. */
  12864. /**
  12865. * @extends {MDCDismissibleDrawerFoundation}
  12866. */
  12867. var MDCModalDrawerFoundation = function (_MDCDismissibleDrawer) {
  12868. _inherits(MDCModalDrawerFoundation, _MDCDismissibleDrawer);
  12869. function MDCModalDrawerFoundation() {
  12870. _classCallCheck(this, MDCModalDrawerFoundation);
  12871. return _possibleConstructorReturn(this, (MDCModalDrawerFoundation.__proto__ || Object.getPrototypeOf(MDCModalDrawerFoundation)).apply(this, arguments));
  12872. }
  12873. _createClass(MDCModalDrawerFoundation, [{
  12874. key: 'opened',
  12875. /**
  12876. * Called when drawer finishes open animation.
  12877. * @override
  12878. */
  12879. value: function opened() {
  12880. this.adapter_.trapFocus();
  12881. }
  12882. /**
  12883. * Called when drawer finishes close animation.
  12884. * @override
  12885. */
  12886. }, {
  12887. key: 'closed',
  12888. value: function closed() {
  12889. this.adapter_.releaseFocus();
  12890. }
  12891. /**
  12892. * Handles click event on scrim.
  12893. */
  12894. }, {
  12895. key: 'handleScrimClick',
  12896. value: function handleScrimClick() {
  12897. this.close();
  12898. }
  12899. }]);
  12900. return MDCModalDrawerFoundation;
  12901. }(__WEBPACK_IMPORTED_MODULE_0__dismissible_foundation__["a" /* default */]);
  12902. /* harmony default export */ __webpack_exports__["a"] = (MDCModalDrawerFoundation);
  12903. /***/ }),
  12904. /* 88 */
  12905. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12906. "use strict";
  12907. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  12908. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFocusTrapInstance", function() { return createFocusTrapInstance; });
  12909. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_focus_trap__ = __webpack_require__(40);
  12910. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_focus_trap___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_focus_trap__);
  12911. /**
  12912. * @license
  12913. * Copyright 2016 Google Inc.
  12914. *
  12915. * Permission is hereby granted, free of charge, to any person obtaining a copy
  12916. * of this software and associated documentation files (the "Software"), to deal
  12917. * in the Software without restriction, including without limitation the rights
  12918. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  12919. * copies of the Software, and to permit persons to whom the Software is
  12920. * furnished to do so, subject to the following conditions:
  12921. *
  12922. * The above copyright notice and this permission notice shall be included in
  12923. * all copies or substantial portions of the Software.
  12924. *
  12925. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  12926. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  12927. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  12928. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  12929. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  12930. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  12931. * THE SOFTWARE.
  12932. */
  12933. /**
  12934. * @param {!Element} surfaceEl
  12935. * @param {!Function} focusTrapFactory
  12936. * @return {!FocusTrapInstance}
  12937. */
  12938. function createFocusTrapInstance(surfaceEl) {
  12939. var focusTrapFactory = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : __WEBPACK_IMPORTED_MODULE_0_focus_trap___default.a;
  12940. return focusTrapFactory(surfaceEl, {
  12941. clickOutsideDeactivates: true,
  12942. initialFocus: false, // Navigation drawer handles focusing on active nav item.
  12943. escapeDeactivates: false, // Navigation drawer handles ESC.
  12944. returnFocusOnDeactivate: false });
  12945. }
  12946. /***/ }),
  12947. /* 89 */
  12948. /***/ (function(module, exports) {
  12949. var candidateSelectors = [
  12950. 'input',
  12951. 'select',
  12952. 'textarea',
  12953. 'a[href]',
  12954. 'button',
  12955. '[tabindex]',
  12956. 'audio[controls]',
  12957. 'video[controls]',
  12958. '[contenteditable]:not([contenteditable="false"])',
  12959. ];
  12960. var candidateSelector = candidateSelectors.join(',');
  12961. var matches = typeof Element === 'undefined'
  12962. ? function () {}
  12963. : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
  12964. function tabbable(el, options) {
  12965. options = options || {};
  12966. var elementDocument = el.ownerDocument || el;
  12967. var regularTabbables = [];
  12968. var orderedTabbables = [];
  12969. var untouchabilityChecker = new UntouchabilityChecker(elementDocument);
  12970. var candidates = el.querySelectorAll(candidateSelector);
  12971. if (options.includeContainer) {
  12972. if (matches.call(el, candidateSelector)) {
  12973. candidates = Array.prototype.slice.apply(candidates);
  12974. candidates.unshift(el);
  12975. }
  12976. }
  12977. var i, candidate, candidateTabindex;
  12978. for (i = 0; i < candidates.length; i++) {
  12979. candidate = candidates[i];
  12980. if (!isNodeMatchingSelectorTabbable(candidate, untouchabilityChecker)) continue;
  12981. candidateTabindex = getTabindex(candidate);
  12982. if (candidateTabindex === 0) {
  12983. regularTabbables.push(candidate);
  12984. } else {
  12985. orderedTabbables.push({
  12986. documentOrder: i,
  12987. tabIndex: candidateTabindex,
  12988. node: candidate,
  12989. });
  12990. }
  12991. }
  12992. var tabbableNodes = orderedTabbables
  12993. .sort(sortOrderedTabbables)
  12994. .map(function(a) { return a.node })
  12995. .concat(regularTabbables);
  12996. return tabbableNodes;
  12997. }
  12998. tabbable.isTabbable = isTabbable;
  12999. tabbable.isFocusable = isFocusable;
  13000. function isNodeMatchingSelectorTabbable(node, untouchabilityChecker) {
  13001. if (
  13002. !isNodeMatchingSelectorFocusable(node, untouchabilityChecker)
  13003. || isNonTabbableRadio(node)
  13004. || getTabindex(node) < 0
  13005. ) {
  13006. return false;
  13007. }
  13008. return true;
  13009. }
  13010. function isTabbable(node, untouchabilityChecker) {
  13011. if (!node) throw new Error('No node provided');
  13012. if (matches.call(node, candidateSelector) === false) return false;
  13013. return isNodeMatchingSelectorTabbable(node, untouchabilityChecker);
  13014. }
  13015. function isNodeMatchingSelectorFocusable(node, untouchabilityChecker) {
  13016. untouchabilityChecker = untouchabilityChecker || new UntouchabilityChecker(node.ownerDocument || node);
  13017. if (
  13018. node.disabled
  13019. || isHiddenInput(node)
  13020. || untouchabilityChecker.isUntouchable(node)
  13021. ) {
  13022. return false;
  13023. }
  13024. return true;
  13025. }
  13026. var focusableCandidateSelector = candidateSelectors.concat('iframe').join(',');
  13027. function isFocusable(node, untouchabilityChecker) {
  13028. if (!node) throw new Error('No node provided');
  13029. if (matches.call(node, focusableCandidateSelector) === false) return false;
  13030. return isNodeMatchingSelectorFocusable(node, untouchabilityChecker);
  13031. }
  13032. function getTabindex(node) {
  13033. var tabindexAttr = parseInt(node.getAttribute('tabindex'), 10);
  13034. if (!isNaN(tabindexAttr)) return tabindexAttr;
  13035. // Browsers do not return `tabIndex` correctly for contentEditable nodes;
  13036. // so if they don't have a tabindex attribute specifically set, assume it's 0.
  13037. if (isContentEditable(node)) return 0;
  13038. return node.tabIndex;
  13039. }
  13040. function sortOrderedTabbables(a, b) {
  13041. return a.tabIndex === b.tabIndex ? a.documentOrder - b.documentOrder : a.tabIndex - b.tabIndex;
  13042. }
  13043. // Array.prototype.find not available in IE.
  13044. function find(list, predicate) {
  13045. for (var i = 0, length = list.length; i < length; i++) {
  13046. if (predicate(list[i])) return list[i];
  13047. }
  13048. }
  13049. function isContentEditable(node) {
  13050. return node.contentEditable === 'true';
  13051. }
  13052. function isInput(node) {
  13053. return node.tagName === 'INPUT';
  13054. }
  13055. function isHiddenInput(node) {
  13056. return isInput(node) && node.type === 'hidden';
  13057. }
  13058. function isRadio(node) {
  13059. return isInput(node) && node.type === 'radio';
  13060. }
  13061. function isNonTabbableRadio(node) {
  13062. return isRadio(node) && !isTabbableRadio(node);
  13063. }
  13064. function getCheckedRadio(nodes) {
  13065. for (var i = 0; i < nodes.length; i++) {
  13066. if (nodes[i].checked) {
  13067. return nodes[i];
  13068. }
  13069. }
  13070. }
  13071. function isTabbableRadio(node) {
  13072. if (!node.name) return true;
  13073. // This won't account for the edge case where you have radio groups with the same
  13074. // in separate forms on the same page.
  13075. var radioSet = node.ownerDocument.querySelectorAll('input[type="radio"][name="' + node.name + '"]');
  13076. var checked = getCheckedRadio(radioSet);
  13077. return !checked || checked === node;
  13078. }
  13079. // An element is "untouchable" if *it or one of its ancestors* has
  13080. // `visibility: hidden` or `display: none`.
  13081. function UntouchabilityChecker(elementDocument) {
  13082. this.doc = elementDocument;
  13083. // Node cache must be refreshed on every check, in case
  13084. // the content of the element has changed. The cache contains tuples
  13085. // mapping nodes to their boolean result.
  13086. this.cache = [];
  13087. }
  13088. // getComputedStyle accurately reflects `visibility: hidden` of ancestors
  13089. // but not `display: none`, so we need to recursively check parents.
  13090. UntouchabilityChecker.prototype.hasDisplayNone = function hasDisplayNone(node, nodeComputedStyle) {
  13091. if (node.nodeType !== Node.ELEMENT_NODE) return false;
  13092. // Search for a cached result.
  13093. var cached = find(this.cache, function(item) {
  13094. return item === node;
  13095. });
  13096. if (cached) return cached[1];
  13097. nodeComputedStyle = nodeComputedStyle || this.doc.defaultView.getComputedStyle(node);
  13098. var result = false;
  13099. if (nodeComputedStyle.display === 'none') {
  13100. result = true;
  13101. } else if (node.parentNode) {
  13102. result = this.hasDisplayNone(node.parentNode);
  13103. }
  13104. this.cache.push([node, result]);
  13105. return result;
  13106. }
  13107. UntouchabilityChecker.prototype.isUntouchable = function isUntouchable(node) {
  13108. if (node === this.doc.documentElement) return false;
  13109. var computedStyle = this.doc.defaultView.getComputedStyle(node);
  13110. if (this.hasDisplayNone(node, computedStyle)) return true;
  13111. return computedStyle.visibility === 'hidden';
  13112. }
  13113. module.exports = tabbable;
  13114. /***/ }),
  13115. /* 90 */
  13116. /***/ (function(module, exports) {
  13117. module.exports = extend
  13118. var hasOwnProperty = Object.prototype.hasOwnProperty;
  13119. function extend() {
  13120. var target = {}
  13121. for (var i = 0; i < arguments.length; i++) {
  13122. var source = arguments[i]
  13123. for (var key in source) {
  13124. if (hasOwnProperty.call(source, key)) {
  13125. target[key] = source[key]
  13126. }
  13127. }
  13128. }
  13129. return target
  13130. }
  13131. /***/ }),
  13132. /* 91 */
  13133. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13134. "use strict";
  13135. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  13136. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(41);
  13137. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(92);
  13138. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  13139. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  13140. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13141. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  13142. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  13143. /**
  13144. * @license
  13145. * Copyright 2016 Google Inc.
  13146. *
  13147. * Permission is hereby granted, free of charge, to any person obtaining a copy
  13148. * of this software and associated documentation files (the "Software"), to deal
  13149. * in the Software without restriction, including without limitation the rights
  13150. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  13151. * copies of the Software, and to permit persons to whom the Software is
  13152. * furnished to do so, subject to the following conditions:
  13153. *
  13154. * The above copyright notice and this permission notice shall be included in
  13155. * all copies or substantial portions of the Software.
  13156. *
  13157. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13158. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  13159. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  13160. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  13161. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  13162. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  13163. * THE SOFTWARE.
  13164. */
  13165. /**
  13166. * @extends {MDCFoundation<!MDCFloatingLabelAdapter>}
  13167. * @final
  13168. */
  13169. var MDCFloatingLabelFoundation = function (_MDCFoundation) {
  13170. _inherits(MDCFloatingLabelFoundation, _MDCFoundation);
  13171. _createClass(MDCFloatingLabelFoundation, null, [{
  13172. key: 'cssClasses',
  13173. /** @return enum {string} */
  13174. get: function get() {
  13175. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  13176. }
  13177. /**
  13178. * {@see MDCFloatingLabelAdapter} for typing information on parameters and return
  13179. * types.
  13180. * @return {!MDCFloatingLabelAdapter}
  13181. */
  13182. }, {
  13183. key: 'defaultAdapter',
  13184. get: function get() {
  13185. return (/** @type {!MDCFloatingLabelAdapter} */{
  13186. addClass: function addClass() {},
  13187. removeClass: function removeClass() {},
  13188. getWidth: function getWidth() {},
  13189. registerInteractionHandler: function registerInteractionHandler() {},
  13190. deregisterInteractionHandler: function deregisterInteractionHandler() {}
  13191. }
  13192. );
  13193. }
  13194. /**
  13195. * @param {!MDCFloatingLabelAdapter} adapter
  13196. */
  13197. }]);
  13198. function MDCFloatingLabelFoundation(adapter) {
  13199. _classCallCheck(this, MDCFloatingLabelFoundation);
  13200. /** @private {function(!Event): undefined} */
  13201. var _this = _possibleConstructorReturn(this, (MDCFloatingLabelFoundation.__proto__ || Object.getPrototypeOf(MDCFloatingLabelFoundation)).call(this, _extends(MDCFloatingLabelFoundation.defaultAdapter, adapter)));
  13202. _this.shakeAnimationEndHandler_ = function () {
  13203. return _this.handleShakeAnimationEnd_();
  13204. };
  13205. return _this;
  13206. }
  13207. _createClass(MDCFloatingLabelFoundation, [{
  13208. key: 'init',
  13209. value: function init() {
  13210. this.adapter_.registerInteractionHandler('animationend', this.shakeAnimationEndHandler_);
  13211. }
  13212. }, {
  13213. key: 'destroy',
  13214. value: function destroy() {
  13215. this.adapter_.deregisterInteractionHandler('animationend', this.shakeAnimationEndHandler_);
  13216. }
  13217. /**
  13218. * Returns the width of the label element.
  13219. * @return {number}
  13220. */
  13221. }, {
  13222. key: 'getWidth',
  13223. value: function getWidth() {
  13224. return this.adapter_.getWidth();
  13225. }
  13226. /**
  13227. * Styles the label to produce the label shake for errors.
  13228. * @param {boolean} shouldShake adds shake class if true,
  13229. * otherwise removes shake class.
  13230. */
  13231. }, {
  13232. key: 'shake',
  13233. value: function shake(shouldShake) {
  13234. var LABEL_SHAKE = MDCFloatingLabelFoundation.cssClasses.LABEL_SHAKE;
  13235. if (shouldShake) {
  13236. this.adapter_.addClass(LABEL_SHAKE);
  13237. } else {
  13238. this.adapter_.removeClass(LABEL_SHAKE);
  13239. }
  13240. }
  13241. /**
  13242. * Styles the label to float or dock.
  13243. * @param {boolean} shouldFloat adds float class if true, otherwise remove
  13244. * float and shake class to dock label.
  13245. */
  13246. }, {
  13247. key: 'float',
  13248. value: function float(shouldFloat) {
  13249. var _MDCFloatingLabelFoun = MDCFloatingLabelFoundation.cssClasses,
  13250. LABEL_FLOAT_ABOVE = _MDCFloatingLabelFoun.LABEL_FLOAT_ABOVE,
  13251. LABEL_SHAKE = _MDCFloatingLabelFoun.LABEL_SHAKE;
  13252. if (shouldFloat) {
  13253. this.adapter_.addClass(LABEL_FLOAT_ABOVE);
  13254. } else {
  13255. this.adapter_.removeClass(LABEL_FLOAT_ABOVE);
  13256. this.adapter_.removeClass(LABEL_SHAKE);
  13257. }
  13258. }
  13259. /**
  13260. * Handles an interaction event on the root element.
  13261. */
  13262. }, {
  13263. key: 'handleShakeAnimationEnd_',
  13264. value: function handleShakeAnimationEnd_() {
  13265. var LABEL_SHAKE = MDCFloatingLabelFoundation.cssClasses.LABEL_SHAKE;
  13266. this.adapter_.removeClass(LABEL_SHAKE);
  13267. }
  13268. }]);
  13269. return MDCFloatingLabelFoundation;
  13270. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  13271. /* harmony default export */ __webpack_exports__["a"] = (MDCFloatingLabelFoundation);
  13272. /***/ }),
  13273. /* 92 */
  13274. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13275. "use strict";
  13276. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  13277. /**
  13278. * @license
  13279. * Copyright 2016 Google Inc.
  13280. *
  13281. * Permission is hereby granted, free of charge, to any person obtaining a copy
  13282. * of this software and associated documentation files (the "Software"), to deal
  13283. * in the Software without restriction, including without limitation the rights
  13284. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  13285. * copies of the Software, and to permit persons to whom the Software is
  13286. * furnished to do so, subject to the following conditions:
  13287. *
  13288. * The above copyright notice and this permission notice shall be included in
  13289. * all copies or substantial portions of the Software.
  13290. *
  13291. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13292. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  13293. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  13294. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  13295. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  13296. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  13297. * THE SOFTWARE.
  13298. */
  13299. /** @enum {string} */
  13300. var cssClasses = {
  13301. LABEL_FLOAT_ABOVE: 'mdc-floating-label--float-above',
  13302. LABEL_SHAKE: 'mdc-floating-label--shake',
  13303. ROOT: 'mdc-floating-label'
  13304. };
  13305. /***/ }),
  13306. /* 93 */
  13307. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13308. "use strict";
  13309. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  13310. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCFormField", function() { return MDCFormField; });
  13311. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  13312. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(94);
  13313. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_selection_control_index__ = __webpack_require__(3);
  13314. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCFormFieldFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__foundation__["a"]; });
  13315. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  13316. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13317. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  13318. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  13319. /**
  13320. * @license
  13321. * Copyright 2017 Google Inc.
  13322. *
  13323. * Permission is hereby granted, free of charge, to any person obtaining a copy
  13324. * of this software and associated documentation files (the "Software"), to deal
  13325. * in the Software without restriction, including without limitation the rights
  13326. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  13327. * copies of the Software, and to permit persons to whom the Software is
  13328. * furnished to do so, subject to the following conditions:
  13329. *
  13330. * The above copyright notice and this permission notice shall be included in
  13331. * all copies or substantial portions of the Software.
  13332. *
  13333. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13334. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  13335. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  13336. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  13337. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  13338. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  13339. * THE SOFTWARE.
  13340. */
  13341. /* eslint-disable no-unused-vars */
  13342. /* eslint-enable no-unused-vars */
  13343. /**
  13344. * @extends MDCComponent<!MDCFormFieldFoundation>
  13345. */
  13346. var MDCFormField = function (_MDCComponent) {
  13347. _inherits(MDCFormField, _MDCComponent);
  13348. _createClass(MDCFormField, [{
  13349. key: 'input',
  13350. /** @param {?MDCSelectionControl} input */
  13351. set: function set(input) {
  13352. this.input_ = input;
  13353. }
  13354. /** @return {?MDCSelectionControl} */
  13355. ,
  13356. get: function get() {
  13357. return this.input_;
  13358. }
  13359. }], [{
  13360. key: 'attachTo',
  13361. value: function attachTo(root) {
  13362. return new MDCFormField(root);
  13363. }
  13364. }]);
  13365. function MDCFormField() {
  13366. var _ref;
  13367. _classCallCheck(this, MDCFormField);
  13368. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  13369. args[_key] = arguments[_key];
  13370. }
  13371. /** @private {?MDCSelectionControl} */
  13372. var _this = _possibleConstructorReturn(this, (_ref = MDCFormField.__proto__ || Object.getPrototypeOf(MDCFormField)).call.apply(_ref, [this].concat(args)));
  13373. _this.input_;
  13374. return _this;
  13375. }
  13376. /**
  13377. * @return {!Element}
  13378. * @private
  13379. */
  13380. _createClass(MDCFormField, [{
  13381. key: 'getDefaultFoundation',
  13382. /** @return {!MDCFormFieldFoundation} */
  13383. value: function getDefaultFoundation() {
  13384. var _this2 = this;
  13385. return new __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]({
  13386. registerInteractionHandler: function registerInteractionHandler(type, handler) {
  13387. return _this2.label_.addEventListener(type, handler);
  13388. },
  13389. deregisterInteractionHandler: function deregisterInteractionHandler(type, handler) {
  13390. return _this2.label_.removeEventListener(type, handler);
  13391. },
  13392. activateInputRipple: function activateInputRipple() {
  13393. if (_this2.input_ && _this2.input_.ripple) {
  13394. _this2.input_.ripple.activate();
  13395. }
  13396. },
  13397. deactivateInputRipple: function deactivateInputRipple() {
  13398. if (_this2.input_ && _this2.input_.ripple) {
  13399. _this2.input_.ripple.deactivate();
  13400. }
  13401. }
  13402. });
  13403. }
  13404. }, {
  13405. key: 'label_',
  13406. get: function get() {
  13407. var LABEL_SELECTOR = __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.LABEL_SELECTOR;
  13408. return (/** @type {!Element} */this.root_.querySelector(LABEL_SELECTOR)
  13409. );
  13410. }
  13411. }]);
  13412. return MDCFormField;
  13413. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  13414. /***/ }),
  13415. /* 94 */
  13416. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13417. "use strict";
  13418. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  13419. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(95);
  13420. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(96);
  13421. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  13422. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  13423. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13424. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  13425. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  13426. /**
  13427. * @license
  13428. * Copyright 2017 Google Inc.
  13429. *
  13430. * Permission is hereby granted, free of charge, to any person obtaining a copy
  13431. * of this software and associated documentation files (the "Software"), to deal
  13432. * in the Software without restriction, including without limitation the rights
  13433. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  13434. * copies of the Software, and to permit persons to whom the Software is
  13435. * furnished to do so, subject to the following conditions:
  13436. *
  13437. * The above copyright notice and this permission notice shall be included in
  13438. * all copies or substantial portions of the Software.
  13439. *
  13440. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13441. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  13442. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  13443. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  13444. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  13445. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  13446. * THE SOFTWARE.
  13447. */
  13448. /**
  13449. * @extends {MDCFoundation<!MDCFormFieldAdapter>}
  13450. */
  13451. var MDCFormFieldFoundation = function (_MDCFoundation) {
  13452. _inherits(MDCFormFieldFoundation, _MDCFoundation);
  13453. _createClass(MDCFormFieldFoundation, null, [{
  13454. key: 'cssClasses',
  13455. /** @return enum {cssClasses} */
  13456. get: function get() {
  13457. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  13458. }
  13459. /** @return enum {strings} */
  13460. }, {
  13461. key: 'strings',
  13462. get: function get() {
  13463. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  13464. }
  13465. /** @return {!MDCFormFieldAdapter} */
  13466. }, {
  13467. key: 'defaultAdapter',
  13468. get: function get() {
  13469. return {
  13470. registerInteractionHandler: function registerInteractionHandler() /* type: string, handler: EventListener */{},
  13471. deregisterInteractionHandler: function deregisterInteractionHandler() /* type: string, handler: EventListener */{},
  13472. activateInputRipple: function activateInputRipple() {},
  13473. deactivateInputRipple: function deactivateInputRipple() {}
  13474. };
  13475. }
  13476. }]);
  13477. function MDCFormFieldFoundation(adapter) {
  13478. _classCallCheck(this, MDCFormFieldFoundation);
  13479. /** @private {!EventListener} */
  13480. var _this = _possibleConstructorReturn(this, (MDCFormFieldFoundation.__proto__ || Object.getPrototypeOf(MDCFormFieldFoundation)).call(this, _extends(MDCFormFieldFoundation.defaultAdapter, adapter)));
  13481. _this.clickHandler_ = /** @type {!EventListener} */function () {
  13482. return _this.handleClick_();
  13483. };
  13484. return _this;
  13485. }
  13486. _createClass(MDCFormFieldFoundation, [{
  13487. key: 'init',
  13488. value: function init() {
  13489. this.adapter_.registerInteractionHandler('click', this.clickHandler_);
  13490. }
  13491. }, {
  13492. key: 'destroy',
  13493. value: function destroy() {
  13494. this.adapter_.deregisterInteractionHandler('click', this.clickHandler_);
  13495. }
  13496. /** @private */
  13497. }, {
  13498. key: 'handleClick_',
  13499. value: function handleClick_() {
  13500. var _this2 = this;
  13501. this.adapter_.activateInputRipple();
  13502. requestAnimationFrame(function () {
  13503. return _this2.adapter_.deactivateInputRipple();
  13504. });
  13505. }
  13506. }]);
  13507. return MDCFormFieldFoundation;
  13508. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  13509. /* harmony default export */ __webpack_exports__["a"] = (MDCFormFieldFoundation);
  13510. /***/ }),
  13511. /* 95 */
  13512. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13513. "use strict";
  13514. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  13515. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13516. /**
  13517. * @license
  13518. * Copyright 2016 Google Inc.
  13519. *
  13520. * Permission is hereby granted, free of charge, to any person obtaining a copy
  13521. * of this software and associated documentation files (the "Software"), to deal
  13522. * in the Software without restriction, including without limitation the rights
  13523. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  13524. * copies of the Software, and to permit persons to whom the Software is
  13525. * furnished to do so, subject to the following conditions:
  13526. *
  13527. * The above copyright notice and this permission notice shall be included in
  13528. * all copies or substantial portions of the Software.
  13529. *
  13530. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13531. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  13532. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  13533. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  13534. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  13535. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  13536. * THE SOFTWARE.
  13537. */
  13538. /* eslint no-unused-vars: [2, {"args": "none"}] */
  13539. /**
  13540. * Adapter for MDC Form Field. Provides an interface for managing
  13541. * - event handlers
  13542. * - ripple activation
  13543. *
  13544. * Additionally, provides type information for the adapter to the Closure
  13545. * compiler.
  13546. *
  13547. * Implement this adapter for your framework of choice to delegate updates to
  13548. * the component in your framework of choice. See architecture documentation
  13549. * for more details.
  13550. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  13551. *
  13552. * @record
  13553. */
  13554. var MDCFormFieldAdapter = function () {
  13555. function MDCFormFieldAdapter() {
  13556. _classCallCheck(this, MDCFormFieldAdapter);
  13557. }
  13558. _createClass(MDCFormFieldAdapter, [{
  13559. key: "registerInteractionHandler",
  13560. /**
  13561. * @param {string} type
  13562. * @param {!EventListener} handler
  13563. */
  13564. value: function registerInteractionHandler(type, handler) {}
  13565. /**
  13566. * @param {string} type
  13567. * @param {!EventListener} handler
  13568. */
  13569. }, {
  13570. key: "deregisterInteractionHandler",
  13571. value: function deregisterInteractionHandler(type, handler) {}
  13572. }, {
  13573. key: "activateInputRipple",
  13574. value: function activateInputRipple() {}
  13575. }, {
  13576. key: "deactivateInputRipple",
  13577. value: function deactivateInputRipple() {}
  13578. }]);
  13579. return MDCFormFieldAdapter;
  13580. }();
  13581. /* unused harmony default export */ var _unused_webpack_default_export = (MDCFormFieldAdapter);
  13582. /***/ }),
  13583. /* 96 */
  13584. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13585. "use strict";
  13586. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  13587. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  13588. /**
  13589. * @license
  13590. * Copyright 2017 Google Inc.
  13591. *
  13592. * Permission is hereby granted, free of charge, to any person obtaining a copy
  13593. * of this software and associated documentation files (the "Software"), to deal
  13594. * in the Software without restriction, including without limitation the rights
  13595. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  13596. * copies of the Software, and to permit persons to whom the Software is
  13597. * furnished to do so, subject to the following conditions:
  13598. *
  13599. * The above copyright notice and this permission notice shall be included in
  13600. * all copies or substantial portions of the Software.
  13601. *
  13602. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13603. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  13604. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  13605. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  13606. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  13607. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  13608. * THE SOFTWARE.
  13609. */
  13610. /** @enum {string} */
  13611. var cssClasses = {
  13612. ROOT: 'mdc-form-field'
  13613. };
  13614. /** @enum {string} */
  13615. var strings = {
  13616. LABEL_SELECTOR: '.mdc-form-field > label'
  13617. };
  13618. /***/ }),
  13619. /* 97 */
  13620. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13621. "use strict";
  13622. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  13623. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCGridList", function() { return MDCGridList; });
  13624. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  13625. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(98);
  13626. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCGridListFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__foundation__["a"]; });
  13627. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  13628. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13629. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  13630. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  13631. /**
  13632. * @license
  13633. * Copyright 2016 Google Inc.
  13634. *
  13635. * Permission is hereby granted, free of charge, to any person obtaining a copy
  13636. * of this software and associated documentation files (the "Software"), to deal
  13637. * in the Software without restriction, including without limitation the rights
  13638. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  13639. * copies of the Software, and to permit persons to whom the Software is
  13640. * furnished to do so, subject to the following conditions:
  13641. *
  13642. * The above copyright notice and this permission notice shall be included in
  13643. * all copies or substantial portions of the Software.
  13644. *
  13645. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13646. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  13647. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  13648. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  13649. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  13650. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  13651. * THE SOFTWARE.
  13652. */
  13653. var MDCGridList = function (_MDCComponent) {
  13654. _inherits(MDCGridList, _MDCComponent);
  13655. function MDCGridList() {
  13656. _classCallCheck(this, MDCGridList);
  13657. return _possibleConstructorReturn(this, (MDCGridList.__proto__ || Object.getPrototypeOf(MDCGridList)).apply(this, arguments));
  13658. }
  13659. _createClass(MDCGridList, [{
  13660. key: 'getDefaultFoundation',
  13661. value: function getDefaultFoundation() {
  13662. var _this2 = this;
  13663. return new __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]({
  13664. getOffsetWidth: function getOffsetWidth() {
  13665. return _this2.root_.offsetWidth;
  13666. },
  13667. getNumberOfTiles: function getNumberOfTiles() {
  13668. return _this2.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.TILE_SELECTOR).length;
  13669. },
  13670. getOffsetWidthForTileAtIndex: function getOffsetWidthForTileAtIndex(index) {
  13671. return _this2.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.TILE_SELECTOR)[index].offsetWidth;
  13672. },
  13673. setStyleForTilesElement: function setStyleForTilesElement(property, value) {
  13674. _this2.root_.querySelector(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.TILES_SELECTOR).style[property] = value;
  13675. },
  13676. registerResizeHandler: function registerResizeHandler(handler) {
  13677. return window.addEventListener('resize', handler);
  13678. },
  13679. deregisterResizeHandler: function deregisterResizeHandler(handler) {
  13680. return window.removeEventListener('resize', handler);
  13681. }
  13682. });
  13683. }
  13684. }], [{
  13685. key: 'attachTo',
  13686. value: function attachTo(root) {
  13687. return new MDCGridList(root);
  13688. }
  13689. }]);
  13690. return MDCGridList;
  13691. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  13692. /***/ }),
  13693. /* 98 */
  13694. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13695. "use strict";
  13696. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  13697. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(99);
  13698. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  13699. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  13700. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13701. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  13702. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  13703. /**
  13704. * @license
  13705. * Copyright 2016 Google Inc.
  13706. *
  13707. * Permission is hereby granted, free of charge, to any person obtaining a copy
  13708. * of this software and associated documentation files (the "Software"), to deal
  13709. * in the Software without restriction, including without limitation the rights
  13710. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  13711. * copies of the Software, and to permit persons to whom the Software is
  13712. * furnished to do so, subject to the following conditions:
  13713. *
  13714. * The above copyright notice and this permission notice shall be included in
  13715. * all copies or substantial portions of the Software.
  13716. *
  13717. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13718. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  13719. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  13720. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  13721. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  13722. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  13723. * THE SOFTWARE.
  13724. */
  13725. var MDCGridListFoundation = function (_MDCFoundation) {
  13726. _inherits(MDCGridListFoundation, _MDCFoundation);
  13727. _createClass(MDCGridListFoundation, null, [{
  13728. key: 'strings',
  13729. get: function get() {
  13730. return __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* strings */];
  13731. }
  13732. }, {
  13733. key: 'defaultAdapter',
  13734. get: function get() {
  13735. return {
  13736. getOffsetWidth: function getOffsetWidth() {
  13737. return (/* number */0
  13738. );
  13739. },
  13740. getNumberOfTiles: function getNumberOfTiles() {
  13741. return (/* number */0
  13742. );
  13743. },
  13744. getOffsetWidthForTileAtIndex: function getOffsetWidthForTileAtIndex() {
  13745. return (/* index: number */ /* number */0
  13746. );
  13747. },
  13748. setStyleForTilesElement: function setStyleForTilesElement() /* property: string, value: string */{},
  13749. registerResizeHandler: function registerResizeHandler() /* handler: EventListener */{},
  13750. deregisterResizeHandler: function deregisterResizeHandler() /* handler: EventListener */{}
  13751. };
  13752. }
  13753. }]);
  13754. function MDCGridListFoundation(adapter) {
  13755. _classCallCheck(this, MDCGridListFoundation);
  13756. var _this = _possibleConstructorReturn(this, (MDCGridListFoundation.__proto__ || Object.getPrototypeOf(MDCGridListFoundation)).call(this, _extends(MDCGridListFoundation.defaultAdapter, adapter)));
  13757. _this.resizeHandler_ = function () {
  13758. return _this.alignCenter();
  13759. };
  13760. _this.resizeFrame_ = 0;
  13761. return _this;
  13762. }
  13763. _createClass(MDCGridListFoundation, [{
  13764. key: 'init',
  13765. value: function init() {
  13766. this.alignCenter();
  13767. this.adapter_.registerResizeHandler(this.resizeHandler_);
  13768. }
  13769. }, {
  13770. key: 'destroy',
  13771. value: function destroy() {
  13772. this.adapter_.deregisterResizeHandler(this.resizeHandler_);
  13773. }
  13774. }, {
  13775. key: 'alignCenter',
  13776. value: function alignCenter() {
  13777. var _this2 = this;
  13778. if (this.resizeFrame_ !== 0) {
  13779. cancelAnimationFrame(this.resizeFrame_);
  13780. }
  13781. this.resizeFrame_ = requestAnimationFrame(function () {
  13782. _this2.alignCenter_();
  13783. _this2.resizeFrame_ = 0;
  13784. });
  13785. }
  13786. }, {
  13787. key: 'alignCenter_',
  13788. value: function alignCenter_() {
  13789. if (this.adapter_.getNumberOfTiles() == 0) {
  13790. return;
  13791. }
  13792. var gridWidth = this.adapter_.getOffsetWidth();
  13793. var itemWidth = this.adapter_.getOffsetWidthForTileAtIndex(0);
  13794. var tilesWidth = itemWidth * Math.floor(gridWidth / itemWidth);
  13795. this.adapter_.setStyleForTilesElement('width', tilesWidth + 'px');
  13796. }
  13797. }]);
  13798. return MDCGridListFoundation;
  13799. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  13800. /* harmony default export */ __webpack_exports__["a"] = (MDCGridListFoundation);
  13801. /***/ }),
  13802. /* 99 */
  13803. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13804. "use strict";
  13805. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return strings; });
  13806. /**
  13807. * @license
  13808. * Copyright 2016 Google Inc.
  13809. *
  13810. * Permission is hereby granted, free of charge, to any person obtaining a copy
  13811. * of this software and associated documentation files (the "Software"), to deal
  13812. * in the Software without restriction, including without limitation the rights
  13813. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  13814. * copies of the Software, and to permit persons to whom the Software is
  13815. * furnished to do so, subject to the following conditions:
  13816. *
  13817. * The above copyright notice and this permission notice shall be included in
  13818. * all copies or substantial portions of the Software.
  13819. *
  13820. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13821. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  13822. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  13823. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  13824. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  13825. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  13826. * THE SOFTWARE.
  13827. */
  13828. var strings = {
  13829. TILES_SELECTOR: '.mdc-grid-list__tiles',
  13830. TILE_SELECTOR: '.mdc-grid-tile'
  13831. };
  13832. /***/ }),
  13833. /* 100 */
  13834. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13835. "use strict";
  13836. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  13837. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCIconButtonToggle", function() { return MDCIconButtonToggle; });
  13838. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  13839. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(101);
  13840. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_ripple_index__ = __webpack_require__(2);
  13841. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCIconButtonToggleFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__foundation__["a"]; });
  13842. var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
  13843. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  13844. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13845. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  13846. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  13847. /**
  13848. * @license
  13849. * Copyright 2018 Google Inc.
  13850. *
  13851. * Permission is hereby granted, free of charge, to any person obtaining a copy
  13852. * of this software and associated documentation files (the "Software"), to deal
  13853. * in the Software without restriction, including without limitation the rights
  13854. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  13855. * copies of the Software, and to permit persons to whom the Software is
  13856. * furnished to do so, subject to the following conditions:
  13857. *
  13858. * The above copyright notice and this permission notice shall be included in
  13859. * all copies or substantial portions of the Software.
  13860. *
  13861. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13862. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  13863. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  13864. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  13865. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  13866. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  13867. * THE SOFTWARE.
  13868. */
  13869. /**
  13870. * @extends {MDCComponent<!MDCIconButtonToggleFoundation>}
  13871. */
  13872. var MDCIconButtonToggle = function (_MDCComponent) {
  13873. _inherits(MDCIconButtonToggle, _MDCComponent);
  13874. _createClass(MDCIconButtonToggle, null, [{
  13875. key: 'attachTo',
  13876. value: function attachTo(root) {
  13877. return new MDCIconButtonToggle(root);
  13878. }
  13879. }]);
  13880. function MDCIconButtonToggle() {
  13881. var _ref;
  13882. _classCallCheck(this, MDCIconButtonToggle);
  13883. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  13884. args[_key] = arguments[_key];
  13885. }
  13886. /** @private {!MDCRipple} */
  13887. var _this = _possibleConstructorReturn(this, (_ref = MDCIconButtonToggle.__proto__ || Object.getPrototypeOf(MDCIconButtonToggle)).call.apply(_ref, [this].concat(args)));
  13888. _this.ripple_ = _this.initRipple_();
  13889. /** @private {!Function} */
  13890. _this.handleClick_;
  13891. return _this;
  13892. }
  13893. /**
  13894. * @return {!MDCRipple}
  13895. * @private
  13896. */
  13897. _createClass(MDCIconButtonToggle, [{
  13898. key: 'initRipple_',
  13899. value: function initRipple_() {
  13900. var ripple = new __WEBPACK_IMPORTED_MODULE_2__material_ripple_index__["MDCRipple"](this.root_);
  13901. ripple.unbounded = true;
  13902. return ripple;
  13903. }
  13904. }, {
  13905. key: 'destroy',
  13906. value: function destroy() {
  13907. this.root_.removeEventListener('click', this.handleClick_);
  13908. this.ripple_.destroy();
  13909. _get(MDCIconButtonToggle.prototype.__proto__ || Object.getPrototypeOf(MDCIconButtonToggle.prototype), 'destroy', this).call(this);
  13910. }
  13911. /** @return {!MDCIconButtonToggleFoundation} */
  13912. }, {
  13913. key: 'getDefaultFoundation',
  13914. value: function getDefaultFoundation() {
  13915. var _this2 = this;
  13916. return new __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]({
  13917. addClass: function addClass(className) {
  13918. return _this2.root_.classList.add(className);
  13919. },
  13920. removeClass: function removeClass(className) {
  13921. return _this2.root_.classList.remove(className);
  13922. },
  13923. hasClass: function hasClass(className) {
  13924. return _this2.root_.classList.contains(className);
  13925. },
  13926. setAttr: function setAttr(attrName, attrValue) {
  13927. return _this2.root_.setAttribute(attrName, attrValue);
  13928. },
  13929. notifyChange: function notifyChange(evtData) {
  13930. return _this2.emit(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.CHANGE_EVENT, evtData);
  13931. }
  13932. });
  13933. }
  13934. }, {
  13935. key: 'initialSyncWithDOM',
  13936. value: function initialSyncWithDOM() {
  13937. this.handleClick_ = this.foundation_.handleClick.bind(this.foundation_);
  13938. this.root_.addEventListener('click', this.handleClick_);
  13939. }
  13940. /** @return {!MDCRipple} */
  13941. }, {
  13942. key: 'ripple',
  13943. get: function get() {
  13944. return this.ripple_;
  13945. }
  13946. /** @return {boolean} */
  13947. }, {
  13948. key: 'on',
  13949. get: function get() {
  13950. return this.foundation_.isOn();
  13951. }
  13952. /** @param {boolean} isOn */
  13953. ,
  13954. set: function set(isOn) {
  13955. this.foundation_.toggle(isOn);
  13956. }
  13957. }]);
  13958. return MDCIconButtonToggle;
  13959. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  13960. /***/ }),
  13961. /* 101 */
  13962. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13963. "use strict";
  13964. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  13965. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(102);
  13966. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(103);
  13967. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  13968. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  13969. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13970. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  13971. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  13972. /**
  13973. * @license
  13974. * Copyright 2018 Google Inc.
  13975. *
  13976. * Permission is hereby granted, free of charge, to any person obtaining a copy
  13977. * of this software and associated documentation files (the "Software"), to deal
  13978. * in the Software without restriction, including without limitation the rights
  13979. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  13980. * copies of the Software, and to permit persons to whom the Software is
  13981. * furnished to do so, subject to the following conditions:
  13982. *
  13983. * The above copyright notice and this permission notice shall be included in
  13984. * all copies or substantial portions of the Software.
  13985. *
  13986. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13987. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  13988. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  13989. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  13990. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  13991. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  13992. * THE SOFTWARE.
  13993. */
  13994. /* eslint-disable no-unused-vars */
  13995. /**
  13996. * @extends {MDCFoundation<!MDCIconButtonToggleAdapter>}
  13997. */
  13998. var MDCIconButtonToggleFoundation = function (_MDCFoundation) {
  13999. _inherits(MDCIconButtonToggleFoundation, _MDCFoundation);
  14000. _createClass(MDCIconButtonToggleFoundation, null, [{
  14001. key: 'cssClasses',
  14002. get: function get() {
  14003. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  14004. }
  14005. }, {
  14006. key: 'strings',
  14007. get: function get() {
  14008. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  14009. }
  14010. }, {
  14011. key: 'defaultAdapter',
  14012. get: function get() {
  14013. return {
  14014. addClass: function addClass() {},
  14015. removeClass: function removeClass() {},
  14016. hasClass: function hasClass() {},
  14017. setAttr: function setAttr() {},
  14018. notifyChange: function notifyChange() {}
  14019. };
  14020. }
  14021. }]);
  14022. function MDCIconButtonToggleFoundation(adapter) {
  14023. _classCallCheck(this, MDCIconButtonToggleFoundation);
  14024. /** @private {boolean} */
  14025. var _this = _possibleConstructorReturn(this, (MDCIconButtonToggleFoundation.__proto__ || Object.getPrototypeOf(MDCIconButtonToggleFoundation)).call(this, _extends(MDCIconButtonToggleFoundation.defaultAdapter, adapter)));
  14026. _this.disabled_ = false;
  14027. return _this;
  14028. }
  14029. _createClass(MDCIconButtonToggleFoundation, [{
  14030. key: 'init',
  14031. value: function init() {
  14032. this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_PRESSED, '' + this.isOn());
  14033. }
  14034. }, {
  14035. key: 'handleClick',
  14036. value: function handleClick() {
  14037. this.toggle();
  14038. this.adapter_.notifyChange( /** @type {!IconButtonToggleEvent} */{ isOn: this.isOn() });
  14039. }
  14040. /** @return {boolean} */
  14041. }, {
  14042. key: 'isOn',
  14043. value: function isOn() {
  14044. return this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ICON_BUTTON_ON);
  14045. }
  14046. /** @param {boolean=} isOn */
  14047. }, {
  14048. key: 'toggle',
  14049. value: function toggle() {
  14050. var isOn = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !this.isOn();
  14051. if (isOn) {
  14052. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ICON_BUTTON_ON);
  14053. } else {
  14054. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ICON_BUTTON_ON);
  14055. }
  14056. this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_PRESSED, '' + isOn);
  14057. }
  14058. }]);
  14059. return MDCIconButtonToggleFoundation;
  14060. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  14061. /** @record */
  14062. var IconButtonToggleState = function IconButtonToggleState() {
  14063. _classCallCheck(this, IconButtonToggleState);
  14064. };
  14065. /* harmony default export */ __webpack_exports__["a"] = (MDCIconButtonToggleFoundation);
  14066. /***/ }),
  14067. /* 102 */
  14068. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14069. "use strict";
  14070. /* unused harmony export MDCIconButtonToggleAdapter */
  14071. /* unused harmony export IconButtonToggleEvent */
  14072. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  14073. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  14074. /**
  14075. * @license
  14076. * Copyright 2018 Google Inc.
  14077. *
  14078. * Permission is hereby granted, free of charge, to any person obtaining a copy
  14079. * of this software and associated documentation files (the "Software"), to deal
  14080. * in the Software without restriction, including without limitation the rights
  14081. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  14082. * copies of the Software, and to permit persons to whom the Software is
  14083. * furnished to do so, subject to the following conditions:
  14084. *
  14085. * The above copyright notice and this permission notice shall be included in
  14086. * all copies or substantial portions of the Software.
  14087. *
  14088. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14089. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14090. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  14091. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  14092. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  14093. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  14094. * THE SOFTWARE.
  14095. */
  14096. /* eslint no-unused-vars: [2, {"args": "none"}] */
  14097. /**
  14098. * Adapter for MDC Icon Button Toggle. Provides an interface for managing
  14099. * - classes
  14100. * - dom
  14101. * - inner text
  14102. * - event handlers
  14103. * - event dispatch
  14104. *
  14105. * Additionally, provides type information for the adapter to the Closure
  14106. * compiler.
  14107. *
  14108. * Implement this adapter for your framework of choice to delegate updates to
  14109. * the component in your framework of choice. See architecture documentation
  14110. * for more details.
  14111. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  14112. *
  14113. * @record
  14114. */
  14115. var MDCIconButtonToggleAdapter = function () {
  14116. function MDCIconButtonToggleAdapter() {
  14117. _classCallCheck(this, MDCIconButtonToggleAdapter);
  14118. }
  14119. _createClass(MDCIconButtonToggleAdapter, [{
  14120. key: "addClass",
  14121. /** @param {string} className */
  14122. value: function addClass(className) {}
  14123. /** @param {string} className */
  14124. }, {
  14125. key: "removeClass",
  14126. value: function removeClass(className) {}
  14127. /**
  14128. * @param {string} className
  14129. * @return {boolean}
  14130. * */
  14131. }, {
  14132. key: "hasClass",
  14133. value: function hasClass(className) {}
  14134. /**
  14135. * @param {string} attrName
  14136. * @param {string} attrValue
  14137. */
  14138. }, {
  14139. key: "setAttr",
  14140. value: function setAttr(attrName, attrValue) {}
  14141. /** @param {!IconButtonToggleEvent} evtData */
  14142. }, {
  14143. key: "notifyChange",
  14144. value: function notifyChange(evtData) {}
  14145. }]);
  14146. return MDCIconButtonToggleAdapter;
  14147. }();
  14148. /**
  14149. * @typedef {{
  14150. * isOn: boolean,
  14151. * }}
  14152. */
  14153. var IconButtonToggleEvent = void 0;
  14154. /***/ }),
  14155. /* 103 */
  14156. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14157. "use strict";
  14158. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  14159. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  14160. /**
  14161. * @license
  14162. * Copyright 2018 Google Inc.
  14163. *
  14164. * Permission is hereby granted, free of charge, to any person obtaining a copy
  14165. * of this software and associated documentation files (the "Software"), to deal
  14166. * in the Software without restriction, including without limitation the rights
  14167. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  14168. * copies of the Software, and to permit persons to whom the Software is
  14169. * furnished to do so, subject to the following conditions:
  14170. *
  14171. * The above copyright notice and this permission notice shall be included in
  14172. * all copies or substantial portions of the Software.
  14173. *
  14174. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14175. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14176. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  14177. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  14178. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  14179. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  14180. * THE SOFTWARE.
  14181. */
  14182. /** @enum {string} */
  14183. var cssClasses = {
  14184. ROOT: 'mdc-icon-button',
  14185. ICON_BUTTON_ON: 'mdc-icon-button--on'
  14186. };
  14187. /** @enum {string} */
  14188. var strings = {
  14189. ARIA_PRESSED: 'aria-pressed',
  14190. CHANGE_EVENT: 'MDCIconButtonToggle:change'
  14191. };
  14192. /***/ }),
  14193. /* 104 */
  14194. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14195. "use strict";
  14196. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  14197. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCIconToggle", function() { return MDCIconToggle; });
  14198. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  14199. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(105);
  14200. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_ripple_index__ = __webpack_require__(2);
  14201. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCIconToggleFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__foundation__["a"]; });
  14202. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  14203. var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
  14204. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  14205. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  14206. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  14207. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  14208. /**
  14209. * @license
  14210. * Copyright 2016 Google Inc.
  14211. *
  14212. * Permission is hereby granted, free of charge, to any person obtaining a copy
  14213. * of this software and associated documentation files (the "Software"), to deal
  14214. * in the Software without restriction, including without limitation the rights
  14215. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  14216. * copies of the Software, and to permit persons to whom the Software is
  14217. * furnished to do so, subject to the following conditions:
  14218. *
  14219. * The above copyright notice and this permission notice shall be included in
  14220. * all copies or substantial portions of the Software.
  14221. *
  14222. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14223. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14224. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  14225. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  14226. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  14227. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  14228. * THE SOFTWARE.
  14229. */
  14230. /**
  14231. * @extends {MDCComponent<!MDCIconToggleFoundation>}
  14232. */
  14233. var MDCIconToggle = function (_MDCComponent) {
  14234. _inherits(MDCIconToggle, _MDCComponent);
  14235. _createClass(MDCIconToggle, null, [{
  14236. key: 'attachTo',
  14237. value: function attachTo(root) {
  14238. return new MDCIconToggle(root);
  14239. }
  14240. }]);
  14241. function MDCIconToggle() {
  14242. var _ref;
  14243. _classCallCheck(this, MDCIconToggle);
  14244. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  14245. args[_key] = arguments[_key];
  14246. }
  14247. /** @private {!MDCRipple} */
  14248. var _this = _possibleConstructorReturn(this, (_ref = MDCIconToggle.__proto__ || Object.getPrototypeOf(MDCIconToggle)).call.apply(_ref, [this].concat(args)));
  14249. _this.ripple_ = _this.initRipple_();
  14250. return _this;
  14251. }
  14252. /** @return {!Element} */
  14253. _createClass(MDCIconToggle, [{
  14254. key: 'initRipple_',
  14255. /**
  14256. * @return {!MDCRipple}
  14257. * @private
  14258. */
  14259. value: function initRipple_() {
  14260. var _this2 = this;
  14261. var adapter = _extends(__WEBPACK_IMPORTED_MODULE_2__material_ripple_index__["MDCRipple"].createAdapter(this), {
  14262. isUnbounded: function isUnbounded() {
  14263. return true;
  14264. },
  14265. isSurfaceActive: function isSurfaceActive() {
  14266. return _this2.foundation_.isKeyboardActivated();
  14267. }
  14268. });
  14269. var foundation = new __WEBPACK_IMPORTED_MODULE_2__material_ripple_index__["MDCRippleFoundation"](adapter);
  14270. return new __WEBPACK_IMPORTED_MODULE_2__material_ripple_index__["MDCRipple"](this.root_, foundation);
  14271. }
  14272. }, {
  14273. key: 'destroy',
  14274. value: function destroy() {
  14275. this.ripple_.destroy();
  14276. _get(MDCIconToggle.prototype.__proto__ || Object.getPrototypeOf(MDCIconToggle.prototype), 'destroy', this).call(this);
  14277. }
  14278. /** @return {!MDCIconToggleFoundation} */
  14279. }, {
  14280. key: 'getDefaultFoundation',
  14281. value: function getDefaultFoundation() {
  14282. var _this3 = this;
  14283. return new __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]({
  14284. addClass: function addClass(className) {
  14285. return _this3.iconEl_.classList.add(className);
  14286. },
  14287. removeClass: function removeClass(className) {
  14288. return _this3.iconEl_.classList.remove(className);
  14289. },
  14290. registerInteractionHandler: function registerInteractionHandler(type, handler) {
  14291. return _this3.root_.addEventListener(type, handler);
  14292. },
  14293. deregisterInteractionHandler: function deregisterInteractionHandler(type, handler) {
  14294. return _this3.root_.removeEventListener(type, handler);
  14295. },
  14296. setText: function setText(text) {
  14297. return _this3.iconEl_.textContent = text;
  14298. },
  14299. getTabIndex: function getTabIndex() {
  14300. return (/* number */_this3.root_.tabIndex
  14301. );
  14302. },
  14303. setTabIndex: function setTabIndex(tabIndex) {
  14304. return _this3.root_.tabIndex = tabIndex;
  14305. },
  14306. getAttr: function getAttr(name, value) {
  14307. return _this3.root_.getAttribute(name, value);
  14308. },
  14309. setAttr: function setAttr(name, value) {
  14310. return _this3.root_.setAttribute(name, value);
  14311. },
  14312. rmAttr: function rmAttr(name) {
  14313. return _this3.root_.removeAttribute(name);
  14314. },
  14315. notifyChange: function notifyChange(evtData) {
  14316. return _this3.emit(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.CHANGE_EVENT, evtData);
  14317. }
  14318. });
  14319. }
  14320. }, {
  14321. key: 'initialSyncWithDOM',
  14322. value: function initialSyncWithDOM() {
  14323. this.on = this.root_.getAttribute(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.ARIA_PRESSED) === 'true';
  14324. this.disabled = this.root_.getAttribute(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.ARIA_DISABLED) === 'true';
  14325. }
  14326. /** @return {!MDCRipple} */
  14327. }, {
  14328. key: 'refreshToggleData',
  14329. value: function refreshToggleData() {
  14330. this.foundation_.refreshToggleData();
  14331. }
  14332. }, {
  14333. key: 'iconEl_',
  14334. get: function get() {
  14335. var sel = this.root_.dataset['iconInnerSelector'];
  14336. return sel ?
  14337. /** @type {!Element} */this.root_.querySelector(sel) : this.root_;
  14338. }
  14339. }, {
  14340. key: 'ripple',
  14341. get: function get() {
  14342. return this.ripple_;
  14343. }
  14344. /** @return {boolean} */
  14345. }, {
  14346. key: 'on',
  14347. get: function get() {
  14348. return this.foundation_.isOn();
  14349. }
  14350. /** @param {boolean} isOn */
  14351. ,
  14352. set: function set(isOn) {
  14353. this.foundation_.toggle(isOn);
  14354. }
  14355. /** @return {boolean} */
  14356. }, {
  14357. key: 'disabled',
  14358. get: function get() {
  14359. return this.foundation_.isDisabled();
  14360. }
  14361. /** @param {boolean} isDisabled */
  14362. ,
  14363. set: function set(isDisabled) {
  14364. this.foundation_.setDisabled(isDisabled);
  14365. }
  14366. }]);
  14367. return MDCIconToggle;
  14368. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  14369. /***/ }),
  14370. /* 105 */
  14371. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14372. "use strict";
  14373. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  14374. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(106);
  14375. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(107);
  14376. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  14377. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  14378. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  14379. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  14380. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  14381. /**
  14382. * @license
  14383. * Copyright 2016 Google Inc.
  14384. *
  14385. * Permission is hereby granted, free of charge, to any person obtaining a copy
  14386. * of this software and associated documentation files (the "Software"), to deal
  14387. * in the Software without restriction, including without limitation the rights
  14388. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  14389. * copies of the Software, and to permit persons to whom the Software is
  14390. * furnished to do so, subject to the following conditions:
  14391. *
  14392. * The above copyright notice and this permission notice shall be included in
  14393. * all copies or substantial portions of the Software.
  14394. *
  14395. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14396. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14397. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  14398. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  14399. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  14400. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  14401. * THE SOFTWARE.
  14402. */
  14403. /* eslint-disable no-unused-vars */
  14404. /**
  14405. * @extends {MDCFoundation<!MDCIconToggleAdapter>}
  14406. */
  14407. var MDCIconToggleFoundation = function (_MDCFoundation) {
  14408. _inherits(MDCIconToggleFoundation, _MDCFoundation);
  14409. _createClass(MDCIconToggleFoundation, null, [{
  14410. key: 'cssClasses',
  14411. get: function get() {
  14412. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  14413. }
  14414. }, {
  14415. key: 'strings',
  14416. get: function get() {
  14417. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  14418. }
  14419. }, {
  14420. key: 'defaultAdapter',
  14421. get: function get() {
  14422. return {
  14423. addClass: function addClass() /* className: string */{},
  14424. removeClass: function removeClass() /* className: string */{},
  14425. registerInteractionHandler: function registerInteractionHandler() /* type: string, handler: EventListener */{},
  14426. deregisterInteractionHandler: function deregisterInteractionHandler() /* type: string, handler: EventListener */{},
  14427. setText: function setText() /* text: string */{},
  14428. getTabIndex: function getTabIndex() {
  14429. return (/* number */0
  14430. );
  14431. },
  14432. setTabIndex: function setTabIndex() /* tabIndex: number */{},
  14433. getAttr: function getAttr() {
  14434. return (/* name: string */ /* string */''
  14435. );
  14436. },
  14437. setAttr: function setAttr() /* name: string, value: string */{},
  14438. rmAttr: function rmAttr() /* name: string */{},
  14439. notifyChange: function notifyChange() /* evtData: IconToggleEvent */{}
  14440. };
  14441. }
  14442. }]);
  14443. function MDCIconToggleFoundation(adapter) {
  14444. _classCallCheck(this, MDCIconToggleFoundation);
  14445. /** @private {boolean} */
  14446. var _this = _possibleConstructorReturn(this, (MDCIconToggleFoundation.__proto__ || Object.getPrototypeOf(MDCIconToggleFoundation)).call(this, _extends(MDCIconToggleFoundation.defaultAdapter, adapter)));
  14447. _this.on_ = false;
  14448. /** @private {boolean} */
  14449. _this.disabled_ = false;
  14450. /** @private {number} */
  14451. _this.savedTabIndex_ = -1;
  14452. /** @private {?IconToggleState} */
  14453. _this.toggleOnData_ = null;
  14454. /** @private {?IconToggleState} */
  14455. _this.toggleOffData_ = null;
  14456. _this.clickHandler_ = /** @private {!EventListener} */function () {
  14457. return _this.toggleFromEvt_();
  14458. };
  14459. /** @private {boolean} */
  14460. _this.isHandlingKeydown_ = false;
  14461. _this.keydownHandler_ = /** @private {!EventListener} */function ( /** @type {!KeyboardKey} */evt) {
  14462. if (isSpace(evt)) {
  14463. _this.isHandlingKeydown_ = true;
  14464. return evt.preventDefault();
  14465. }
  14466. };
  14467. _this.keyupHandler_ = /** @private {!EventListener} */function ( /** @type {!KeyboardKey} */evt) {
  14468. if (isSpace(evt)) {
  14469. _this.isHandlingKeydown_ = false;
  14470. _this.toggleFromEvt_();
  14471. }
  14472. };
  14473. return _this;
  14474. }
  14475. _createClass(MDCIconToggleFoundation, [{
  14476. key: 'init',
  14477. value: function init() {
  14478. this.refreshToggleData();
  14479. this.savedTabIndex_ = this.adapter_.getTabIndex();
  14480. this.adapter_.registerInteractionHandler('click', this.clickHandler_);
  14481. this.adapter_.registerInteractionHandler('keydown', this.keydownHandler_);
  14482. this.adapter_.registerInteractionHandler('keyup', this.keyupHandler_);
  14483. }
  14484. }, {
  14485. key: 'refreshToggleData',
  14486. value: function refreshToggleData() {
  14487. var _MDCIconToggleFoundat = MDCIconToggleFoundation.strings,
  14488. DATA_TOGGLE_ON = _MDCIconToggleFoundat.DATA_TOGGLE_ON,
  14489. DATA_TOGGLE_OFF = _MDCIconToggleFoundat.DATA_TOGGLE_OFF;
  14490. this.toggleOnData_ = this.parseJsonDataAttr_(DATA_TOGGLE_ON);
  14491. this.toggleOffData_ = this.parseJsonDataAttr_(DATA_TOGGLE_OFF);
  14492. }
  14493. }, {
  14494. key: 'destroy',
  14495. value: function destroy() {
  14496. this.adapter_.deregisterInteractionHandler('click', this.clickHandler_);
  14497. this.adapter_.deregisterInteractionHandler('keydown', this.keydownHandler_);
  14498. this.adapter_.deregisterInteractionHandler('keyup', this.keyupHandler_);
  14499. }
  14500. /** @private */
  14501. }, {
  14502. key: 'toggleFromEvt_',
  14503. value: function toggleFromEvt_() {
  14504. this.toggle();
  14505. var isOn = this.on_;
  14506. this.adapter_.notifyChange( /** @type {!IconToggleEvent} */{ isOn: isOn });
  14507. }
  14508. /** @return {boolean} */
  14509. }, {
  14510. key: 'isOn',
  14511. value: function isOn() {
  14512. return this.on_;
  14513. }
  14514. /** @param {boolean=} isOn */
  14515. }, {
  14516. key: 'toggle',
  14517. value: function toggle() {
  14518. var isOn = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !this.on_;
  14519. this.on_ = isOn;
  14520. var _MDCIconToggleFoundat2 = MDCIconToggleFoundation.strings,
  14521. ARIA_LABEL = _MDCIconToggleFoundat2.ARIA_LABEL,
  14522. ARIA_PRESSED = _MDCIconToggleFoundat2.ARIA_PRESSED;
  14523. if (this.on_) {
  14524. this.adapter_.setAttr(ARIA_PRESSED, 'true');
  14525. } else {
  14526. this.adapter_.setAttr(ARIA_PRESSED, 'false');
  14527. }
  14528. var _ref = this.on_ ? this.toggleOffData_ : this.toggleOnData_,
  14529. classToRemove = _ref.cssClass;
  14530. if (classToRemove) {
  14531. this.adapter_.removeClass(classToRemove);
  14532. }
  14533. var _ref2 = this.on_ ? this.toggleOnData_ : this.toggleOffData_,
  14534. content = _ref2.content,
  14535. label = _ref2.label,
  14536. cssClass = _ref2.cssClass;
  14537. if (cssClass) {
  14538. this.adapter_.addClass(cssClass);
  14539. }
  14540. if (content) {
  14541. this.adapter_.setText(content);
  14542. }
  14543. if (label) {
  14544. this.adapter_.setAttr(ARIA_LABEL, label);
  14545. }
  14546. }
  14547. /**
  14548. * @param {string} dataAttr
  14549. * @return {!IconToggleState}
  14550. */
  14551. }, {
  14552. key: 'parseJsonDataAttr_',
  14553. value: function parseJsonDataAttr_(dataAttr) {
  14554. var val = this.adapter_.getAttr(dataAttr);
  14555. if (!val) {
  14556. return {};
  14557. }
  14558. return (/** @type {!IconToggleState} */JSON.parse(val)
  14559. );
  14560. }
  14561. /** @return {boolean} */
  14562. }, {
  14563. key: 'isDisabled',
  14564. value: function isDisabled() {
  14565. return this.disabled_;
  14566. }
  14567. /** @param {boolean} isDisabled */
  14568. }, {
  14569. key: 'setDisabled',
  14570. value: function setDisabled(isDisabled) {
  14571. this.disabled_ = isDisabled;
  14572. var DISABLED = MDCIconToggleFoundation.cssClasses.DISABLED;
  14573. var ARIA_DISABLED = MDCIconToggleFoundation.strings.ARIA_DISABLED;
  14574. if (this.disabled_) {
  14575. this.savedTabIndex_ = this.adapter_.getTabIndex();
  14576. this.adapter_.setTabIndex(-1);
  14577. this.adapter_.setAttr(ARIA_DISABLED, 'true');
  14578. this.adapter_.addClass(DISABLED);
  14579. } else {
  14580. this.adapter_.setTabIndex(this.savedTabIndex_);
  14581. this.adapter_.rmAttr(ARIA_DISABLED);
  14582. this.adapter_.removeClass(DISABLED);
  14583. }
  14584. }
  14585. /** @return {boolean} */
  14586. }, {
  14587. key: 'isKeyboardActivated',
  14588. value: function isKeyboardActivated() {
  14589. return this.isHandlingKeydown_;
  14590. }
  14591. }]);
  14592. return MDCIconToggleFoundation;
  14593. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  14594. /**
  14595. * @typedef {{
  14596. * key: string,
  14597. * keyCode: number
  14598. * }}
  14599. */
  14600. var KeyboardKey = void 0;
  14601. /**
  14602. * @param {!KeyboardKey} keyboardKey
  14603. * @return {boolean}
  14604. */
  14605. function isSpace(keyboardKey) {
  14606. return keyboardKey.key === 'Space' || keyboardKey.keyCode === 32;
  14607. }
  14608. /** @record */
  14609. var IconToggleState = function IconToggleState() {
  14610. _classCallCheck(this, IconToggleState);
  14611. };
  14612. /**
  14613. * The aria-label value of the icon toggle, or undefined if there is no aria-label.
  14614. * @export {string|undefined}
  14615. */
  14616. IconToggleState.prototype.label;
  14617. /**
  14618. * The text for the icon toggle, or undefined if there is no text.
  14619. * @export {string|undefined}
  14620. */
  14621. IconToggleState.prototype.content;
  14622. /**
  14623. * The CSS class to add to the icon toggle, or undefined if there is no CSS class.
  14624. * @export {string|undefined}
  14625. */
  14626. IconToggleState.prototype.cssClass;
  14627. /* harmony default export */ __webpack_exports__["a"] = (MDCIconToggleFoundation);
  14628. /***/ }),
  14629. /* 106 */
  14630. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14631. "use strict";
  14632. /* unused harmony export MDCIconToggleAdapter */
  14633. /* unused harmony export IconToggleEvent */
  14634. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  14635. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  14636. /**
  14637. * @license
  14638. * Copyright 2017 Google Inc.
  14639. *
  14640. * Permission is hereby granted, free of charge, to any person obtaining a copy
  14641. * of this software and associated documentation files (the "Software"), to deal
  14642. * in the Software without restriction, including without limitation the rights
  14643. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  14644. * copies of the Software, and to permit persons to whom the Software is
  14645. * furnished to do so, subject to the following conditions:
  14646. *
  14647. * The above copyright notice and this permission notice shall be included in
  14648. * all copies or substantial portions of the Software.
  14649. *
  14650. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14651. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14652. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  14653. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  14654. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  14655. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  14656. * THE SOFTWARE.
  14657. */
  14658. /* eslint no-unused-vars: [2, {"args": "none"}] */
  14659. /**
  14660. * Adapter for MDC Icon Toggle. Provides an interface for managing
  14661. * - classes
  14662. * - dom
  14663. * - inner text
  14664. * - event handlers
  14665. * - event dispatch
  14666. *
  14667. * Additionally, provides type information for the adapter to the Closure
  14668. * compiler.
  14669. *
  14670. * Implement this adapter for your framework of choice to delegate updates to
  14671. * the component in your framework of choice. See architecture documentation
  14672. * for more details.
  14673. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  14674. *
  14675. * @record
  14676. */
  14677. var MDCIconToggleAdapter = function () {
  14678. function MDCIconToggleAdapter() {
  14679. _classCallCheck(this, MDCIconToggleAdapter);
  14680. }
  14681. _createClass(MDCIconToggleAdapter, [{
  14682. key: "addClass",
  14683. /** @param {string} className */
  14684. value: function addClass(className) {}
  14685. /** @param {string} className */
  14686. }, {
  14687. key: "removeClass",
  14688. value: function removeClass(className) {}
  14689. /**
  14690. * @param {string} type
  14691. * @param {!EventListener} handler
  14692. */
  14693. }, {
  14694. key: "registerInteractionHandler",
  14695. value: function registerInteractionHandler(type, handler) {}
  14696. /**
  14697. * @param {string} type
  14698. * @param {!EventListener} handler
  14699. */
  14700. }, {
  14701. key: "deregisterInteractionHandler",
  14702. value: function deregisterInteractionHandler(type, handler) {}
  14703. /** @param {string} text */
  14704. }, {
  14705. key: "setText",
  14706. value: function setText(text) {}
  14707. /** @return {number} */
  14708. }, {
  14709. key: "getTabIndex",
  14710. value: function getTabIndex() {}
  14711. /** @param {number} tabIndex */
  14712. }, {
  14713. key: "setTabIndex",
  14714. value: function setTabIndex(tabIndex) {}
  14715. /**
  14716. * @param {string} name
  14717. * @return {string}
  14718. */
  14719. }, {
  14720. key: "getAttr",
  14721. value: function getAttr(name) {}
  14722. /**
  14723. * @param {string} name
  14724. * @param {string} value
  14725. */
  14726. }, {
  14727. key: "setAttr",
  14728. value: function setAttr(name, value) {}
  14729. /** @param {string} name */
  14730. }, {
  14731. key: "rmAttr",
  14732. value: function rmAttr(name) {}
  14733. /** @param {!IconToggleEvent} evtData */
  14734. }, {
  14735. key: "notifyChange",
  14736. value: function notifyChange(evtData) {}
  14737. }]);
  14738. return MDCIconToggleAdapter;
  14739. }();
  14740. /**
  14741. * @typedef {{
  14742. * isOn: boolean,
  14743. * }}
  14744. */
  14745. var IconToggleEvent = void 0;
  14746. /***/ }),
  14747. /* 107 */
  14748. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14749. "use strict";
  14750. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  14751. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  14752. /**
  14753. * @license
  14754. * Copyright 2016 Google Inc.
  14755. *
  14756. * Permission is hereby granted, free of charge, to any person obtaining a copy
  14757. * of this software and associated documentation files (the "Software"), to deal
  14758. * in the Software without restriction, including without limitation the rights
  14759. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  14760. * copies of the Software, and to permit persons to whom the Software is
  14761. * furnished to do so, subject to the following conditions:
  14762. *
  14763. * The above copyright notice and this permission notice shall be included in
  14764. * all copies or substantial portions of the Software.
  14765. *
  14766. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14767. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14768. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  14769. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  14770. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  14771. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  14772. * THE SOFTWARE.
  14773. */
  14774. /** @enum {string} */
  14775. var cssClasses = {
  14776. ROOT: 'mdc-icon-toggle',
  14777. DISABLED: 'mdc-icon-toggle--disabled'
  14778. };
  14779. /** @enum {string} */
  14780. var strings = {
  14781. DATA_TOGGLE_ON: 'data-toggle-on',
  14782. DATA_TOGGLE_OFF: 'data-toggle-off',
  14783. ARIA_PRESSED: 'aria-pressed',
  14784. ARIA_DISABLED: 'aria-disabled',
  14785. ARIA_LABEL: 'aria-label',
  14786. CHANGE_EVENT: 'MDCIconToggle:change'
  14787. };
  14788. /***/ }),
  14789. /* 108 */
  14790. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14791. "use strict";
  14792. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  14793. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCLinearProgress", function() { return MDCLinearProgress; });
  14794. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  14795. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(109);
  14796. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCLinearProgressFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__foundation__["a"]; });
  14797. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  14798. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  14799. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  14800. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  14801. /**
  14802. * @license
  14803. * Copyright 2017 Google Inc.
  14804. *
  14805. * Permission is hereby granted, free of charge, to any person obtaining a copy
  14806. * of this software and associated documentation files (the "Software"), to deal
  14807. * in the Software without restriction, including without limitation the rights
  14808. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  14809. * copies of the Software, and to permit persons to whom the Software is
  14810. * furnished to do so, subject to the following conditions:
  14811. *
  14812. * The above copyright notice and this permission notice shall be included in
  14813. * all copies or substantial portions of the Software.
  14814. *
  14815. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14816. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14817. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  14818. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  14819. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  14820. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  14821. * THE SOFTWARE.
  14822. */
  14823. var MDCLinearProgress = function (_MDCComponent) {
  14824. _inherits(MDCLinearProgress, _MDCComponent);
  14825. function MDCLinearProgress() {
  14826. _classCallCheck(this, MDCLinearProgress);
  14827. return _possibleConstructorReturn(this, (MDCLinearProgress.__proto__ || Object.getPrototypeOf(MDCLinearProgress)).apply(this, arguments));
  14828. }
  14829. _createClass(MDCLinearProgress, [{
  14830. key: 'open',
  14831. value: function open() {
  14832. this.foundation_.open();
  14833. }
  14834. }, {
  14835. key: 'close',
  14836. value: function close() {
  14837. this.foundation_.close();
  14838. }
  14839. }, {
  14840. key: 'getDefaultFoundation',
  14841. value: function getDefaultFoundation() {
  14842. var _this2 = this;
  14843. return new __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]({
  14844. addClass: function addClass(className) {
  14845. return _this2.root_.classList.add(className);
  14846. },
  14847. getPrimaryBar: function getPrimaryBar() {
  14848. return _this2.root_.querySelector(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.PRIMARY_BAR_SELECTOR);
  14849. },
  14850. getBuffer: function getBuffer() {
  14851. return _this2.root_.querySelector(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.BUFFER_SELECTOR);
  14852. },
  14853. hasClass: function hasClass(className) {
  14854. return _this2.root_.classList.contains(className);
  14855. },
  14856. removeClass: function removeClass(className) {
  14857. return _this2.root_.classList.remove(className);
  14858. },
  14859. setStyle: function setStyle(el, styleProperty, value) {
  14860. return el.style[styleProperty] = value;
  14861. }
  14862. });
  14863. }
  14864. }, {
  14865. key: 'determinate',
  14866. set: function set(value) {
  14867. this.foundation_.setDeterminate(value);
  14868. }
  14869. }, {
  14870. key: 'progress',
  14871. set: function set(value) {
  14872. this.foundation_.setProgress(value);
  14873. }
  14874. }, {
  14875. key: 'buffer',
  14876. set: function set(value) {
  14877. this.foundation_.setBuffer(value);
  14878. }
  14879. }, {
  14880. key: 'reverse',
  14881. set: function set(value) {
  14882. this.foundation_.setReverse(value);
  14883. }
  14884. }], [{
  14885. key: 'attachTo',
  14886. value: function attachTo(root) {
  14887. return new MDCLinearProgress(root);
  14888. }
  14889. }]);
  14890. return MDCLinearProgress;
  14891. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  14892. /***/ }),
  14893. /* 109 */
  14894. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14895. "use strict";
  14896. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  14897. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_animation_index__ = __webpack_require__(13);
  14898. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(110);
  14899. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  14900. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  14901. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  14902. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  14903. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  14904. /**
  14905. * @license
  14906. * Copyright 2017 Google Inc.
  14907. *
  14908. * Permission is hereby granted, free of charge, to any person obtaining a copy
  14909. * of this software and associated documentation files (the "Software"), to deal
  14910. * in the Software without restriction, including without limitation the rights
  14911. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  14912. * copies of the Software, and to permit persons to whom the Software is
  14913. * furnished to do so, subject to the following conditions:
  14914. *
  14915. * The above copyright notice and this permission notice shall be included in
  14916. * all copies or substantial portions of the Software.
  14917. *
  14918. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14919. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14920. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  14921. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  14922. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  14923. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  14924. * THE SOFTWARE.
  14925. */
  14926. var MDCLinearProgressFoundation = function (_MDCFoundation) {
  14927. _inherits(MDCLinearProgressFoundation, _MDCFoundation);
  14928. _createClass(MDCLinearProgressFoundation, null, [{
  14929. key: 'cssClasses',
  14930. get: function get() {
  14931. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  14932. }
  14933. }, {
  14934. key: 'strings',
  14935. get: function get() {
  14936. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  14937. }
  14938. }, {
  14939. key: 'defaultAdapter',
  14940. get: function get() {
  14941. return {
  14942. addClass: function addClass() /* className: string */{},
  14943. getPrimaryBar: function getPrimaryBar() /* el: Element */{},
  14944. getBuffer: function getBuffer() /* el: Element */{},
  14945. hasClass: function hasClass() {
  14946. return (/* className: string */false
  14947. );
  14948. },
  14949. removeClass: function removeClass() /* className: string */{},
  14950. setStyle: function setStyle() /* el: Element, styleProperty: string, value: string */{}
  14951. };
  14952. }
  14953. }]);
  14954. function MDCLinearProgressFoundation(adapter) {
  14955. _classCallCheck(this, MDCLinearProgressFoundation);
  14956. return _possibleConstructorReturn(this, (MDCLinearProgressFoundation.__proto__ || Object.getPrototypeOf(MDCLinearProgressFoundation)).call(this, _extends(MDCLinearProgressFoundation.defaultAdapter, adapter)));
  14957. }
  14958. _createClass(MDCLinearProgressFoundation, [{
  14959. key: 'init',
  14960. value: function init() {
  14961. this.determinate_ = !this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].INDETERMINATE_CLASS);
  14962. this.reverse_ = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].REVERSED_CLASS);
  14963. this.progress_ = 0;
  14964. }
  14965. }, {
  14966. key: 'setDeterminate',
  14967. value: function setDeterminate(isDeterminate) {
  14968. this.determinate_ = isDeterminate;
  14969. if (this.determinate_) {
  14970. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].INDETERMINATE_CLASS);
  14971. this.setScale_(this.adapter_.getPrimaryBar(), this.progress_);
  14972. } else {
  14973. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].INDETERMINATE_CLASS);
  14974. this.setScale_(this.adapter_.getPrimaryBar(), 1);
  14975. this.setScale_(this.adapter_.getBuffer(), 1);
  14976. }
  14977. }
  14978. }, {
  14979. key: 'setProgress',
  14980. value: function setProgress(value) {
  14981. this.progress_ = value;
  14982. if (this.determinate_) {
  14983. this.setScale_(this.adapter_.getPrimaryBar(), value);
  14984. }
  14985. }
  14986. }, {
  14987. key: 'setBuffer',
  14988. value: function setBuffer(value) {
  14989. if (this.determinate_) {
  14990. this.setScale_(this.adapter_.getBuffer(), value);
  14991. }
  14992. }
  14993. }, {
  14994. key: 'setReverse',
  14995. value: function setReverse(isReversed) {
  14996. this.reverse_ = isReversed;
  14997. if (this.reverse_) {
  14998. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].REVERSED_CLASS);
  14999. } else {
  15000. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].REVERSED_CLASS);
  15001. }
  15002. }
  15003. }, {
  15004. key: 'open',
  15005. value: function open() {
  15006. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CLOSED_CLASS);
  15007. }
  15008. }, {
  15009. key: 'close',
  15010. value: function close() {
  15011. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CLOSED_CLASS);
  15012. }
  15013. }, {
  15014. key: 'setScale_',
  15015. value: function setScale_(el, scaleValue) {
  15016. var _this2 = this;
  15017. var value = 'scaleX(' + scaleValue + ')';
  15018. __WEBPACK_IMPORTED_MODULE_1__material_animation_index__["c" /* transformStyleProperties */].forEach(function (transformStyleProperty) {
  15019. _this2.adapter_.setStyle(el, transformStyleProperty, value);
  15020. });
  15021. }
  15022. }]);
  15023. return MDCLinearProgressFoundation;
  15024. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  15025. /* harmony default export */ __webpack_exports__["a"] = (MDCLinearProgressFoundation);
  15026. /***/ }),
  15027. /* 110 */
  15028. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15029. "use strict";
  15030. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  15031. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  15032. /**
  15033. * @license
  15034. * Copyright 2017 Google Inc.
  15035. *
  15036. * Permission is hereby granted, free of charge, to any person obtaining a copy
  15037. * of this software and associated documentation files (the "Software"), to deal
  15038. * in the Software without restriction, including without limitation the rights
  15039. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  15040. * copies of the Software, and to permit persons to whom the Software is
  15041. * furnished to do so, subject to the following conditions:
  15042. *
  15043. * The above copyright notice and this permission notice shall be included in
  15044. * all copies or substantial portions of the Software.
  15045. *
  15046. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15047. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15048. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  15049. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  15050. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  15051. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  15052. * THE SOFTWARE.
  15053. */
  15054. var cssClasses = {
  15055. CLOSED_CLASS: 'mdc-linear-progress--closed',
  15056. INDETERMINATE_CLASS: 'mdc-linear-progress--indeterminate',
  15057. REVERSED_CLASS: 'mdc-linear-progress--reversed'
  15058. };
  15059. var strings = {
  15060. PRIMARY_BAR_SELECTOR: '.mdc-linear-progress__primary-bar',
  15061. BUFFER_SELECTOR: '.mdc-linear-progress__buffer'
  15062. };
  15063. /***/ }),
  15064. /* 111 */
  15065. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15066. "use strict";
  15067. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  15068. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(42);
  15069. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(112);
  15070. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  15071. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  15072. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15073. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  15074. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  15075. /**
  15076. * @license
  15077. * Copyright 2018 Google Inc.
  15078. *
  15079. * Permission is hereby granted, free of charge, to any person obtaining a copy
  15080. * of this software and associated documentation files (the "Software"), to deal
  15081. * in the Software without restriction, including without limitation the rights
  15082. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  15083. * copies of the Software, and to permit persons to whom the Software is
  15084. * furnished to do so, subject to the following conditions:
  15085. *
  15086. * The above copyright notice and this permission notice shall be included in
  15087. * all copies or substantial portions of the Software.
  15088. *
  15089. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15090. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15091. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  15092. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  15093. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  15094. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  15095. * THE SOFTWARE.
  15096. */
  15097. /**
  15098. * @extends {MDCFoundation<!MDCLineRippleAdapter>}
  15099. * @final
  15100. */
  15101. var MDCLineRippleFoundation = function (_MDCFoundation) {
  15102. _inherits(MDCLineRippleFoundation, _MDCFoundation);
  15103. _createClass(MDCLineRippleFoundation, null, [{
  15104. key: 'cssClasses',
  15105. /** @return enum {string} */
  15106. get: function get() {
  15107. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  15108. }
  15109. /**
  15110. * {@see MDCLineRippleAdapter} for typing information on parameters and return
  15111. * types.
  15112. * @return {!MDCLineRippleAdapter}
  15113. */
  15114. }, {
  15115. key: 'defaultAdapter',
  15116. get: function get() {
  15117. return (/** @type {!MDCLineRippleAdapter} */{
  15118. addClass: function addClass() {},
  15119. removeClass: function removeClass() {},
  15120. hasClass: function hasClass() {},
  15121. setStyle: function setStyle() {},
  15122. registerEventHandler: function registerEventHandler() {},
  15123. deregisterEventHandler: function deregisterEventHandler() {}
  15124. }
  15125. );
  15126. }
  15127. /**
  15128. * @param {!MDCLineRippleAdapter=} adapter
  15129. */
  15130. }]);
  15131. function MDCLineRippleFoundation(adapter) {
  15132. _classCallCheck(this, MDCLineRippleFoundation);
  15133. /** @private {function(!Event): undefined} */
  15134. var _this = _possibleConstructorReturn(this, (MDCLineRippleFoundation.__proto__ || Object.getPrototypeOf(MDCLineRippleFoundation)).call(this, _extends(MDCLineRippleFoundation.defaultAdapter, adapter)));
  15135. _this.transitionEndHandler_ = function (evt) {
  15136. return _this.handleTransitionEnd(evt);
  15137. };
  15138. return _this;
  15139. }
  15140. _createClass(MDCLineRippleFoundation, [{
  15141. key: 'init',
  15142. value: function init() {
  15143. this.adapter_.registerEventHandler('transitionend', this.transitionEndHandler_);
  15144. }
  15145. }, {
  15146. key: 'destroy',
  15147. value: function destroy() {
  15148. this.adapter_.deregisterEventHandler('transitionend', this.transitionEndHandler_);
  15149. }
  15150. /**
  15151. * Activates the line ripple
  15152. */
  15153. }, {
  15154. key: 'activate',
  15155. value: function activate() {
  15156. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LINE_RIPPLE_DEACTIVATING);
  15157. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LINE_RIPPLE_ACTIVE);
  15158. }
  15159. /**
  15160. * Sets the center of the ripple animation to the given X coordinate.
  15161. * @param {number} xCoordinate
  15162. */
  15163. }, {
  15164. key: 'setRippleCenter',
  15165. value: function setRippleCenter(xCoordinate) {
  15166. this.adapter_.setStyle('transform-origin', xCoordinate + 'px center');
  15167. }
  15168. /**
  15169. * Deactivates the line ripple
  15170. */
  15171. }, {
  15172. key: 'deactivate',
  15173. value: function deactivate() {
  15174. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LINE_RIPPLE_DEACTIVATING);
  15175. }
  15176. /**
  15177. * Handles a transition end event
  15178. * @param {!Event} evt
  15179. */
  15180. }, {
  15181. key: 'handleTransitionEnd',
  15182. value: function handleTransitionEnd(evt) {
  15183. // Wait for the line ripple to be either transparent or opaque
  15184. // before emitting the animation end event
  15185. var isDeactivating = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LINE_RIPPLE_DEACTIVATING);
  15186. if (evt.propertyName === 'opacity') {
  15187. if (isDeactivating) {
  15188. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LINE_RIPPLE_ACTIVE);
  15189. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LINE_RIPPLE_DEACTIVATING);
  15190. }
  15191. }
  15192. }
  15193. }]);
  15194. return MDCLineRippleFoundation;
  15195. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  15196. /* harmony default export */ __webpack_exports__["a"] = (MDCLineRippleFoundation);
  15197. /***/ }),
  15198. /* 112 */
  15199. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15200. "use strict";
  15201. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  15202. /**
  15203. * @license
  15204. * Copyright 2018 Google Inc.
  15205. *
  15206. * Permission is hereby granted, free of charge, to any person obtaining a copy
  15207. * of this software and associated documentation files (the "Software"), to deal
  15208. * in the Software without restriction, including without limitation the rights
  15209. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  15210. * copies of the Software, and to permit persons to whom the Software is
  15211. * furnished to do so, subject to the following conditions:
  15212. *
  15213. * The above copyright notice and this permission notice shall be included in
  15214. * all copies or substantial portions of the Software.
  15215. *
  15216. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15217. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15218. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  15219. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  15220. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  15221. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  15222. * THE SOFTWARE.
  15223. */
  15224. /** @enum {string} */
  15225. var cssClasses = {
  15226. LINE_RIPPLE_ACTIVE: 'mdc-line-ripple--active',
  15227. LINE_RIPPLE_DEACTIVATING: 'mdc-line-ripple--deactivating'
  15228. };
  15229. /***/ }),
  15230. /* 113 */
  15231. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15232. "use strict";
  15233. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCMenuFoundation; });
  15234. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  15235. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(114);
  15236. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(17);
  15237. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_menu_surface_foundation__ = __webpack_require__(18);
  15238. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__material_list_foundation__ = __webpack_require__(15);
  15239. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  15240. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  15241. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15242. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  15243. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  15244. /**
  15245. * @license
  15246. * Copyright 2018 Google Inc.
  15247. *
  15248. * Permission is hereby granted, free of charge, to any person obtaining a copy
  15249. * of this software and associated documentation files (the "Software"), to deal
  15250. * in the Software without restriction, including without limitation the rights
  15251. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  15252. * copies of the Software, and to permit persons to whom the Software is
  15253. * furnished to do so, subject to the following conditions:
  15254. *
  15255. * The above copyright notice and this permission notice shall be included in
  15256. * all copies or substantial portions of the Software.
  15257. *
  15258. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15259. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15260. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  15261. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  15262. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  15263. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  15264. * THE SOFTWARE.
  15265. */
  15266. /**
  15267. * @extends {MDCFoundation<!MDCMenuAdapter>}
  15268. */
  15269. var MDCMenuFoundation = function (_MDCFoundation) {
  15270. _inherits(MDCMenuFoundation, _MDCFoundation);
  15271. _createClass(MDCMenuFoundation, null, [{
  15272. key: 'cssClasses',
  15273. /** @return enum{cssClasses} */
  15274. get: function get() {
  15275. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  15276. }
  15277. /** @return enum{strings} */
  15278. }, {
  15279. key: 'strings',
  15280. get: function get() {
  15281. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  15282. }
  15283. /**
  15284. * {@see MDCMenuAdapter} for typing information on parameters and return
  15285. * types.
  15286. * @return {!MDCMenuAdapter}
  15287. */
  15288. }, {
  15289. key: 'defaultAdapter',
  15290. get: function get() {
  15291. return (/** @type {!MDCMenuAdapter} */{
  15292. addClassToElementAtIndex: function addClassToElementAtIndex() {},
  15293. removeClassFromElementAtIndex: function removeClassFromElementAtIndex() {},
  15294. addAttributeToElementAtIndex: function addAttributeToElementAtIndex() {},
  15295. removeAttributeFromElementAtIndex: function removeAttributeFromElementAtIndex() {},
  15296. elementContainsClass: function elementContainsClass() {},
  15297. closeSurface: function closeSurface() {},
  15298. getElementIndex: function getElementIndex() {},
  15299. getParentElement: function getParentElement() {},
  15300. getSelectedElementIndex: function getSelectedElementIndex() {},
  15301. notifySelected: function notifySelected() {}
  15302. }
  15303. );
  15304. }
  15305. /** @param {!MDCMenuAdapter} adapter */
  15306. }]);
  15307. function MDCMenuFoundation(adapter) {
  15308. _classCallCheck(this, MDCMenuFoundation);
  15309. /** @type {number} */
  15310. var _this = _possibleConstructorReturn(this, (MDCMenuFoundation.__proto__ || Object.getPrototypeOf(MDCMenuFoundation)).call(this, _extends(MDCMenuFoundation.defaultAdapter, adapter)));
  15311. _this.closeAnimationEndTimerId_ = 0;
  15312. return _this;
  15313. }
  15314. _createClass(MDCMenuFoundation, [{
  15315. key: 'destroy',
  15316. value: function destroy() {
  15317. if (this.closeAnimationEndTimerId_) {
  15318. clearTimeout(this.closeAnimationEndTimerId_);
  15319. }
  15320. this.adapter_.closeSurface();
  15321. }
  15322. /**
  15323. * Handler function for the keydown events.
  15324. * @param {!Event} evt
  15325. */
  15326. }, {
  15327. key: 'handleKeydown',
  15328. value: function handleKeydown(evt) {
  15329. var key = evt.key,
  15330. keyCode = evt.keyCode;
  15331. var isTab = key === 'Tab' || keyCode === 9;
  15332. if (isTab) {
  15333. this.adapter_.closeSurface();
  15334. }
  15335. }
  15336. /**
  15337. * @param {!HTMLElement} listItem
  15338. */
  15339. }, {
  15340. key: 'handleItemAction',
  15341. value: function handleItemAction(listItem) {
  15342. var _this2 = this;
  15343. var index = this.adapter_.getElementIndex(listItem);
  15344. if (index < 0) {
  15345. return;
  15346. }
  15347. this.adapter_.notifySelected({ index: index });
  15348. this.adapter_.closeSurface();
  15349. // Wait for the menu to close before adding/removing classes that affect styles.
  15350. this.closeAnimationEndTimerId_ = setTimeout(function () {
  15351. var selectionGroup = _this2.getSelectionGroup_(listItem);
  15352. if (selectionGroup !== null) {
  15353. _this2.handleSelectionGroup_( /** @type {!HTMLElement} */selectionGroup, index);
  15354. }
  15355. }, __WEBPACK_IMPORTED_MODULE_3__material_menu_surface_foundation__["b" /* MDCMenuSurfaceFoundation */].numbers.TRANSITION_CLOSE_DURATION);
  15356. }
  15357. /**
  15358. * Handles toggling the selected classes in a selection group when a
  15359. * selection is made.
  15360. * @param {!HTMLElement} selectionGroup
  15361. * @param {number} index The selected index value
  15362. * @private
  15363. */
  15364. }, {
  15365. key: 'handleSelectionGroup_',
  15366. value: function handleSelectionGroup_(selectionGroup, index) {
  15367. // De-select the previous selection in this group.
  15368. var selectedIndex = this.adapter_.getSelectedElementIndex(selectionGroup);
  15369. if (selectedIndex >= 0) {
  15370. this.adapter_.removeAttributeFromElementAtIndex(selectedIndex, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_SELECTED_ATTR);
  15371. this.adapter_.removeClassFromElementAtIndex(selectedIndex, __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].MENU_SELECTED_LIST_ITEM);
  15372. }
  15373. // Select the new list item in this group.
  15374. this.adapter_.addClassToElementAtIndex(index, __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].MENU_SELECTED_LIST_ITEM);
  15375. this.adapter_.addAttributeToElementAtIndex(index, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_SELECTED_ATTR, 'true');
  15376. }
  15377. /**
  15378. * Returns the parent selection group of an element if one exists.
  15379. * @param listItem
  15380. * @return {?HTMLElement} parent selection group element or null.
  15381. * @private
  15382. */
  15383. }, {
  15384. key: 'getSelectionGroup_',
  15385. value: function getSelectionGroup_(listItem) {
  15386. var parent = this.adapter_.getParentElement(listItem);
  15387. var isGroup = this.adapter_.elementContainsClass(parent, __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].MENU_SELECTION_GROUP);
  15388. // Iterate through ancestors until we find the group or get to the list.
  15389. while (!isGroup && !this.adapter_.elementContainsClass(parent, __WEBPACK_IMPORTED_MODULE_4__material_list_foundation__["a" /* default */].cssClasses.ROOT)) {
  15390. parent = this.adapter_.getParentElement(parent);
  15391. isGroup = this.adapter_.elementContainsClass(parent, __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].MENU_SELECTION_GROUP);
  15392. }
  15393. if (isGroup) {
  15394. return parent;
  15395. } else {
  15396. return null;
  15397. }
  15398. }
  15399. /**
  15400. * Find the first ancestor with the mdc-list-item class.
  15401. * @param {?HTMLElement} target
  15402. * @return {?HTMLElement}
  15403. * @private
  15404. */
  15405. }, {
  15406. key: 'getListItem_',
  15407. value: function getListItem_(target) {
  15408. var isListItem = this.adapter_.elementContainsClass(target, __WEBPACK_IMPORTED_MODULE_4__material_list_foundation__["a" /* default */].cssClasses.LIST_ITEM_CLASS);
  15409. while (!isListItem) {
  15410. target = this.adapter_.getParentElement(target);
  15411. if (target) {
  15412. isListItem = this.adapter_.elementContainsClass(target, __WEBPACK_IMPORTED_MODULE_4__material_list_foundation__["a" /* default */].cssClasses.LIST_ITEM_CLASS);
  15413. } else {
  15414. // target has no parent element.
  15415. return null;
  15416. }
  15417. }
  15418. return target;
  15419. }
  15420. }]);
  15421. return MDCMenuFoundation;
  15422. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  15423. /***/ }),
  15424. /* 114 */
  15425. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15426. "use strict";
  15427. /* unused harmony export MDCMenuAdapter */
  15428. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  15429. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15430. /**
  15431. * @license
  15432. * Copyright 2018 Google Inc.
  15433. *
  15434. * Permission is hereby granted, free of charge, to any person obtaining a copy
  15435. * of this software and associated documentation files (the "Software"), to deal
  15436. * in the Software without restriction, including without limitation the rights
  15437. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  15438. * copies of the Software, and to permit persons to whom the Software is
  15439. * furnished to do so, subject to the following conditions:
  15440. *
  15441. * The above copyright notice and this permission notice shall be included in
  15442. * all copies or substantial portions of the Software.
  15443. *
  15444. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15445. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15446. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  15447. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  15448. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  15449. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  15450. * THE SOFTWARE.
  15451. */
  15452. /* eslint no-unused-vars: [2, {"args": "none"}] */
  15453. /**
  15454. * Adapter for MDC Menu. Provides an interface for managing
  15455. * - selected element classes
  15456. * - get focused elements
  15457. * - toggling a checkbox inside a list item
  15458. *
  15459. * Additionally, provides type information for the adapter to the Closure
  15460. * compiler.
  15461. *
  15462. * Implement this adapter for your framework of choice to delegate updates to
  15463. * the component in your framework of choice. See architecture documentation
  15464. * for more details.
  15465. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  15466. *
  15467. * @record
  15468. */
  15469. var MDCMenuAdapter = function () {
  15470. function MDCMenuAdapter() {
  15471. _classCallCheck(this, MDCMenuAdapter);
  15472. }
  15473. _createClass(MDCMenuAdapter, [{
  15474. key: "addClassToElementAtIndex",
  15475. /**
  15476. * Adds a class to the element at the index provided.
  15477. * @param {number} index
  15478. * @param {string} className
  15479. */
  15480. value: function addClassToElementAtIndex(index, className) {}
  15481. /**
  15482. * Removes a class from the element at the index provided
  15483. * @param {number} index
  15484. * @param {string} className
  15485. */
  15486. }, {
  15487. key: "removeClassFromElementAtIndex",
  15488. value: function removeClassFromElementAtIndex(index, className) {}
  15489. /**
  15490. * Adds an attribute, with value, to the element at the index provided.
  15491. * @param {number} index
  15492. * @param {string} attr
  15493. * @param {string} value
  15494. */
  15495. }, {
  15496. key: "addAttributeToElementAtIndex",
  15497. value: function addAttributeToElementAtIndex(index, attr, value) {}
  15498. /**
  15499. * Removes an attribute from an element at the index provided.
  15500. * @param {number} index
  15501. * @param {string} attr
  15502. */
  15503. }, {
  15504. key: "removeAttributeFromElementAtIndex",
  15505. value: function removeAttributeFromElementAtIndex(index, attr) {}
  15506. /**
  15507. * Returns true if the element contains the className.
  15508. * @param {?HTMLElement} element
  15509. * @param {string} className
  15510. * @return {boolean} true if the element contains the className
  15511. */
  15512. }, {
  15513. key: "elementContainsClass",
  15514. value: function elementContainsClass(element, className) {}
  15515. /**
  15516. * Closes the menu-surface.
  15517. */
  15518. }, {
  15519. key: "closeSurface",
  15520. value: function closeSurface() {}
  15521. /**
  15522. * Returns the index for the element provided.
  15523. * @param {?HTMLElement} element
  15524. * @return {number} index of the element in the list or -1 if it is not in the list.
  15525. */
  15526. }, {
  15527. key: "getElementIndex",
  15528. value: function getElementIndex(element) {}
  15529. /**
  15530. * Returns the parentElement of the provided element.
  15531. * @param {?HTMLElement} element
  15532. * @return {?HTMLElement} parentElement of the element provided.
  15533. */
  15534. }, {
  15535. key: "getParentElement",
  15536. value: function getParentElement(element) {}
  15537. /**
  15538. * Returns the element within the selectionGroup containing the selected element class.
  15539. * @param {!HTMLElement} selectionGroup
  15540. * @return {number} element within the selectionGroup that contains the selected element class.
  15541. */
  15542. }, {
  15543. key: "getSelectedElementIndex",
  15544. value: function getSelectedElementIndex(selectionGroup) {}
  15545. /**
  15546. * Emits an event using the evtData.
  15547. * @param {{
  15548. * index: number
  15549. * }} evtData
  15550. */
  15551. }, {
  15552. key: "notifySelected",
  15553. value: function notifySelected(evtData) {}
  15554. }]);
  15555. return MDCMenuAdapter;
  15556. }();
  15557. /***/ }),
  15558. /* 115 */
  15559. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15560. "use strict";
  15561. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  15562. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTransformPropertyName", function() { return getTransformPropertyName; });
  15563. /**
  15564. * @license
  15565. * Copyright 2018 Google Inc.
  15566. *
  15567. * Permission is hereby granted, free of charge, to any person obtaining a copy
  15568. * of this software and associated documentation files (the "Software"), to deal
  15569. * in the Software without restriction, including without limitation the rights
  15570. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  15571. * copies of the Software, and to permit persons to whom the Software is
  15572. * furnished to do so, subject to the following conditions:
  15573. *
  15574. * The above copyright notice and this permission notice shall be included in
  15575. * all copies or substantial portions of the Software.
  15576. *
  15577. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15578. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15579. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  15580. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  15581. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  15582. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  15583. * THE SOFTWARE.
  15584. */
  15585. /** @type {string|undefined} */
  15586. var storedTransformPropertyName_ = void 0;
  15587. /**
  15588. * Returns the name of the correct transform property to use on the current browser.
  15589. * @param {!Window} globalObj
  15590. * @param {boolean=} forceRefresh
  15591. * @return {string}
  15592. */
  15593. function getTransformPropertyName(globalObj) {
  15594. var forceRefresh = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  15595. if (storedTransformPropertyName_ === undefined || forceRefresh) {
  15596. var el = globalObj.document.createElement('div');
  15597. var transformPropertyName = 'transform' in el.style ? 'transform' : 'webkitTransform';
  15598. storedTransformPropertyName_ = transformPropertyName;
  15599. }
  15600. return storedTransformPropertyName_;
  15601. }
  15602. /***/ }),
  15603. /* 116 */
  15604. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15605. "use strict";
  15606. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  15607. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(46);
  15608. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(47);
  15609. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  15610. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  15611. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15612. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  15613. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  15614. /**
  15615. * @license
  15616. * Copyright 2017 Google Inc.
  15617. *
  15618. * Permission is hereby granted, free of charge, to any person obtaining a copy
  15619. * of this software and associated documentation files (the "Software"), to deal
  15620. * in the Software without restriction, including without limitation the rights
  15621. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  15622. * copies of the Software, and to permit persons to whom the Software is
  15623. * furnished to do so, subject to the following conditions:
  15624. *
  15625. * The above copyright notice and this permission notice shall be included in
  15626. * all copies or substantial portions of the Software.
  15627. *
  15628. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15629. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15630. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  15631. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  15632. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  15633. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  15634. * THE SOFTWARE.
  15635. */
  15636. /**
  15637. * @extends {MDCFoundation<!MDCNotchedOutlineAdapter>}
  15638. * @final
  15639. */
  15640. var MDCNotchedOutlineFoundation = function (_MDCFoundation) {
  15641. _inherits(MDCNotchedOutlineFoundation, _MDCFoundation);
  15642. _createClass(MDCNotchedOutlineFoundation, null, [{
  15643. key: 'strings',
  15644. /** @return enum {string} */
  15645. get: function get() {
  15646. return __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */];
  15647. }
  15648. /** @return enum {string} */
  15649. }, {
  15650. key: 'cssClasses',
  15651. get: function get() {
  15652. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  15653. }
  15654. /** @return enum {number} */
  15655. }, {
  15656. key: 'numbers',
  15657. get: function get() {
  15658. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */];
  15659. }
  15660. /**
  15661. * {@see MDCNotchedOutlineAdapter} for typing information on parameters and return
  15662. * types.
  15663. * @return {!MDCNotchedOutlineAdapter}
  15664. */
  15665. }, {
  15666. key: 'defaultAdapter',
  15667. get: function get() {
  15668. return (/** @type {!MDCNotchedOutlineAdapter} */{
  15669. addClass: function addClass() {},
  15670. removeClass: function removeClass() {},
  15671. setNotchWidthProperty: function setNotchWidthProperty() {},
  15672. removeNotchWidthProperty: function removeNotchWidthProperty() {}
  15673. }
  15674. );
  15675. }
  15676. /**
  15677. * @param {!MDCNotchedOutlineAdapter} adapter
  15678. */
  15679. }]);
  15680. function MDCNotchedOutlineFoundation(adapter) {
  15681. _classCallCheck(this, MDCNotchedOutlineFoundation);
  15682. return _possibleConstructorReturn(this, (MDCNotchedOutlineFoundation.__proto__ || Object.getPrototypeOf(MDCNotchedOutlineFoundation)).call(this, _extends(MDCNotchedOutlineFoundation.defaultAdapter, adapter)));
  15683. }
  15684. /**
  15685. * Adds the outline notched selector and updates the notch width
  15686. * calculated based off of notchWidth.
  15687. * @param {number} notchWidth
  15688. */
  15689. _createClass(MDCNotchedOutlineFoundation, [{
  15690. key: 'notch',
  15691. value: function notch(notchWidth) {
  15692. var OUTLINE_NOTCHED = MDCNotchedOutlineFoundation.cssClasses.OUTLINE_NOTCHED;
  15693. if (notchWidth > 0) {
  15694. notchWidth += __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].NOTCH_ELEMENT_PADDING; // Add padding from left/right.
  15695. }
  15696. this.adapter_.setNotchWidthProperty(notchWidth);
  15697. this.adapter_.addClass(OUTLINE_NOTCHED);
  15698. }
  15699. /**
  15700. * Removes notched outline selector to close the notch in the outline.
  15701. */
  15702. }, {
  15703. key: 'closeNotch',
  15704. value: function closeNotch() {
  15705. var OUTLINE_NOTCHED = MDCNotchedOutlineFoundation.cssClasses.OUTLINE_NOTCHED;
  15706. this.adapter_.removeClass(OUTLINE_NOTCHED);
  15707. this.adapter_.removeNotchWidthProperty();
  15708. }
  15709. }]);
  15710. return MDCNotchedOutlineFoundation;
  15711. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  15712. /* harmony default export */ __webpack_exports__["a"] = (MDCNotchedOutlineFoundation);
  15713. /***/ }),
  15714. /* 117 */
  15715. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15716. "use strict";
  15717. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  15718. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCRadio", function() { return MDCRadio; });
  15719. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  15720. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_selection_control_index__ = __webpack_require__(3);
  15721. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(118);
  15722. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_ripple_index__ = __webpack_require__(2);
  15723. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCRadioFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  15724. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  15725. var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
  15726. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  15727. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15728. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  15729. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  15730. /**
  15731. * @license
  15732. * Copyright 2016 Google Inc.
  15733. *
  15734. * Permission is hereby granted, free of charge, to any person obtaining a copy
  15735. * of this software and associated documentation files (the "Software"), to deal
  15736. * in the Software without restriction, including without limitation the rights
  15737. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  15738. * copies of the Software, and to permit persons to whom the Software is
  15739. * furnished to do so, subject to the following conditions:
  15740. *
  15741. * The above copyright notice and this permission notice shall be included in
  15742. * all copies or substantial portions of the Software.
  15743. *
  15744. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15745. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15746. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  15747. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  15748. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  15749. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  15750. * THE SOFTWARE.
  15751. */
  15752. /* eslint-disable no-unused-vars */
  15753. /* eslint-enable no-unused-vars */
  15754. /**
  15755. * @extends MDCComponent<!MDCRadioFoundation>
  15756. * @implements {MDCSelectionControl}
  15757. */
  15758. var MDCRadio = function (_MDCComponent) {
  15759. _inherits(MDCRadio, _MDCComponent);
  15760. _createClass(MDCRadio, [{
  15761. key: 'checked',
  15762. /** @return {boolean} */
  15763. get: function get() {
  15764. return this.nativeControl_.checked;
  15765. }
  15766. /** @param {boolean} checked */
  15767. ,
  15768. set: function set(checked) {
  15769. this.nativeControl_.checked = checked;
  15770. }
  15771. /** @return {boolean} */
  15772. }, {
  15773. key: 'disabled',
  15774. get: function get() {
  15775. return this.nativeControl_.disabled;
  15776. }
  15777. /** @param {boolean} disabled */
  15778. ,
  15779. set: function set(disabled) {
  15780. this.foundation_.setDisabled(disabled);
  15781. }
  15782. /** @return {?string} */
  15783. }, {
  15784. key: 'value',
  15785. get: function get() {
  15786. return this.nativeControl_.value;
  15787. }
  15788. /** @param {?string} value */
  15789. ,
  15790. set: function set(value) {
  15791. this.nativeControl_.value = value;
  15792. }
  15793. /** @return {!MDCRipple} */
  15794. }, {
  15795. key: 'ripple',
  15796. get: function get() {
  15797. return this.ripple_;
  15798. }
  15799. }], [{
  15800. key: 'attachTo',
  15801. value: function attachTo(root) {
  15802. return new MDCRadio(root);
  15803. }
  15804. }]);
  15805. function MDCRadio() {
  15806. var _ref;
  15807. _classCallCheck(this, MDCRadio);
  15808. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  15809. args[_key] = arguments[_key];
  15810. }
  15811. /** @private {!MDCRipple} */
  15812. var _this = _possibleConstructorReturn(this, (_ref = MDCRadio.__proto__ || Object.getPrototypeOf(MDCRadio)).call.apply(_ref, [this].concat(args)));
  15813. _this.ripple_ = _this.initRipple_();
  15814. return _this;
  15815. }
  15816. /**
  15817. * @return {!MDCRipple}
  15818. * @private
  15819. */
  15820. _createClass(MDCRadio, [{
  15821. key: 'initRipple_',
  15822. value: function initRipple_() {
  15823. var _this2 = this;
  15824. var adapter = _extends(__WEBPACK_IMPORTED_MODULE_3__material_ripple_index__["MDCRipple"].createAdapter(this), {
  15825. isUnbounded: function isUnbounded() {
  15826. return true;
  15827. },
  15828. // Radio buttons technically go "active" whenever there is *any* keyboard interaction. This is not the
  15829. // UI we desire.
  15830. isSurfaceActive: function isSurfaceActive() {
  15831. return false;
  15832. },
  15833. registerInteractionHandler: function registerInteractionHandler(type, handler) {
  15834. return _this2.nativeControl_.addEventListener(type, handler);
  15835. },
  15836. deregisterInteractionHandler: function deregisterInteractionHandler(type, handler) {
  15837. return _this2.nativeControl_.removeEventListener(type, handler);
  15838. }
  15839. });
  15840. var foundation = new __WEBPACK_IMPORTED_MODULE_3__material_ripple_index__["MDCRippleFoundation"](adapter);
  15841. return new __WEBPACK_IMPORTED_MODULE_3__material_ripple_index__["MDCRipple"](this.root_, foundation);
  15842. }
  15843. /**
  15844. * Returns the state of the native control element, or null if the native control element is not present.
  15845. * @return {?MDCSelectionControlState}
  15846. * @private
  15847. */
  15848. }, {
  15849. key: 'destroy',
  15850. value: function destroy() {
  15851. this.ripple_.destroy();
  15852. _get(MDCRadio.prototype.__proto__ || Object.getPrototypeOf(MDCRadio.prototype), 'destroy', this).call(this);
  15853. }
  15854. /** @return {!MDCRadioFoundation} */
  15855. }, {
  15856. key: 'getDefaultFoundation',
  15857. value: function getDefaultFoundation() {
  15858. var _this3 = this;
  15859. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]({
  15860. addClass: function addClass(className) {
  15861. return _this3.root_.classList.add(className);
  15862. },
  15863. removeClass: function removeClass(className) {
  15864. return _this3.root_.classList.remove(className);
  15865. },
  15866. setNativeControlDisabled: function setNativeControlDisabled(disabled) {
  15867. return _this3.nativeControl_.disabled = disabled;
  15868. }
  15869. });
  15870. }
  15871. }, {
  15872. key: 'nativeControl_',
  15873. get: function get() {
  15874. var NATIVE_CONTROL_SELECTOR = __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.NATIVE_CONTROL_SELECTOR;
  15875. var el = /** @type {?MDCSelectionControlState} */this.root_.querySelector(NATIVE_CONTROL_SELECTOR);
  15876. return el;
  15877. }
  15878. }]);
  15879. return MDCRadio;
  15880. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  15881. /***/ }),
  15882. /* 118 */
  15883. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15884. "use strict";
  15885. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  15886. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_selection_control_index__ = __webpack_require__(3);
  15887. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__adapter__ = __webpack_require__(119);
  15888. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__constants__ = __webpack_require__(120);
  15889. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  15890. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15891. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  15892. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  15893. /**
  15894. * @license
  15895. * Copyright 2016 Google Inc.
  15896. *
  15897. * Permission is hereby granted, free of charge, to any person obtaining a copy
  15898. * of this software and associated documentation files (the "Software"), to deal
  15899. * in the Software without restriction, including without limitation the rights
  15900. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  15901. * copies of the Software, and to permit persons to whom the Software is
  15902. * furnished to do so, subject to the following conditions:
  15903. *
  15904. * The above copyright notice and this permission notice shall be included in
  15905. * all copies or substantial portions of the Software.
  15906. *
  15907. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15908. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15909. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  15910. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  15911. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  15912. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  15913. * THE SOFTWARE.
  15914. */
  15915. /* eslint-disable no-unused-vars */
  15916. /* eslint-enable no-unused-vars */
  15917. /**
  15918. * @extends {MDCFoundation<!MDCRadioAdapter>}
  15919. */
  15920. var MDCRadioFoundation = function (_MDCFoundation) {
  15921. _inherits(MDCRadioFoundation, _MDCFoundation);
  15922. function MDCRadioFoundation() {
  15923. _classCallCheck(this, MDCRadioFoundation);
  15924. return _possibleConstructorReturn(this, (MDCRadioFoundation.__proto__ || Object.getPrototypeOf(MDCRadioFoundation)).apply(this, arguments));
  15925. }
  15926. _createClass(MDCRadioFoundation, [{
  15927. key: 'setDisabled',
  15928. /** @param {boolean} disabled */
  15929. value: function setDisabled(disabled) {
  15930. var DISABLED = MDCRadioFoundation.cssClasses.DISABLED;
  15931. this.adapter_.setNativeControlDisabled(disabled);
  15932. if (disabled) {
  15933. this.adapter_.addClass(DISABLED);
  15934. } else {
  15935. this.adapter_.removeClass(DISABLED);
  15936. }
  15937. }
  15938. }], [{
  15939. key: 'cssClasses',
  15940. /** @return enum {cssClasses} */
  15941. get: function get() {
  15942. return __WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */];
  15943. }
  15944. /** @return enum {strings} */
  15945. }, {
  15946. key: 'strings',
  15947. get: function get() {
  15948. return __WEBPACK_IMPORTED_MODULE_3__constants__["b" /* strings */];
  15949. }
  15950. /** @return {!MDCRadioAdapter} */
  15951. }, {
  15952. key: 'defaultAdapter',
  15953. get: function get() {
  15954. return (/** @type {!MDCRadioAdapter} */{
  15955. addClass: function addClass() /* className: string */{},
  15956. removeClass: function removeClass() /* className: string */{},
  15957. setNativeControlDisabled: function setNativeControlDisabled() /* disabled: boolean */{}
  15958. }
  15959. );
  15960. }
  15961. }]);
  15962. return MDCRadioFoundation;
  15963. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  15964. /* harmony default export */ __webpack_exports__["a"] = (MDCRadioFoundation);
  15965. /***/ }),
  15966. /* 119 */
  15967. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15968. "use strict";
  15969. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_selection_control_index__ = __webpack_require__(3);
  15970. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  15971. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15972. /**
  15973. * @license
  15974. * Copyright 2016 Google Inc.
  15975. *
  15976. * Permission is hereby granted, free of charge, to any person obtaining a copy
  15977. * of this software and associated documentation files (the "Software"), to deal
  15978. * in the Software without restriction, including without limitation the rights
  15979. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  15980. * copies of the Software, and to permit persons to whom the Software is
  15981. * furnished to do so, subject to the following conditions:
  15982. *
  15983. * The above copyright notice and this permission notice shall be included in
  15984. * all copies or substantial portions of the Software.
  15985. *
  15986. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15987. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15988. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  15989. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  15990. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  15991. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  15992. * THE SOFTWARE.
  15993. */
  15994. /* eslint-disable no-unused-vars */
  15995. /* eslint no-unused-vars: [2, {"args": "none"}] */
  15996. /**
  15997. * Adapter for MDC Radio. Provides an interface for managing
  15998. * - classes
  15999. * - dom
  16000. *
  16001. * Additionally, provides type information for the adapter to the Closure
  16002. * compiler.
  16003. *
  16004. * Implement this adapter for your framework of choice to delegate updates to
  16005. * the component in your framework of choice. See architecture documentation
  16006. * for more details.
  16007. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  16008. *
  16009. * @record
  16010. */
  16011. var MDCRadioAdapter = function () {
  16012. function MDCRadioAdapter() {
  16013. _classCallCheck(this, MDCRadioAdapter);
  16014. }
  16015. _createClass(MDCRadioAdapter, [{
  16016. key: 'addClass',
  16017. /** @param {string} className */
  16018. value: function addClass(className) {}
  16019. /** @param {string} className */
  16020. }, {
  16021. key: 'removeClass',
  16022. value: function removeClass(className) {}
  16023. /** @param {boolean} disabled */
  16024. }, {
  16025. key: 'setNativeControlDisabled',
  16026. value: function setNativeControlDisabled(disabled) {}
  16027. }]);
  16028. return MDCRadioAdapter;
  16029. }();
  16030. /* unused harmony default export */ var _unused_webpack_default_export = (MDCRadioAdapter);
  16031. /***/ }),
  16032. /* 120 */
  16033. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16034. "use strict";
  16035. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  16036. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  16037. /**
  16038. * @license
  16039. * Copyright 2016 Google Inc.
  16040. *
  16041. * Permission is hereby granted, free of charge, to any person obtaining a copy
  16042. * of this software and associated documentation files (the "Software"), to deal
  16043. * in the Software without restriction, including without limitation the rights
  16044. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  16045. * copies of the Software, and to permit persons to whom the Software is
  16046. * furnished to do so, subject to the following conditions:
  16047. *
  16048. * The above copyright notice and this permission notice shall be included in
  16049. * all copies or substantial portions of the Software.
  16050. *
  16051. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16052. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16053. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  16054. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  16055. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  16056. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  16057. * THE SOFTWARE.
  16058. */
  16059. /** @enum {string} */
  16060. var strings = {
  16061. NATIVE_CONTROL_SELECTOR: '.mdc-radio__native-control'
  16062. };
  16063. /** @enum {string} */
  16064. var cssClasses = {
  16065. ROOT: 'mdc-radio',
  16066. DISABLED: 'mdc-radio--disabled'
  16067. };
  16068. /***/ }),
  16069. /* 121 */
  16070. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16071. "use strict";
  16072. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  16073. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSelect", function() { return MDCSelect; });
  16074. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  16075. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_floating_label_index__ = __webpack_require__(9);
  16076. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_line_ripple_index__ = __webpack_require__(16);
  16077. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_menu_index__ = __webpack_require__(43);
  16078. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__material_ripple_index__ = __webpack_require__(2);
  16079. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__material_notched_outline_index__ = __webpack_require__(20);
  16080. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__foundation__ = __webpack_require__(122);
  16081. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__constants__ = __webpack_require__(51);
  16082. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__adapter__ = __webpack_require__(48);
  16083. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__icon_index__ = __webpack_require__(21);
  16084. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__helper_text_index__ = __webpack_require__(22);
  16085. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__material_menu_surface_constants__ = __webpack_require__(19);
  16086. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__material_menu_constants__ = __webpack_require__(17);
  16087. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSelectFoundation", function() { return __WEBPACK_IMPORTED_MODULE_6__foundation__["a"]; });
  16088. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSelectHelperText", function() { return __WEBPACK_IMPORTED_MODULE_10__helper_text_index__["a"]; });
  16089. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSelectHelperTextFoundation", function() { return __WEBPACK_IMPORTED_MODULE_10__helper_text_index__["b"]; });
  16090. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSelectIcon", function() { return __WEBPACK_IMPORTED_MODULE_9__icon_index__["a"]; });
  16091. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSelectIconFoundation", function() { return __WEBPACK_IMPORTED_MODULE_9__icon_index__["b"]; });
  16092. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  16093. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  16094. var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
  16095. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  16096. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  16097. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  16098. /**
  16099. * @license
  16100. * Copyright 2016 Google Inc.
  16101. *
  16102. * Permission is hereby granted, free of charge, to any person obtaining a copy
  16103. * of this software and associated documentation files (the "Software"), to deal
  16104. * in the Software without restriction, including without limitation the rights
  16105. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  16106. * copies of the Software, and to permit persons to whom the Software is
  16107. * furnished to do so, subject to the following conditions:
  16108. *
  16109. * The above copyright notice and this permission notice shall be included in
  16110. * all copies or substantial portions of the Software.
  16111. *
  16112. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16113. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16114. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  16115. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  16116. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  16117. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  16118. * THE SOFTWARE.
  16119. */
  16120. /* eslint-disable no-unused-vars */
  16121. /* eslint-enable no-unused-vars */
  16122. // Closure has issues with {this as that} syntax.
  16123. var VALIDATION_ATTR_WHITELIST = ['required', 'aria-required'];
  16124. /**
  16125. * @extends MDCComponent<!MDCSelectFoundation>
  16126. */
  16127. var MDCSelect = function (_MDCComponent) {
  16128. _inherits(MDCSelect, _MDCComponent);
  16129. /**
  16130. * @param {...?} args
  16131. */
  16132. function MDCSelect() {
  16133. var _ref;
  16134. _classCallCheck(this, MDCSelect);
  16135. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  16136. args[_key] = arguments[_key];
  16137. }
  16138. /** @private {?Element} */
  16139. var _this = _possibleConstructorReturn(this, (_ref = MDCSelect.__proto__ || Object.getPrototypeOf(MDCSelect)).call.apply(_ref, [this].concat(args)));
  16140. _this.nativeControl_;
  16141. /** @private {?Element} */
  16142. _this.selectedText_;
  16143. /** @private {?Element} */
  16144. _this.hiddenInput_;
  16145. /** @private {?MDCSelectIcon} */
  16146. _this.leadingIcon_;
  16147. /** @private {?MDCSelectHelperText} */
  16148. _this.helperText_;
  16149. /** @private {?Element} */
  16150. _this.menuElement_;
  16151. /** @type {?MDCMenu} */
  16152. _this.menu_;
  16153. /** @type {?MDCRipple} */
  16154. _this.ripple;
  16155. /** @private {?MDCLineRipple} */
  16156. _this.lineRipple_;
  16157. /** @private {?MDCFloatingLabel} */
  16158. _this.label_;
  16159. /** @private {?MDCNotchedOutline} */
  16160. _this.outline_;
  16161. /** @private {!Function} */
  16162. _this.handleChange_;
  16163. /** @private {!Function} */
  16164. _this.handleFocus_;
  16165. /** @private {!Function} */
  16166. _this.handleBlur_;
  16167. /** @private {!Function} */
  16168. _this.handleClick_;
  16169. /** @private {!Function} */
  16170. _this.handleKeydown_;
  16171. /** @private {!Function} */
  16172. _this.handleMenuOpened_;
  16173. /** @private {!Function} */
  16174. _this.handleMenuClosed_;
  16175. /** @private {!Function} */
  16176. _this.handleMenuSelected_;
  16177. /** @private {boolean} */
  16178. _this.menuOpened_ = false;
  16179. /** @private {!MutationObserver} */
  16180. _this.validationObserver_;
  16181. return _this;
  16182. }
  16183. /**
  16184. * @param {!Element} root
  16185. * @return {!MDCSelect}
  16186. */
  16187. _createClass(MDCSelect, [{
  16188. key: 'layout',
  16189. /**
  16190. * Recomputes the outline SVG path for the outline element.
  16191. */
  16192. value: function layout() {
  16193. this.foundation_.layout();
  16194. }
  16195. /**
  16196. * @param {(function(!Element): !MDCLineRipple)=} lineRippleFactory A function which creates a new MDCLineRipple.
  16197. * @param {(function(!Element): !MDCFloatingLabel)=} labelFactory A function which creates a new MDCFloatingLabel.
  16198. * @param {(function(!Element): !MDCNotchedOutline)=} outlineFactory A function which creates a new MDCNotchedOutline.
  16199. * @param {(function(!Element): !MDCMenu)=} menuFactory A function which creates a new MDCMenu.
  16200. * @param {(function(!Element): !MDCSelectIcon)=} iconFactory A function which creates a new MDCSelectIcon.
  16201. * @param {(function(!Element): !MDCSelectHelperText)=} helperTextFactory A function which creates a new
  16202. * MDCSelectHelperText.
  16203. */
  16204. }, {
  16205. key: 'initialize',
  16206. value: function initialize() {
  16207. var labelFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (el) {
  16208. return new __WEBPACK_IMPORTED_MODULE_1__material_floating_label_index__["MDCFloatingLabel"](el);
  16209. };
  16210. var lineRippleFactory = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (el) {
  16211. return new __WEBPACK_IMPORTED_MODULE_2__material_line_ripple_index__["MDCLineRipple"](el);
  16212. };
  16213. var outlineFactory = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function (el) {
  16214. return new __WEBPACK_IMPORTED_MODULE_5__material_notched_outline_index__["MDCNotchedOutline"](el);
  16215. };
  16216. var menuFactory = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : function (el) {
  16217. return new __WEBPACK_IMPORTED_MODULE_3__material_menu_index__["MDCMenu"](el);
  16218. };
  16219. var iconFactory = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : function (el) {
  16220. return new __WEBPACK_IMPORTED_MODULE_9__icon_index__["a" /* MDCSelectIcon */](el);
  16221. };
  16222. var helperTextFactory = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : function (el) {
  16223. return new __WEBPACK_IMPORTED_MODULE_10__helper_text_index__["a" /* MDCSelectHelperText */](el);
  16224. };
  16225. this.nativeControl_ = /** @type {HTMLElement} */this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].NATIVE_CONTROL_SELECTOR);
  16226. this.selectedText_ = /** @type {HTMLElement} */this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].SELECTED_TEXT_SELECTOR);
  16227. if (this.selectedText_) {
  16228. this.enhancedSelectSetup_(menuFactory);
  16229. }
  16230. var labelElement = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].LABEL_SELECTOR);
  16231. if (labelElement) {
  16232. this.label_ = labelFactory(labelElement);
  16233. }
  16234. var lineRippleElement = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].LINE_RIPPLE_SELECTOR);
  16235. if (lineRippleElement) {
  16236. this.lineRipple_ = lineRippleFactory(lineRippleElement);
  16237. }
  16238. var outlineElement = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].OUTLINE_SELECTOR);
  16239. if (outlineElement) {
  16240. this.outline_ = outlineFactory(outlineElement);
  16241. }
  16242. var leadingIcon = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].LEADING_ICON_SELECTOR);
  16243. if (leadingIcon) {
  16244. this.root_.classList.add(__WEBPACK_IMPORTED_MODULE_7__constants__["a" /* cssClasses */].WITH_LEADING_ICON);
  16245. this.leadingIcon_ = iconFactory(leadingIcon);
  16246. if (this.menuElement_) {
  16247. this.menuElement_.classList.add(__WEBPACK_IMPORTED_MODULE_7__constants__["a" /* cssClasses */].WITH_LEADING_ICON);
  16248. }
  16249. }
  16250. var element = this.nativeControl_ ? this.nativeControl_ : this.selectedText_;
  16251. if (element.hasAttribute(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].ARIA_CONTROLS)) {
  16252. var helperTextElement = document.getElementById(element.getAttribute(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].ARIA_CONTROLS));
  16253. if (helperTextElement) {
  16254. this.helperText_ = helperTextFactory(helperTextElement);
  16255. }
  16256. }
  16257. if (!this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_7__constants__["a" /* cssClasses */].OUTLINED)) {
  16258. this.ripple = this.initRipple_();
  16259. }
  16260. // The required state needs to be sync'd before the mutation observer is added.
  16261. this.initialSyncRequiredState_();
  16262. this.addMutationObserverForRequired_();
  16263. }
  16264. /**
  16265. * Handles setup for the enhanced menu.
  16266. * @private
  16267. */
  16268. }, {
  16269. key: 'enhancedSelectSetup_',
  16270. value: function enhancedSelectSetup_(menuFactory) {
  16271. var isDisabled = this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_7__constants__["a" /* cssClasses */].DISABLED);
  16272. this.selectedText_.setAttribute('tabindex', isDisabled ? '-1' : '0');
  16273. this.hiddenInput_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].HIDDEN_INPUT_SELECTOR);
  16274. this.menuElement_ = /** @type {HTMLElement} */this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].MENU_SELECTOR);
  16275. this.menu_ = menuFactory(this.menuElement_);
  16276. this.menu_.hoistMenuToBody();
  16277. this.menu_.setAnchorElement( /** @type {!HTMLElement} */this.root_);
  16278. this.menu_.setAnchorCorner(__WEBPACK_IMPORTED_MODULE_11__material_menu_surface_constants__["a" /* Corner */].BOTTOM_START);
  16279. this.menu_.wrapFocus = false;
  16280. }
  16281. /**
  16282. * @private
  16283. * @return {!MDCRipple}
  16284. */
  16285. }, {
  16286. key: 'initRipple_',
  16287. value: function initRipple_() {
  16288. var element = this.nativeControl_ ? this.nativeControl_ : this.selectedText_;
  16289. var adapter = _extends(__WEBPACK_IMPORTED_MODULE_4__material_ripple_index__["MDCRipple"].createAdapter(this), {
  16290. registerInteractionHandler: function registerInteractionHandler(type, handler) {
  16291. return element.addEventListener(type, handler);
  16292. },
  16293. deregisterInteractionHandler: function deregisterInteractionHandler(type, handler) {
  16294. return element.removeEventListener(type, handler);
  16295. }
  16296. });
  16297. var foundation = new __WEBPACK_IMPORTED_MODULE_4__material_ripple_index__["MDCRippleFoundation"](adapter);
  16298. return new __WEBPACK_IMPORTED_MODULE_4__material_ripple_index__["MDCRipple"](this.root_, foundation);
  16299. }
  16300. /**
  16301. * Initializes the select's event listeners and internal state based
  16302. * on the environment's state.
  16303. */
  16304. }, {
  16305. key: 'initialSyncWithDOM',
  16306. value: function initialSyncWithDOM() {
  16307. var _this2 = this;
  16308. this.handleChange_ = function () {
  16309. return _this2.foundation_.handleChange( /* didChange */true);
  16310. };
  16311. this.handleFocus_ = function () {
  16312. return _this2.foundation_.handleFocus();
  16313. };
  16314. this.handleBlur_ = function () {
  16315. return _this2.foundation_.handleBlur();
  16316. };
  16317. this.handleClick_ = function (evt) {
  16318. if (_this2.selectedText_) _this2.selectedText_.focus();
  16319. _this2.foundation_.handleClick(_this2.getNormalizedXCoordinate_(evt));
  16320. };
  16321. this.handleKeydown_ = function (evt) {
  16322. return _this2.foundation_.handleKeydown(evt);
  16323. };
  16324. this.handleMenuSelected_ = function (evtData) {
  16325. return _this2.selectedIndex = evtData.detail.index;
  16326. };
  16327. this.handleMenuOpened_ = function () {
  16328. // Menu should open to the last selected element.
  16329. if (_this2.selectedIndex >= 0) {
  16330. _this2.menu_.items[_this2.selectedIndex].focus();
  16331. }
  16332. };
  16333. this.handleMenuClosed_ = function () {
  16334. // menuOpened_ is used to track the state of the menu opening or closing since the menu.open function
  16335. // will return false if the menu is still closing and this method listens to the closed event which
  16336. // occurs after the menu is already closed.
  16337. _this2.menuOpened_ = false;
  16338. _this2.selectedText_.removeAttribute('aria-expanded');
  16339. if (document.activeElement !== _this2.selectedText_) {
  16340. _this2.foundation_.handleBlur();
  16341. }
  16342. };
  16343. var element = this.nativeControl_ ? this.nativeControl_ : this.selectedText_;
  16344. element.addEventListener('change', this.handleChange_);
  16345. element.addEventListener('focus', this.handleFocus_);
  16346. element.addEventListener('blur', this.handleBlur_);
  16347. ['mousedown', 'touchstart'].forEach(function (evtType) {
  16348. element.addEventListener(evtType, _this2.handleClick_);
  16349. });
  16350. if (this.menuElement_) {
  16351. this.selectedText_.addEventListener('keydown', this.handleKeydown_);
  16352. this.menu_.listen(__WEBPACK_IMPORTED_MODULE_11__material_menu_surface_constants__["e" /* strings */].CLOSED_EVENT, this.handleMenuClosed_);
  16353. this.menu_.listen(__WEBPACK_IMPORTED_MODULE_11__material_menu_surface_constants__["e" /* strings */].OPENED_EVENT, this.handleMenuOpened_);
  16354. this.menu_.listen(__WEBPACK_IMPORTED_MODULE_12__material_menu_constants__["b" /* strings */].SELECTED_EVENT, this.handleMenuSelected_);
  16355. if (this.hiddenInput_ && this.hiddenInput_.value) {
  16356. // If the hidden input already has a value, use it to restore the select's value.
  16357. // This can happen e.g. if the user goes back or (in some browsers) refreshes the page.
  16358. var enhancedAdapterMethods = this.getEnhancedSelectAdapterMethods_();
  16359. enhancedAdapterMethods.setValue(this.hiddenInput_.value);
  16360. } else if (this.menuElement_.querySelector(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].SELECTED_ITEM_SELECTOR)) {
  16361. // If an element is selected, the select should set the initial selected text.
  16362. var _enhancedAdapterMethods = this.getEnhancedSelectAdapterMethods_();
  16363. _enhancedAdapterMethods.setValue(_enhancedAdapterMethods.getValue());
  16364. }
  16365. }
  16366. // Initially sync floating label
  16367. this.foundation_.handleChange( /* didChange */false);
  16368. if (this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_7__constants__["a" /* cssClasses */].DISABLED) || this.nativeControl_ && this.nativeControl_.disabled) {
  16369. this.disabled = true;
  16370. }
  16371. }
  16372. }, {
  16373. key: 'destroy',
  16374. value: function destroy() {
  16375. var _this3 = this;
  16376. var element = this.nativeControl_ ? this.nativeControl_ : this.selectedText_;
  16377. element.removeEventListener('change', this.handleChange_);
  16378. element.removeEventListener('focus', this.handleFocus_);
  16379. element.removeEventListener('blur', this.handleBlur_);
  16380. element.removeEventListener('keydown', this.handleKeydown_);
  16381. ['mousedown', 'touchstart'].forEach(function (evtType) {
  16382. element.removeEventListener(evtType, _this3.handleClick_);
  16383. });
  16384. if (this.menu_) {
  16385. this.menu_.unlisten(__WEBPACK_IMPORTED_MODULE_11__material_menu_surface_constants__["e" /* strings */].CLOSED_EVENT, this.handleMenuClosed_);
  16386. this.menu_.unlisten(__WEBPACK_IMPORTED_MODULE_11__material_menu_surface_constants__["e" /* strings */].OPENED_EVENT, this.handleMenuOpened_);
  16387. this.menu_.unlisten(__WEBPACK_IMPORTED_MODULE_12__material_menu_constants__["b" /* strings */].SELECTED_EVENT, this.handleMenuSelected_);
  16388. this.menu_.destroy();
  16389. }
  16390. if (this.ripple) {
  16391. this.ripple.destroy();
  16392. }
  16393. if (this.outline_) {
  16394. this.outline_.destroy();
  16395. }
  16396. if (this.leadingIcon_) {
  16397. this.leadingIcon_.destroy();
  16398. }
  16399. if (this.helperText_) {
  16400. this.helperText_.destroy();
  16401. }
  16402. if (this.validationObserver_) {
  16403. this.validationObserver_.disconnect();
  16404. }
  16405. _get(MDCSelect.prototype.__proto__ || Object.getPrototypeOf(MDCSelect.prototype), 'destroy', this).call(this);
  16406. }
  16407. /**
  16408. * @return {!MDCSelectFoundation}
  16409. */
  16410. }, {
  16411. key: 'getDefaultFoundation',
  16412. value: function getDefaultFoundation() {
  16413. return new __WEBPACK_IMPORTED_MODULE_6__foundation__["a" /* default */](
  16414. /** @type {!MDCSelectAdapter} */_extends(this.nativeControl_ ? this.getNativeSelectAdapterMethods_() : this.getEnhancedSelectAdapterMethods_(), this.getCommonAdapterMethods_(), this.getOutlineAdapterMethods_(), this.getLabelAdapterMethods_()), this.getFoundationMap_());
  16415. }
  16416. /**
  16417. * @return {!{
  16418. * getValue: function(): string,
  16419. * setValue: function(string): string,
  16420. * openMenu: function(): void,
  16421. * closeMenu: function(): void,
  16422. * isMenuOpen: function(): boolean,
  16423. * setSelectedIndex: function(number): void,
  16424. * setDisabled: function(boolean): void
  16425. * }}
  16426. * @private
  16427. */
  16428. }, {
  16429. key: 'getNativeSelectAdapterMethods_',
  16430. value: function getNativeSelectAdapterMethods_() {
  16431. var _this4 = this;
  16432. return {
  16433. getValue: function getValue() {
  16434. return _this4.nativeControl_.value;
  16435. },
  16436. setValue: function setValue(value) {
  16437. return _this4.nativeControl_.value = value;
  16438. },
  16439. openMenu: function openMenu() {},
  16440. closeMenu: function closeMenu() {},
  16441. isMenuOpen: function isMenuOpen() {
  16442. return false;
  16443. },
  16444. setSelectedIndex: function setSelectedIndex(index) {
  16445. _this4.nativeControl_.selectedIndex = index;
  16446. },
  16447. setDisabled: function setDisabled(isDisabled) {
  16448. return _this4.nativeControl_.disabled = isDisabled;
  16449. },
  16450. setValid: function setValid(isValid) {
  16451. isValid ? _this4.root_.classList.remove(__WEBPACK_IMPORTED_MODULE_7__constants__["a" /* cssClasses */].INVALID) : _this4.root_.classList.add(__WEBPACK_IMPORTED_MODULE_7__constants__["a" /* cssClasses */].INVALID);
  16452. },
  16453. checkValidity: function checkValidity() {
  16454. return _this4.nativeControl_.checkValidity();
  16455. }
  16456. };
  16457. }
  16458. /**
  16459. * @return {!{
  16460. * getValue: function(): string,
  16461. * setValue: function(string): string,
  16462. * openMenu: function(): void,
  16463. * closeMenu: function(): void,
  16464. * isMenuOpen: function(): boolean,
  16465. * setSelectedIndex: function(number): void,
  16466. * setDisabled: function(boolean): void
  16467. * }}
  16468. * @private
  16469. */
  16470. }, {
  16471. key: 'getEnhancedSelectAdapterMethods_',
  16472. value: function getEnhancedSelectAdapterMethods_() {
  16473. var _this5 = this;
  16474. return {
  16475. getValue: function getValue() {
  16476. var listItem = _this5.menuElement_.querySelector(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].SELECTED_ITEM_SELECTOR);
  16477. if (listItem && listItem.hasAttribute(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].ENHANCED_VALUE_ATTR)) {
  16478. return listItem.getAttribute(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].ENHANCED_VALUE_ATTR);
  16479. }
  16480. return '';
  16481. },
  16482. setValue: function setValue(value) {
  16483. var element =
  16484. /** @type {HTMLElement} */_this5.menuElement_.querySelector('[' + __WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].ENHANCED_VALUE_ATTR + '="' + value + '"]');
  16485. _this5.setEnhancedSelectedIndex_(element ? _this5.menu_.items.indexOf(element) : -1);
  16486. },
  16487. openMenu: function openMenu() {
  16488. if (_this5.menu_ && !_this5.menu_.open) {
  16489. _this5.menu_.open = true;
  16490. _this5.menuOpened_ = true;
  16491. _this5.selectedText_.setAttribute('aria-expanded', 'true');
  16492. }
  16493. },
  16494. closeMenu: function closeMenu() {
  16495. if (_this5.menu_ && _this5.menu_.open) {
  16496. _this5.menu_.open = false;
  16497. }
  16498. },
  16499. isMenuOpen: function isMenuOpen() {
  16500. return _this5.menu_ && _this5.menuOpened_;
  16501. },
  16502. setSelectedIndex: function setSelectedIndex(index) {
  16503. _this5.setEnhancedSelectedIndex_(index);
  16504. },
  16505. setDisabled: function setDisabled(isDisabled) {
  16506. _this5.selectedText_.setAttribute('tabindex', isDisabled ? '-1' : '0');
  16507. _this5.selectedText_.setAttribute('aria-disabled', isDisabled.toString());
  16508. if (_this5.hiddenInput_) {
  16509. _this5.hiddenInput_.disabled = isDisabled;
  16510. }
  16511. },
  16512. checkValidity: function checkValidity() {
  16513. var classList = _this5.root_.classList;
  16514. if (classList.contains(__WEBPACK_IMPORTED_MODULE_7__constants__["a" /* cssClasses */].REQUIRED) && !classList.contains(__WEBPACK_IMPORTED_MODULE_7__constants__["a" /* cssClasses */].DISABLED)) {
  16515. // See notes for required attribute under https://www.w3.org/TR/html52/sec-forms.html#the-select-element
  16516. // TL;DR: Invalid if no index is selected, or if the first index is selected and has an empty value.
  16517. return _this5.selectedIndex !== -1 && (_this5.selectedIndex !== 0 || _this5.value);
  16518. } else {
  16519. return true;
  16520. }
  16521. },
  16522. setValid: function setValid(isValid) {
  16523. _this5.selectedText_.setAttribute('aria-invalid', (!isValid).toString());
  16524. isValid ? _this5.root_.classList.remove(__WEBPACK_IMPORTED_MODULE_7__constants__["a" /* cssClasses */].INVALID) : _this5.root_.classList.add(__WEBPACK_IMPORTED_MODULE_7__constants__["a" /* cssClasses */].INVALID);
  16525. }
  16526. };
  16527. }
  16528. /**
  16529. * @return {!{
  16530. * addClass: function(string): void,
  16531. * removeClass: function(string): void,
  16532. * hasClass: function(string): void,
  16533. * setRippleCenter: function(number): void,
  16534. * activateBottomLine: function(): void,
  16535. * deactivateBottomLine: function(): void,
  16536. * notifyChange: function(string): void
  16537. * }}
  16538. * @private
  16539. */
  16540. }, {
  16541. key: 'getCommonAdapterMethods_',
  16542. value: function getCommonAdapterMethods_() {
  16543. var _this6 = this;
  16544. return {
  16545. addClass: function addClass(className) {
  16546. return _this6.root_.classList.add(className);
  16547. },
  16548. removeClass: function removeClass(className) {
  16549. return _this6.root_.classList.remove(className);
  16550. },
  16551. hasClass: function hasClass(className) {
  16552. return _this6.root_.classList.contains(className);
  16553. },
  16554. setRippleCenter: function setRippleCenter(normalizedX) {
  16555. return _this6.lineRipple_ && _this6.lineRipple_.setRippleCenter(normalizedX);
  16556. },
  16557. activateBottomLine: function activateBottomLine() {
  16558. return _this6.lineRipple_ && _this6.lineRipple_.activate();
  16559. },
  16560. deactivateBottomLine: function deactivateBottomLine() {
  16561. return _this6.lineRipple_ && _this6.lineRipple_.deactivate();
  16562. },
  16563. notifyChange: function notifyChange(value) {
  16564. var index = _this6.selectedIndex;
  16565. _this6.emit(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].CHANGE_EVENT, { value: value, index: index }, true /* shouldBubble */);
  16566. }
  16567. };
  16568. }
  16569. /**
  16570. * @return {!{
  16571. * hasOutline: function(): boolean,
  16572. * notchOutline: function(number, boolean): undefined,
  16573. * closeOutline: function(): undefined,
  16574. * }}
  16575. */
  16576. }, {
  16577. key: 'getOutlineAdapterMethods_',
  16578. value: function getOutlineAdapterMethods_() {
  16579. var _this7 = this;
  16580. return {
  16581. hasOutline: function hasOutline() {
  16582. return !!_this7.outline_;
  16583. },
  16584. notchOutline: function notchOutline(labelWidth) {
  16585. if (_this7.outline_) {
  16586. _this7.outline_.notch(labelWidth);
  16587. }
  16588. },
  16589. closeOutline: function closeOutline() {
  16590. if (_this7.outline_) {
  16591. _this7.outline_.closeNotch();
  16592. }
  16593. }
  16594. };
  16595. }
  16596. /**
  16597. * @return {!{
  16598. * floatLabel: function(boolean): undefined,
  16599. * getLabelWidth: function(): number,
  16600. * }}
  16601. */
  16602. }, {
  16603. key: 'getLabelAdapterMethods_',
  16604. value: function getLabelAdapterMethods_() {
  16605. var _this8 = this;
  16606. return {
  16607. floatLabel: function floatLabel(shouldFloat) {
  16608. if (_this8.label_) {
  16609. _this8.label_.float(shouldFloat);
  16610. }
  16611. },
  16612. getLabelWidth: function getLabelWidth() {
  16613. return _this8.label_ ? _this8.label_.getWidth() : 0;
  16614. }
  16615. };
  16616. }
  16617. /**
  16618. * Calculates where the line ripple should start based on the x coordinate within the component.
  16619. * @param {!(MouseEvent|TouchEvent)} evt
  16620. * @return {number} normalizedX
  16621. */
  16622. }, {
  16623. key: 'getNormalizedXCoordinate_',
  16624. value: function getNormalizedXCoordinate_(evt) {
  16625. var targetClientRect = evt.target.getBoundingClientRect();
  16626. var xCoordinate = evt.clientX;
  16627. return xCoordinate - targetClientRect.left;
  16628. }
  16629. /**
  16630. * Returns a map of all subcomponents to subfoundations.
  16631. * @return {!FoundationMapType}
  16632. */
  16633. }, {
  16634. key: 'getFoundationMap_',
  16635. value: function getFoundationMap_() {
  16636. return {
  16637. leadingIcon: this.leadingIcon_ ? this.leadingIcon_.foundation : undefined,
  16638. helperText: this.helperText_ ? this.helperText_.foundation : undefined
  16639. };
  16640. }
  16641. /**
  16642. * Sets the selected index of the enhanced menu.
  16643. * @param {number} index
  16644. * @private
  16645. */
  16646. }, {
  16647. key: 'setEnhancedSelectedIndex_',
  16648. value: function setEnhancedSelectedIndex_(index) {
  16649. var selectedItem = this.menu_.items[index];
  16650. this.selectedText_.textContent = selectedItem ? selectedItem.textContent.trim() : '';
  16651. var previouslySelected = this.menuElement_.querySelector(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].SELECTED_ITEM_SELECTOR);
  16652. if (previouslySelected) {
  16653. previouslySelected.classList.remove(__WEBPACK_IMPORTED_MODULE_7__constants__["a" /* cssClasses */].SELECTED_ITEM_CLASS);
  16654. previouslySelected.removeAttribute(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].ARIA_SELECTED_ATTR);
  16655. }
  16656. if (selectedItem) {
  16657. selectedItem.classList.add(__WEBPACK_IMPORTED_MODULE_7__constants__["a" /* cssClasses */].SELECTED_ITEM_CLASS);
  16658. selectedItem.setAttribute(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].ARIA_SELECTED_ATTR, 'true');
  16659. }
  16660. // Synchronize hidden input's value with data-value attribute of selected item.
  16661. // This code path is also followed when setting value directly, so this covers all cases.
  16662. if (this.hiddenInput_) {
  16663. this.hiddenInput_.value = selectedItem ? selectedItem.getAttribute(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].ENHANCED_VALUE_ATTR) || '' : '';
  16664. }
  16665. this.layout();
  16666. }
  16667. }, {
  16668. key: 'initialSyncRequiredState_',
  16669. value: function initialSyncRequiredState_() {
  16670. var element = this.nativeControl_ ? this.nativeControl_ : this.selectedText_;
  16671. var isRequired = element.required || element.getAttribute('aria-required') === 'true' || this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_7__constants__["a" /* cssClasses */].REQUIRED);
  16672. if (isRequired) {
  16673. if (this.nativeControl_) {
  16674. this.nativeControl_.required = true;
  16675. } else {
  16676. this.selectedText_.setAttribute('aria-required', 'true');
  16677. }
  16678. this.root_.classList.add(__WEBPACK_IMPORTED_MODULE_7__constants__["a" /* cssClasses */].REQUIRED);
  16679. }
  16680. }
  16681. }, {
  16682. key: 'addMutationObserverForRequired_',
  16683. value: function addMutationObserverForRequired_() {
  16684. var _this9 = this;
  16685. var observerHandler = function observerHandler(attributesList) {
  16686. attributesList.some(function (attributeName) {
  16687. if (VALIDATION_ATTR_WHITELIST.indexOf(attributeName) > -1) {
  16688. if (_this9.selectedText_) {
  16689. if (_this9.selectedText_.getAttribute('aria-required') === 'true') {
  16690. _this9.root_.classList.add(__WEBPACK_IMPORTED_MODULE_7__constants__["a" /* cssClasses */].REQUIRED);
  16691. } else {
  16692. _this9.root_.classList.remove(__WEBPACK_IMPORTED_MODULE_7__constants__["a" /* cssClasses */].REQUIRED);
  16693. }
  16694. } else {
  16695. if (_this9.nativeControl_.required) {
  16696. _this9.root_.classList.add(__WEBPACK_IMPORTED_MODULE_7__constants__["a" /* cssClasses */].REQUIRED);
  16697. } else {
  16698. _this9.root_.classList.remove(__WEBPACK_IMPORTED_MODULE_7__constants__["a" /* cssClasses */].REQUIRED);
  16699. }
  16700. }
  16701. return true;
  16702. }
  16703. });
  16704. };
  16705. var getAttributesList = function getAttributesList(mutationsList) {
  16706. return mutationsList.map(function (mutation) {
  16707. return mutation.attributeName;
  16708. });
  16709. };
  16710. var observer = new MutationObserver(function (mutationsList) {
  16711. return observerHandler(getAttributesList(mutationsList));
  16712. });
  16713. var element = this.nativeControl_ ? this.nativeControl_ : this.selectedText_;
  16714. observer.observe(element, { attributes: true });
  16715. this.validationObserver_ = observer;
  16716. }
  16717. }, {
  16718. key: 'value',
  16719. /**
  16720. * @return {string} The value of the select.
  16721. */
  16722. get: function get() {
  16723. return this.foundation_.getValue();
  16724. }
  16725. /**
  16726. * @param {string} value The value to set on the select.
  16727. */
  16728. ,
  16729. set: function set(value) {
  16730. this.foundation_.setValue(value);
  16731. }
  16732. /**
  16733. * @return {number} The selected index of the select.
  16734. */
  16735. }, {
  16736. key: 'selectedIndex',
  16737. get: function get() {
  16738. var selectedIndex = void 0;
  16739. if (this.menuElement_) {
  16740. var selectedEl = /** @type {!HTMLElement} */this.menuElement_.querySelector(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].SELECTED_ITEM_SELECTOR);
  16741. selectedIndex = this.menu_.items.indexOf(selectedEl);
  16742. } else {
  16743. selectedIndex = this.nativeControl_.selectedIndex;
  16744. }
  16745. return selectedIndex;
  16746. }
  16747. /**
  16748. * @param {number} selectedIndex The index of the option to be set on the select.
  16749. */
  16750. ,
  16751. set: function set(selectedIndex) {
  16752. this.foundation_.setSelectedIndex(selectedIndex);
  16753. }
  16754. /**
  16755. * @return {boolean} True if the select is disabled.
  16756. */
  16757. }, {
  16758. key: 'disabled',
  16759. get: function get() {
  16760. return this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_7__constants__["a" /* cssClasses */].DISABLED) || (this.nativeControl_ ? this.nativeControl_.disabled : false);
  16761. }
  16762. /**
  16763. * @param {boolean} disabled Sets the select disabled or enabled.
  16764. */
  16765. ,
  16766. set: function set(disabled) {
  16767. this.foundation_.setDisabled(disabled);
  16768. }
  16769. /**
  16770. * Sets the aria label of the leading icon.
  16771. * @param {string} label
  16772. */
  16773. }, {
  16774. key: 'leadingIconAriaLabel',
  16775. set: function set(label) {
  16776. this.foundation_.setLeadingIconAriaLabel(label);
  16777. }
  16778. /**
  16779. * Sets the text content of the leading icon.
  16780. * @param {string} content
  16781. */
  16782. }, {
  16783. key: 'leadingIconContent',
  16784. set: function set(content) {
  16785. this.foundation_.setLeadingIconContent(content);
  16786. }
  16787. /**
  16788. * Sets the text content of the helper text.
  16789. * @param {string} content
  16790. */
  16791. }, {
  16792. key: 'helperTextContent',
  16793. set: function set(content) {
  16794. this.foundation_.setHelperTextContent(content);
  16795. }
  16796. /**
  16797. * Sets the current invalid state of the select.
  16798. * @param {boolean} isValid
  16799. */
  16800. }, {
  16801. key: 'valid',
  16802. set: function set(isValid) {
  16803. this.foundation_.setValid(isValid);
  16804. }
  16805. /**
  16806. * Checks if the select is in a valid state.
  16807. * @return {boolean}
  16808. */
  16809. ,
  16810. get: function get() {
  16811. return this.foundation_.isValid();
  16812. }
  16813. /**
  16814. * Sets the control to the required state.
  16815. * @param {boolean} isRequired
  16816. */
  16817. }, {
  16818. key: 'required',
  16819. set: function set(isRequired) {
  16820. if (this.nativeControl_) {
  16821. this.nativeControl_.required = isRequired;
  16822. } else {
  16823. if (isRequired) {
  16824. this.selectedText_.setAttribute('aria-required', isRequired.toString());
  16825. } else {
  16826. this.selectedText_.removeAttribute('aria-required');
  16827. }
  16828. }
  16829. }
  16830. /**
  16831. * Returns whether the select is required.
  16832. * @return {boolean}
  16833. */
  16834. ,
  16835. get: function get() {
  16836. if (this.nativeControl_) {
  16837. return this.nativeControl_.required;
  16838. } else {
  16839. return this.selectedText_.getAttribute('aria-required') === 'true';
  16840. }
  16841. }
  16842. }], [{
  16843. key: 'attachTo',
  16844. value: function attachTo(root) {
  16845. return new MDCSelect(root);
  16846. }
  16847. }]);
  16848. return MDCSelect;
  16849. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  16850. /***/ }),
  16851. /* 122 */
  16852. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16853. "use strict";
  16854. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  16855. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(48);
  16856. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__icon_index__ = __webpack_require__(21);
  16857. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__helper_text_index__ = __webpack_require__(22);
  16858. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__constants__ = __webpack_require__(51);
  16859. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  16860. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  16861. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  16862. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  16863. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  16864. /**
  16865. * @license
  16866. * Copyright 2016 Google Inc.
  16867. *
  16868. * Permission is hereby granted, free of charge, to any person obtaining a copy
  16869. * of this software and associated documentation files (the "Software"), to deal
  16870. * in the Software without restriction, including without limitation the rights
  16871. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  16872. * copies of the Software, and to permit persons to whom the Software is
  16873. * furnished to do so, subject to the following conditions:
  16874. *
  16875. * The above copyright notice and this permission notice shall be included in
  16876. * all copies or substantial portions of the Software.
  16877. *
  16878. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16879. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16880. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  16881. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  16882. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  16883. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  16884. * THE SOFTWARE.
  16885. */
  16886. /* eslint-disable no-unused-vars */
  16887. /* eslint-enable no-unused-vars */
  16888. /**
  16889. * @extends {MDCFoundation<!MDCSelectAdapter>}
  16890. * @final
  16891. */
  16892. var MDCSelectFoundation = function (_MDCFoundation) {
  16893. _inherits(MDCSelectFoundation, _MDCFoundation);
  16894. _createClass(MDCSelectFoundation, null, [{
  16895. key: 'cssClasses',
  16896. /** @return enum {string} */
  16897. get: function get() {
  16898. return __WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */];
  16899. }
  16900. /** @return enum {number} */
  16901. }, {
  16902. key: 'numbers',
  16903. get: function get() {
  16904. return __WEBPACK_IMPORTED_MODULE_4__constants__["b" /* numbers */];
  16905. }
  16906. /** @return enum {string} */
  16907. }, {
  16908. key: 'strings',
  16909. get: function get() {
  16910. return __WEBPACK_IMPORTED_MODULE_4__constants__["c" /* strings */];
  16911. }
  16912. /**
  16913. * {@see MDCSelectAdapter} for typing information on parameters and return
  16914. * types.
  16915. * @return {!MDCSelectAdapter}
  16916. */
  16917. }, {
  16918. key: 'defaultAdapter',
  16919. get: function get() {
  16920. return (/** @type {!MDCSelectAdapter} */{
  16921. addClass: function addClass() /* className: string */{},
  16922. removeClass: function removeClass() /* className: string */{},
  16923. hasClass: function hasClass() {
  16924. return (/* className: string */false
  16925. );
  16926. },
  16927. activateBottomLine: function activateBottomLine() {},
  16928. deactivateBottomLine: function deactivateBottomLine() {},
  16929. setValue: function setValue() {},
  16930. getValue: function getValue() {},
  16931. floatLabel: function floatLabel() /* value: boolean */{},
  16932. getLabelWidth: function getLabelWidth() {},
  16933. hasOutline: function hasOutline() {
  16934. return false;
  16935. },
  16936. notchOutline: function notchOutline() /* labelWidth: number, */{},
  16937. closeOutline: function closeOutline() {},
  16938. openMenu: function openMenu() {},
  16939. closeMenu: function closeMenu() {},
  16940. isMenuOpen: function isMenuOpen() {},
  16941. setSelectedIndex: function setSelectedIndex() {},
  16942. setDisabled: function setDisabled() {},
  16943. setRippleCenter: function setRippleCenter() {},
  16944. notifyChange: function notifyChange() {},
  16945. checkValidity: function checkValidity() {},
  16946. setValid: function setValid() {}
  16947. }
  16948. );
  16949. }
  16950. /**
  16951. * @param {!MDCSelectAdapter} adapter
  16952. * @param {!FoundationMapType=} foundationMap Map from subcomponent names to their subfoundations.
  16953. */
  16954. }]);
  16955. function MDCSelectFoundation(adapter) {
  16956. var foundationMap = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : /** @type {!FoundationMapType} */{};
  16957. _classCallCheck(this, MDCSelectFoundation);
  16958. /** @type {!MDCSelectIconFoundation|undefined} */
  16959. var _this = _possibleConstructorReturn(this, (MDCSelectFoundation.__proto__ || Object.getPrototypeOf(MDCSelectFoundation)).call(this, _extends(MDCSelectFoundation.defaultAdapter, adapter)));
  16960. _this.leadingIcon_ = foundationMap.leadingIcon;
  16961. /** @type {!MDCSelectHelperTextFoundation|undefined} */
  16962. _this.helperText_ = foundationMap.helperText;
  16963. return _this;
  16964. }
  16965. _createClass(MDCSelectFoundation, [{
  16966. key: 'setSelectedIndex',
  16967. value: function setSelectedIndex(index) {
  16968. this.adapter_.setSelectedIndex(index);
  16969. this.adapter_.closeMenu();
  16970. var didChange = true;
  16971. this.handleChange(didChange);
  16972. }
  16973. }, {
  16974. key: 'setValue',
  16975. value: function setValue(value) {
  16976. this.adapter_.setValue(value);
  16977. var didChange = true;
  16978. this.handleChange(didChange);
  16979. }
  16980. }, {
  16981. key: 'getValue',
  16982. value: function getValue() {
  16983. return this.adapter_.getValue();
  16984. }
  16985. }, {
  16986. key: 'setDisabled',
  16987. value: function setDisabled(isDisabled) {
  16988. isDisabled ? this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */].DISABLED) : this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */].DISABLED);
  16989. this.adapter_.setDisabled(isDisabled);
  16990. this.adapter_.closeMenu();
  16991. if (this.leadingIcon_) {
  16992. this.leadingIcon_.setDisabled(isDisabled);
  16993. }
  16994. }
  16995. /**
  16996. * @param {string} content Sets the content of the helper text.
  16997. */
  16998. }, {
  16999. key: 'setHelperTextContent',
  17000. value: function setHelperTextContent(content) {
  17001. if (this.helperText_) {
  17002. this.helperText_.setContent(content);
  17003. }
  17004. }
  17005. }, {
  17006. key: 'layout',
  17007. value: function layout() {
  17008. var openNotch = this.getValue().length > 0;
  17009. this.notchOutline(openNotch);
  17010. }
  17011. /**
  17012. * Handles value changes, via change event or programmatic updates.
  17013. */
  17014. }, {
  17015. key: 'handleChange',
  17016. value: function handleChange() {
  17017. var didChange = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
  17018. var value = this.getValue();
  17019. var optionHasValue = value.length > 0;
  17020. var isRequired = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */].REQUIRED);
  17021. this.notchOutline(optionHasValue);
  17022. if (!this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */].FOCUSED)) {
  17023. this.adapter_.floatLabel(optionHasValue);
  17024. }
  17025. if (didChange) {
  17026. this.adapter_.notifyChange(value);
  17027. if (isRequired) {
  17028. this.setValid(this.isValid());
  17029. if (this.helperText_) {
  17030. this.helperText_.setValidity(this.isValid());
  17031. }
  17032. }
  17033. }
  17034. }
  17035. /**
  17036. * Handles focus events from select element.
  17037. */
  17038. }, {
  17039. key: 'handleFocus',
  17040. value: function handleFocus() {
  17041. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */].FOCUSED);
  17042. this.adapter_.floatLabel(true);
  17043. this.notchOutline(true);
  17044. this.adapter_.activateBottomLine();
  17045. if (this.helperText_) {
  17046. this.helperText_.showToScreenReader();
  17047. }
  17048. }
  17049. /**
  17050. * Handles blur events from select element.
  17051. */
  17052. }, {
  17053. key: 'handleBlur',
  17054. value: function handleBlur() {
  17055. if (this.adapter_.isMenuOpen()) return;
  17056. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */].FOCUSED);
  17057. this.handleChange(false);
  17058. this.adapter_.deactivateBottomLine();
  17059. var isRequired = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */].REQUIRED);
  17060. if (isRequired) {
  17061. this.setValid(this.isValid());
  17062. if (this.helperText_) {
  17063. this.helperText_.setValidity(this.isValid());
  17064. }
  17065. }
  17066. }
  17067. }, {
  17068. key: 'handleClick',
  17069. value: function handleClick(normalizedX) {
  17070. if (this.adapter_.isMenuOpen()) return;
  17071. this.adapter_.setRippleCenter(normalizedX);
  17072. this.adapter_.openMenu();
  17073. }
  17074. }, {
  17075. key: 'handleKeydown',
  17076. value: function handleKeydown(event) {
  17077. if (this.adapter_.isMenuOpen()) return;
  17078. var isEnter = event.key === 'Enter' || event.keyCode === 13;
  17079. var isSpace = event.key === 'Space' || event.keyCode === 32;
  17080. var arrowUp = event.key === 'ArrowUp' || event.keyCode === 38;
  17081. var arrowDown = event.key === 'ArrowDown' || event.keyCode === 40;
  17082. if (this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */].FOCUSED) && (isEnter || isSpace || arrowUp || arrowDown)) {
  17083. this.adapter_.openMenu();
  17084. event.preventDefault();
  17085. }
  17086. }
  17087. /**
  17088. * Opens/closes the notched outline.
  17089. * @param {boolean} openNotch
  17090. */
  17091. }, {
  17092. key: 'notchOutline',
  17093. value: function notchOutline(openNotch) {
  17094. if (!this.adapter_.hasOutline()) {
  17095. return;
  17096. }
  17097. var isFocused = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */].FOCUSED);
  17098. if (openNotch) {
  17099. var labelScale = __WEBPACK_IMPORTED_MODULE_4__constants__["b" /* numbers */].LABEL_SCALE;
  17100. var labelWidth = this.adapter_.getLabelWidth() * labelScale;
  17101. this.adapter_.notchOutline(labelWidth);
  17102. } else if (!isFocused) {
  17103. this.adapter_.closeOutline();
  17104. }
  17105. }
  17106. /**
  17107. * Sets the aria label of the leading icon.
  17108. * @param {string} label
  17109. */
  17110. }, {
  17111. key: 'setLeadingIconAriaLabel',
  17112. value: function setLeadingIconAriaLabel(label) {
  17113. if (this.leadingIcon_) {
  17114. this.leadingIcon_.setAriaLabel(label);
  17115. }
  17116. }
  17117. /**
  17118. * Sets the text content of the leading icon.
  17119. * @param {string} content
  17120. */
  17121. }, {
  17122. key: 'setLeadingIconContent',
  17123. value: function setLeadingIconContent(content) {
  17124. if (this.leadingIcon_) {
  17125. this.leadingIcon_.setContent(content);
  17126. }
  17127. }
  17128. }, {
  17129. key: 'setValid',
  17130. value: function setValid(isValid) {
  17131. this.adapter_.setValid(isValid);
  17132. }
  17133. }, {
  17134. key: 'isValid',
  17135. value: function isValid() {
  17136. return this.adapter_.checkValidity();
  17137. }
  17138. }]);
  17139. return MDCSelectFoundation;
  17140. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  17141. /* harmony default export */ __webpack_exports__["a"] = (MDCSelectFoundation);
  17142. /***/ }),
  17143. /* 123 */
  17144. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17145. "use strict";
  17146. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  17147. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(49);
  17148. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(124);
  17149. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  17150. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  17151. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  17152. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  17153. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  17154. /**
  17155. * @license
  17156. * Copyright 2018 Google Inc.
  17157. *
  17158. * Permission is hereby granted, free of charge, to any person obtaining a copy
  17159. * of this software and associated documentation files (the "Software"), to deal
  17160. * in the Software without restriction, including without limitation the rights
  17161. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  17162. * copies of the Software, and to permit persons to whom the Software is
  17163. * furnished to do so, subject to the following conditions:
  17164. *
  17165. * The above copyright notice and this permission notice shall be included in
  17166. * all copies or substantial portions of the Software.
  17167. *
  17168. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17169. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17170. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17171. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  17172. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  17173. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  17174. * THE SOFTWARE.
  17175. */
  17176. /**
  17177. * @extends {MDCFoundation<!MDCSelectIconAdapter>}
  17178. * @final
  17179. */
  17180. var MDCSelectIconFoundation = function (_MDCFoundation) {
  17181. _inherits(MDCSelectIconFoundation, _MDCFoundation);
  17182. _createClass(MDCSelectIconFoundation, null, [{
  17183. key: 'strings',
  17184. /** @return enum {string} */
  17185. get: function get() {
  17186. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* strings */];
  17187. }
  17188. /**
  17189. * {@see MDCSelectIconAdapter} for typing information on parameters and return
  17190. * types.
  17191. * @return {!MDCSelectIconAdapter}
  17192. */
  17193. }, {
  17194. key: 'defaultAdapter',
  17195. get: function get() {
  17196. return (/** @type {!MDCSelectIconAdapter} */{
  17197. getAttr: function getAttr() {},
  17198. setAttr: function setAttr() {},
  17199. removeAttr: function removeAttr() {},
  17200. setContent: function setContent() {},
  17201. registerInteractionHandler: function registerInteractionHandler() {},
  17202. deregisterInteractionHandler: function deregisterInteractionHandler() {},
  17203. notifyIconAction: function notifyIconAction() {}
  17204. }
  17205. );
  17206. }
  17207. /**
  17208. * @param {!MDCSelectIconAdapter} adapter
  17209. */
  17210. }]);
  17211. function MDCSelectIconFoundation(adapter) {
  17212. _classCallCheck(this, MDCSelectIconFoundation);
  17213. /** @private {string?} */
  17214. var _this = _possibleConstructorReturn(this, (MDCSelectIconFoundation.__proto__ || Object.getPrototypeOf(MDCSelectIconFoundation)).call(this, _extends(MDCSelectIconFoundation.defaultAdapter, adapter)));
  17215. _this.savedTabIndex_ = null;
  17216. /** @private {function(!Event): undefined} */
  17217. _this.interactionHandler_ = function (evt) {
  17218. return _this.handleInteraction(evt);
  17219. };
  17220. return _this;
  17221. }
  17222. _createClass(MDCSelectIconFoundation, [{
  17223. key: 'init',
  17224. value: function init() {
  17225. var _this2 = this;
  17226. this.savedTabIndex_ = this.adapter_.getAttr('tabindex');
  17227. ['click', 'keydown'].forEach(function (evtType) {
  17228. _this2.adapter_.registerInteractionHandler(evtType, _this2.interactionHandler_);
  17229. });
  17230. }
  17231. }, {
  17232. key: 'destroy',
  17233. value: function destroy() {
  17234. var _this3 = this;
  17235. ['click', 'keydown'].forEach(function (evtType) {
  17236. _this3.adapter_.deregisterInteractionHandler(evtType, _this3.interactionHandler_);
  17237. });
  17238. }
  17239. /** @param {boolean} disabled */
  17240. }, {
  17241. key: 'setDisabled',
  17242. value: function setDisabled(disabled) {
  17243. if (!this.savedTabIndex_) {
  17244. return;
  17245. }
  17246. if (disabled) {
  17247. this.adapter_.setAttr('tabindex', '-1');
  17248. this.adapter_.removeAttr('role');
  17249. } else {
  17250. this.adapter_.setAttr('tabindex', this.savedTabIndex_);
  17251. this.adapter_.setAttr('role', __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* strings */].ICON_ROLE);
  17252. }
  17253. }
  17254. /** @param {string} label */
  17255. }, {
  17256. key: 'setAriaLabel',
  17257. value: function setAriaLabel(label) {
  17258. this.adapter_.setAttr('aria-label', label);
  17259. }
  17260. /** @param {string} content */
  17261. }, {
  17262. key: 'setContent',
  17263. value: function setContent(content) {
  17264. this.adapter_.setContent(content);
  17265. }
  17266. /**
  17267. * Handles an interaction event
  17268. * @param {!Event} evt
  17269. */
  17270. }, {
  17271. key: 'handleInteraction',
  17272. value: function handleInteraction(evt) {
  17273. if (evt.type === 'click' || evt.key === 'Enter' || evt.keyCode === 13) {
  17274. this.adapter_.notifyIconAction();
  17275. }
  17276. }
  17277. }]);
  17278. return MDCSelectIconFoundation;
  17279. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  17280. /* harmony default export */ __webpack_exports__["a"] = (MDCSelectIconFoundation);
  17281. /***/ }),
  17282. /* 124 */
  17283. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17284. "use strict";
  17285. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return strings; });
  17286. /**
  17287. * @license
  17288. * Copyright 2018 Google Inc.
  17289. *
  17290. * Permission is hereby granted, free of charge, to any person obtaining a copy
  17291. * of this software and associated documentation files (the "Software"), to deal
  17292. * in the Software without restriction, including without limitation the rights
  17293. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  17294. * copies of the Software, and to permit persons to whom the Software is
  17295. * furnished to do so, subject to the following conditions:
  17296. *
  17297. * The above copyright notice and this permission notice shall be included in
  17298. * all copies or substantial portions of the Software.
  17299. *
  17300. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17301. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17302. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17303. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  17304. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  17305. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  17306. * THE SOFTWARE.
  17307. */
  17308. /** @enum {string} */
  17309. var strings = {
  17310. ICON_EVENT: 'MDCSelect:icon',
  17311. ICON_ROLE: 'button'
  17312. };
  17313. /***/ }),
  17314. /* 125 */
  17315. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17316. "use strict";
  17317. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  17318. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(50);
  17319. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(126);
  17320. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  17321. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  17322. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  17323. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  17324. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  17325. /**
  17326. * @license
  17327. * Copyright 2018 Google Inc.
  17328. *
  17329. * Permission is hereby granted, free of charge, to any person obtaining a copy
  17330. * of this software and associated documentation files (the "Software"), to deal
  17331. * in the Software without restriction, including without limitation the rights
  17332. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  17333. * copies of the Software, and to permit persons to whom the Software is
  17334. * furnished to do so, subject to the following conditions:
  17335. *
  17336. * The above copyright notice and this permission notice shall be included in
  17337. * all copies or substantial portions of the Software.
  17338. *
  17339. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17340. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17341. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17342. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  17343. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  17344. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  17345. * THE SOFTWARE.
  17346. */
  17347. /**
  17348. * @extends {MDCFoundation<!MDCSelectHelperTextAdapter>}
  17349. * @final
  17350. */
  17351. var MDCSelectHelperTextFoundation = function (_MDCFoundation) {
  17352. _inherits(MDCSelectHelperTextFoundation, _MDCFoundation);
  17353. _createClass(MDCSelectHelperTextFoundation, null, [{
  17354. key: 'cssClasses',
  17355. /** @return enum {string} */
  17356. get: function get() {
  17357. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  17358. }
  17359. /** @return enum {string} */
  17360. }, {
  17361. key: 'strings',
  17362. get: function get() {
  17363. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  17364. }
  17365. /**
  17366. * {@see MDCSelectHelperTextAdapter} for typing information on parameters and return
  17367. * types.
  17368. * @return {!MDCSelectHelperTextAdapter}
  17369. */
  17370. }, {
  17371. key: 'defaultAdapter',
  17372. get: function get() {
  17373. return (/** @type {!MDCSelectHelperTextAdapter} */{
  17374. addClass: function addClass() {},
  17375. removeClass: function removeClass() {},
  17376. hasClass: function hasClass() {},
  17377. setAttr: function setAttr() {},
  17378. removeAttr: function removeAttr() {},
  17379. setContent: function setContent() {}
  17380. }
  17381. );
  17382. }
  17383. /**
  17384. * @param {!MDCSelectHelperTextAdapter} adapter
  17385. */
  17386. }]);
  17387. function MDCSelectHelperTextFoundation(adapter) {
  17388. _classCallCheck(this, MDCSelectHelperTextFoundation);
  17389. return _possibleConstructorReturn(this, (MDCSelectHelperTextFoundation.__proto__ || Object.getPrototypeOf(MDCSelectHelperTextFoundation)).call(this, _extends(MDCSelectHelperTextFoundation.defaultAdapter, adapter)));
  17390. }
  17391. /**
  17392. * Sets the content of the helper text field.
  17393. * @param {string} content
  17394. */
  17395. _createClass(MDCSelectHelperTextFoundation, [{
  17396. key: 'setContent',
  17397. value: function setContent(content) {
  17398. this.adapter_.setContent(content);
  17399. }
  17400. /** @param {boolean} isPersistent Sets the persistency of the helper text. */
  17401. }, {
  17402. key: 'setPersistent',
  17403. value: function setPersistent(isPersistent) {
  17404. if (isPersistent) {
  17405. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_PERSISTENT);
  17406. } else {
  17407. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_PERSISTENT);
  17408. }
  17409. }
  17410. /**
  17411. * @param {boolean} isValidation True to make the helper text act as an
  17412. * error validation message.
  17413. */
  17414. }, {
  17415. key: 'setValidation',
  17416. value: function setValidation(isValidation) {
  17417. if (isValidation) {
  17418. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_VALIDATION_MSG);
  17419. } else {
  17420. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_VALIDATION_MSG);
  17421. }
  17422. }
  17423. /** Makes the helper text visible to the screen reader. */
  17424. }, {
  17425. key: 'showToScreenReader',
  17426. value: function showToScreenReader() {
  17427. this.adapter_.removeAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_HIDDEN);
  17428. }
  17429. /**
  17430. * Sets the validity of the helper text based on the select validity.
  17431. * @param {boolean} selectIsValid
  17432. */
  17433. }, {
  17434. key: 'setValidity',
  17435. value: function setValidity(selectIsValid) {
  17436. var helperTextIsPersistent = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_PERSISTENT);
  17437. var helperTextIsValidationMsg = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_VALIDATION_MSG);
  17438. var validationMsgNeedsDisplay = helperTextIsValidationMsg && !selectIsValid;
  17439. if (validationMsgNeedsDisplay) {
  17440. this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ROLE, 'alert');
  17441. } else {
  17442. this.adapter_.removeAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ROLE);
  17443. }
  17444. if (!helperTextIsPersistent && !validationMsgNeedsDisplay) {
  17445. this.hide_();
  17446. }
  17447. }
  17448. /**
  17449. * Hides the help text from screen readers.
  17450. * @private
  17451. */
  17452. }, {
  17453. key: 'hide_',
  17454. value: function hide_() {
  17455. this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_HIDDEN, 'true');
  17456. }
  17457. }]);
  17458. return MDCSelectHelperTextFoundation;
  17459. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  17460. /* harmony default export */ __webpack_exports__["a"] = (MDCSelectHelperTextFoundation);
  17461. /***/ }),
  17462. /* 126 */
  17463. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17464. "use strict";
  17465. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  17466. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  17467. /**
  17468. * @license
  17469. * Copyright 2018 Google Inc.
  17470. *
  17471. * Permission is hereby granted, free of charge, to any person obtaining a copy
  17472. * of this software and associated documentation files (the "Software"), to deal
  17473. * in the Software without restriction, including without limitation the rights
  17474. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  17475. * copies of the Software, and to permit persons to whom the Software is
  17476. * furnished to do so, subject to the following conditions:
  17477. *
  17478. * The above copyright notice and this permission notice shall be included in
  17479. * all copies or substantial portions of the Software.
  17480. *
  17481. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17482. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17483. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17484. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  17485. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  17486. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  17487. * THE SOFTWARE.
  17488. */
  17489. /** @enum {string} */
  17490. var strings = {
  17491. ARIA_HIDDEN: 'aria-hidden',
  17492. ROLE: 'role'
  17493. };
  17494. /** @enum {string} */
  17495. var cssClasses = {
  17496. HELPER_TEXT_PERSISTENT: 'mdc-select-helper-text--persistent',
  17497. HELPER_TEXT_VALIDATION_MSG: 'mdc-select-helper-text--validation-msg'
  17498. };
  17499. /***/ }),
  17500. /* 127 */
  17501. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17502. "use strict";
  17503. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  17504. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSlider", function() { return MDCSlider; });
  17505. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  17506. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(52);
  17507. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__adapter__ = __webpack_require__(53);
  17508. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation__ = __webpack_require__(128);
  17509. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSliderFoundation", function() { return __WEBPACK_IMPORTED_MODULE_3__foundation__["a"]; });
  17510. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  17511. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  17512. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  17513. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  17514. /**
  17515. * @license
  17516. * Copyright 2017 Google Inc.
  17517. *
  17518. * Permission is hereby granted, free of charge, to any person obtaining a copy
  17519. * of this software and associated documentation files (the "Software"), to deal
  17520. * in the Software without restriction, including without limitation the rights
  17521. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  17522. * copies of the Software, and to permit persons to whom the Software is
  17523. * furnished to do so, subject to the following conditions:
  17524. *
  17525. * The above copyright notice and this permission notice shall be included in
  17526. * all copies or substantial portions of the Software.
  17527. *
  17528. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17529. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17530. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17531. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  17532. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  17533. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  17534. * THE SOFTWARE.
  17535. */
  17536. /**
  17537. * @extends MDCComponent<!MDCSliderFoundation>
  17538. */
  17539. var MDCSlider = function (_MDCComponent) {
  17540. _inherits(MDCSlider, _MDCComponent);
  17541. _createClass(MDCSlider, null, [{
  17542. key: 'attachTo',
  17543. value: function attachTo(root) {
  17544. return new MDCSlider(root);
  17545. }
  17546. }]);
  17547. function MDCSlider() {
  17548. var _ref;
  17549. _classCallCheck(this, MDCSlider);
  17550. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  17551. args[_key] = arguments[_key];
  17552. }
  17553. /** @type {?Element} */
  17554. var _this = _possibleConstructorReturn(this, (_ref = MDCSlider.__proto__ || Object.getPrototypeOf(MDCSlider)).call.apply(_ref, [this].concat(args)));
  17555. _this.thumbContainer_;
  17556. /** @type {?Element} */
  17557. _this.track_;
  17558. /** @type {?Element} */
  17559. _this.pinValueMarker_;
  17560. /** @type {?Element} */
  17561. _this.trackMarkerContainer_;
  17562. return _this;
  17563. }
  17564. /** @return {number} */
  17565. _createClass(MDCSlider, [{
  17566. key: 'initialize',
  17567. value: function initialize() {
  17568. this.thumbContainer_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].THUMB_CONTAINER_SELECTOR);
  17569. this.track_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].TRACK_SELECTOR);
  17570. this.pinValueMarker_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].PIN_VALUE_MARKER_SELECTOR);
  17571. this.trackMarkerContainer_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].TRACK_MARKER_CONTAINER_SELECTOR);
  17572. }
  17573. /**
  17574. * @return {!MDCSliderFoundation}
  17575. */
  17576. }, {
  17577. key: 'getDefaultFoundation',
  17578. value: function getDefaultFoundation() {
  17579. var _this2 = this;
  17580. return new __WEBPACK_IMPORTED_MODULE_3__foundation__["a" /* default */](
  17581. /** @type {!MDCSliderAdapter} */{
  17582. hasClass: function hasClass(className) {
  17583. return _this2.root_.classList.contains(className);
  17584. },
  17585. addClass: function addClass(className) {
  17586. return _this2.root_.classList.add(className);
  17587. },
  17588. removeClass: function removeClass(className) {
  17589. return _this2.root_.classList.remove(className);
  17590. },
  17591. getAttribute: function getAttribute(name) {
  17592. return _this2.root_.getAttribute(name);
  17593. },
  17594. setAttribute: function setAttribute(name, value) {
  17595. return _this2.root_.setAttribute(name, value);
  17596. },
  17597. removeAttribute: function removeAttribute(name) {
  17598. return _this2.root_.removeAttribute(name);
  17599. },
  17600. computeBoundingRect: function computeBoundingRect() {
  17601. return _this2.root_.getBoundingClientRect();
  17602. },
  17603. getTabIndex: function getTabIndex() {
  17604. return _this2.root_.tabIndex;
  17605. },
  17606. registerInteractionHandler: function registerInteractionHandler(type, handler) {
  17607. _this2.root_.addEventListener(type, handler);
  17608. },
  17609. deregisterInteractionHandler: function deregisterInteractionHandler(type, handler) {
  17610. _this2.root_.removeEventListener(type, handler);
  17611. },
  17612. registerThumbContainerInteractionHandler: function registerThumbContainerInteractionHandler(type, handler) {
  17613. _this2.thumbContainer_.addEventListener(type, handler);
  17614. },
  17615. deregisterThumbContainerInteractionHandler: function deregisterThumbContainerInteractionHandler(type, handler) {
  17616. _this2.thumbContainer_.removeEventListener(type, handler);
  17617. },
  17618. registerBodyInteractionHandler: function registerBodyInteractionHandler(type, handler) {
  17619. document.body.addEventListener(type, handler);
  17620. },
  17621. deregisterBodyInteractionHandler: function deregisterBodyInteractionHandler(type, handler) {
  17622. document.body.removeEventListener(type, handler);
  17623. },
  17624. registerResizeHandler: function registerResizeHandler(handler) {
  17625. window.addEventListener('resize', handler);
  17626. },
  17627. deregisterResizeHandler: function deregisterResizeHandler(handler) {
  17628. window.removeEventListener('resize', handler);
  17629. },
  17630. notifyInput: function notifyInput() {
  17631. _this2.emit(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].INPUT_EVENT, _this2);
  17632. },
  17633. notifyChange: function notifyChange() {
  17634. _this2.emit(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].CHANGE_EVENT, _this2);
  17635. },
  17636. setThumbContainerStyleProperty: function setThumbContainerStyleProperty(propertyName, value) {
  17637. _this2.thumbContainer_.style.setProperty(propertyName, value);
  17638. },
  17639. setTrackStyleProperty: function setTrackStyleProperty(propertyName, value) {
  17640. _this2.track_.style.setProperty(propertyName, value);
  17641. },
  17642. setMarkerValue: function setMarkerValue(value) {
  17643. _this2.pinValueMarker_.innerText = value;
  17644. },
  17645. appendTrackMarkers: function appendTrackMarkers(numMarkers) {
  17646. var frag = document.createDocumentFragment();
  17647. for (var i = 0; i < numMarkers; i++) {
  17648. var marker = document.createElement('div');
  17649. marker.classList.add('mdc-slider__track-marker');
  17650. frag.appendChild(marker);
  17651. }
  17652. _this2.trackMarkerContainer_.appendChild(frag);
  17653. },
  17654. removeTrackMarkers: function removeTrackMarkers() {
  17655. while (_this2.trackMarkerContainer_.firstChild) {
  17656. _this2.trackMarkerContainer_.removeChild(_this2.trackMarkerContainer_.firstChild);
  17657. }
  17658. },
  17659. setLastTrackMarkersStyleProperty: function setLastTrackMarkersStyleProperty(propertyName, value) {
  17660. // We remove and append new nodes, thus, the last track marker must be dynamically found.
  17661. var lastTrackMarker = _this2.root_.querySelector(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].LAST_TRACK_MARKER_SELECTOR);
  17662. lastTrackMarker.style.setProperty(propertyName, value);
  17663. },
  17664. isRTL: function isRTL() {
  17665. return getComputedStyle(_this2.root_).direction === 'rtl';
  17666. }
  17667. });
  17668. }
  17669. }, {
  17670. key: 'initialSyncWithDOM',
  17671. value: function initialSyncWithDOM() {
  17672. var origValueNow = parseFloat(this.root_.getAttribute(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].ARIA_VALUENOW));
  17673. var min = parseFloat(this.root_.getAttribute(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].ARIA_VALUEMIN)) || this.min;
  17674. var max = parseFloat(this.root_.getAttribute(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].ARIA_VALUEMAX)) || this.max;
  17675. // min and max need to be set in the right order to avoid throwing an error
  17676. // when the new min is greater than the default max.
  17677. if (min >= this.max) {
  17678. this.max = max;
  17679. this.min = min;
  17680. } else {
  17681. this.min = min;
  17682. this.max = max;
  17683. }
  17684. this.step = parseFloat(this.root_.getAttribute(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].STEP_DATA_ATTR)) || this.step;
  17685. this.value = origValueNow || this.value;
  17686. this.disabled = this.root_.hasAttribute(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].ARIA_DISABLED) && this.root_.getAttribute(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].ARIA_DISABLED) !== 'false';
  17687. this.foundation_.setupTrackMarker();
  17688. }
  17689. }, {
  17690. key: 'layout',
  17691. value: function layout() {
  17692. this.foundation_.layout();
  17693. }
  17694. /** @param {number=} amount */
  17695. }, {
  17696. key: 'stepUp',
  17697. value: function stepUp() {
  17698. var amount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.step || 1;
  17699. this.value += amount;
  17700. }
  17701. /** @param {number=} amount */
  17702. }, {
  17703. key: 'stepDown',
  17704. value: function stepDown() {
  17705. var amount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.step || 1;
  17706. this.value -= amount;
  17707. }
  17708. }, {
  17709. key: 'value',
  17710. get: function get() {
  17711. return this.foundation_.getValue();
  17712. }
  17713. /** @param {number} value */
  17714. ,
  17715. set: function set(value) {
  17716. this.foundation_.setValue(value);
  17717. }
  17718. /** @return {number} */
  17719. }, {
  17720. key: 'min',
  17721. get: function get() {
  17722. return this.foundation_.getMin();
  17723. }
  17724. /** @param {number} min */
  17725. ,
  17726. set: function set(min) {
  17727. this.foundation_.setMin(min);
  17728. }
  17729. /** @return {number} */
  17730. }, {
  17731. key: 'max',
  17732. get: function get() {
  17733. return this.foundation_.getMax();
  17734. }
  17735. /** @param {number} max */
  17736. ,
  17737. set: function set(max) {
  17738. this.foundation_.setMax(max);
  17739. }
  17740. /** @return {number} */
  17741. }, {
  17742. key: 'step',
  17743. get: function get() {
  17744. return this.foundation_.getStep();
  17745. }
  17746. /** @param {number} step */
  17747. ,
  17748. set: function set(step) {
  17749. this.foundation_.setStep(step);
  17750. }
  17751. /** @return {boolean} */
  17752. }, {
  17753. key: 'disabled',
  17754. get: function get() {
  17755. return this.foundation_.isDisabled();
  17756. }
  17757. /** @param {boolean} disabled */
  17758. ,
  17759. set: function set(disabled) {
  17760. this.foundation_.setDisabled(disabled);
  17761. }
  17762. }]);
  17763. return MDCSlider;
  17764. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  17765. /***/ }),
  17766. /* 128 */
  17767. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17768. "use strict";
  17769. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__constants__ = __webpack_require__(52);
  17770. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(53);
  17771. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_animation_index__ = __webpack_require__(13);
  17772. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_base_foundation__ = __webpack_require__(0);
  17773. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  17774. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  17775. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  17776. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  17777. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  17778. /**
  17779. * @license
  17780. * Copyright 2017 Google Inc.
  17781. *
  17782. * Permission is hereby granted, free of charge, to any person obtaining a copy
  17783. * of this software and associated documentation files (the "Software"), to deal
  17784. * in the Software without restriction, including without limitation the rights
  17785. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  17786. * copies of the Software, and to permit persons to whom the Software is
  17787. * furnished to do so, subject to the following conditions:
  17788. *
  17789. * The above copyright notice and this permission notice shall be included in
  17790. * all copies or substantial portions of the Software.
  17791. *
  17792. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17793. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17794. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17795. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  17796. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  17797. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  17798. * THE SOFTWARE.
  17799. */
  17800. /** @enum {string} */
  17801. var KEY_IDS = {
  17802. ARROW_LEFT: 'ArrowLeft',
  17803. ARROW_RIGHT: 'ArrowRight',
  17804. ARROW_UP: 'ArrowUp',
  17805. ARROW_DOWN: 'ArrowDown',
  17806. HOME: 'Home',
  17807. END: 'End',
  17808. PAGE_UP: 'PageUp',
  17809. PAGE_DOWN: 'PageDown'
  17810. };
  17811. /** @enum {string} */
  17812. var MOVE_EVENT_MAP = {
  17813. 'mousedown': 'mousemove',
  17814. 'touchstart': 'touchmove',
  17815. 'pointerdown': 'pointermove'
  17816. };
  17817. var DOWN_EVENTS = ['mousedown', 'pointerdown', 'touchstart'];
  17818. var UP_EVENTS = ['mouseup', 'pointerup', 'touchend'];
  17819. /**
  17820. * @extends {MDCFoundation<!MDCSliderAdapter>}
  17821. */
  17822. var MDCSliderFoundation = function (_MDCFoundation) {
  17823. _inherits(MDCSliderFoundation, _MDCFoundation);
  17824. _createClass(MDCSliderFoundation, null, [{
  17825. key: 'cssClasses',
  17826. /** @return enum {cssClasses} */
  17827. get: function get() {
  17828. return __WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */];
  17829. }
  17830. /** @return enum {strings} */
  17831. }, {
  17832. key: 'strings',
  17833. get: function get() {
  17834. return __WEBPACK_IMPORTED_MODULE_0__constants__["c" /* strings */];
  17835. }
  17836. /** @return enum {numbers} */
  17837. }, {
  17838. key: 'numbers',
  17839. get: function get() {
  17840. return __WEBPACK_IMPORTED_MODULE_0__constants__["b" /* numbers */];
  17841. }
  17842. /** @return {!MDCSliderAdapter} */
  17843. }, {
  17844. key: 'defaultAdapter',
  17845. get: function get() {
  17846. return (/** @type {!MDCSliderAdapter} */{
  17847. hasClass: function hasClass() {
  17848. return (/* className: string */ /* boolean */false
  17849. );
  17850. },
  17851. addClass: function addClass() /* className: string */{},
  17852. removeClass: function removeClass() /* className: string */{},
  17853. getAttribute: function getAttribute() {
  17854. return (/* name: string */ /* string|null */null
  17855. );
  17856. },
  17857. setAttribute: function setAttribute() /* name: string, value: string */{},
  17858. removeAttribute: function removeAttribute() /* name: string */{},
  17859. computeBoundingRect: function computeBoundingRect() {
  17860. return (/* ClientRect */{
  17861. top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0
  17862. }
  17863. );
  17864. },
  17865. getTabIndex: function getTabIndex() {
  17866. return (/* number */0
  17867. );
  17868. },
  17869. registerInteractionHandler: function registerInteractionHandler() /* type: string, handler: EventListener */{},
  17870. deregisterInteractionHandler: function deregisterInteractionHandler() /* type: string, handler: EventListener */{},
  17871. registerThumbContainerInteractionHandler: function registerThumbContainerInteractionHandler() /* type: string, handler: EventListener */{},
  17872. deregisterThumbContainerInteractionHandler: function deregisterThumbContainerInteractionHandler() /* type: string, handler: EventListener */{},
  17873. registerBodyInteractionHandler: function registerBodyInteractionHandler() /* type: string, handler: EventListener */{},
  17874. deregisterBodyInteractionHandler: function deregisterBodyInteractionHandler() /* type: string, handler: EventListener */{},
  17875. registerResizeHandler: function registerResizeHandler() /* handler: EventListener */{},
  17876. deregisterResizeHandler: function deregisterResizeHandler() /* handler: EventListener */{},
  17877. notifyInput: function notifyInput() {},
  17878. notifyChange: function notifyChange() {},
  17879. setThumbContainerStyleProperty: function setThumbContainerStyleProperty() /* propertyName: string, value: string */{},
  17880. setTrackStyleProperty: function setTrackStyleProperty() /* propertyName: string, value: string */{},
  17881. setMarkerValue: function setMarkerValue() /* value: number */{},
  17882. appendTrackMarkers: function appendTrackMarkers() /* numMarkers: number */{},
  17883. removeTrackMarkers: function removeTrackMarkers() {},
  17884. setLastTrackMarkersStyleProperty: function setLastTrackMarkersStyleProperty() /* propertyName: string, value: string */{},
  17885. isRTL: function isRTL() {
  17886. return (/* boolean */false
  17887. );
  17888. }
  17889. }
  17890. );
  17891. }
  17892. /**
  17893. * Creates a new instance of MDCSliderFoundation
  17894. * @param {?MDCSliderAdapter} adapter
  17895. */
  17896. }]);
  17897. function MDCSliderFoundation(adapter) {
  17898. _classCallCheck(this, MDCSliderFoundation);
  17899. /** @private {?ClientRect} */
  17900. var _this = _possibleConstructorReturn(this, (MDCSliderFoundation.__proto__ || Object.getPrototypeOf(MDCSliderFoundation)).call(this, _extends(MDCSliderFoundation.defaultAdapter, adapter)));
  17901. _this.rect_ = null;
  17902. // We set this to NaN since we want it to be a number, but we can't use '0' or '-1'
  17903. // because those could be valid tabindices set by the client code.
  17904. _this.savedTabIndex_ = NaN;
  17905. _this.active_ = false;
  17906. _this.inTransit_ = false;
  17907. _this.isDiscrete_ = false;
  17908. _this.hasTrackMarker_ = false;
  17909. _this.handlingThumbTargetEvt_ = false;
  17910. _this.min_ = 0;
  17911. _this.max_ = 100;
  17912. _this.step_ = 0;
  17913. _this.value_ = 0;
  17914. _this.disabled_ = false;
  17915. _this.preventFocusState_ = false;
  17916. _this.updateUIFrame_ = 0;
  17917. _this.thumbContainerPointerHandler_ = function () {
  17918. _this.handlingThumbTargetEvt_ = true;
  17919. };
  17920. _this.interactionStartHandler_ = function (evt) {
  17921. return _this.handleDown_(evt);
  17922. };
  17923. _this.keydownHandler_ = function (evt) {
  17924. return _this.handleKeydown_(evt);
  17925. };
  17926. _this.focusHandler_ = function () {
  17927. return _this.handleFocus_();
  17928. };
  17929. _this.blurHandler_ = function () {
  17930. return _this.handleBlur_();
  17931. };
  17932. _this.resizeHandler_ = function () {
  17933. return _this.layout();
  17934. };
  17935. return _this;
  17936. }
  17937. _createClass(MDCSliderFoundation, [{
  17938. key: 'init',
  17939. value: function init() {
  17940. var _this2 = this;
  17941. this.isDiscrete_ = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].IS_DISCRETE);
  17942. this.hasTrackMarker_ = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].HAS_TRACK_MARKER);
  17943. DOWN_EVENTS.forEach(function (evtName) {
  17944. return _this2.adapter_.registerInteractionHandler(evtName, _this2.interactionStartHandler_);
  17945. });
  17946. this.adapter_.registerInteractionHandler('keydown', this.keydownHandler_);
  17947. this.adapter_.registerInteractionHandler('focus', this.focusHandler_);
  17948. this.adapter_.registerInteractionHandler('blur', this.blurHandler_);
  17949. DOWN_EVENTS.forEach(function (evtName) {
  17950. _this2.adapter_.registerThumbContainerInteractionHandler(evtName, _this2.thumbContainerPointerHandler_);
  17951. });
  17952. this.adapter_.registerResizeHandler(this.resizeHandler_);
  17953. this.layout();
  17954. // At last step, provide a reasonable default value to discrete slider
  17955. if (this.isDiscrete_ && this.getStep() == 0) {
  17956. this.step_ = 1;
  17957. }
  17958. }
  17959. }, {
  17960. key: 'destroy',
  17961. value: function destroy() {
  17962. var _this3 = this;
  17963. DOWN_EVENTS.forEach(function (evtName) {
  17964. _this3.adapter_.deregisterInteractionHandler(evtName, _this3.interactionStartHandler_);
  17965. });
  17966. this.adapter_.deregisterInteractionHandler('keydown', this.keydownHandler_);
  17967. this.adapter_.deregisterInteractionHandler('focus', this.focusHandler_);
  17968. this.adapter_.deregisterInteractionHandler('blur', this.blurHandler_);
  17969. DOWN_EVENTS.forEach(function (evtName) {
  17970. _this3.adapter_.deregisterThumbContainerInteractionHandler(evtName, _this3.thumbContainerPointerHandler_);
  17971. });
  17972. this.adapter_.deregisterResizeHandler(this.resizeHandler_);
  17973. }
  17974. }, {
  17975. key: 'setupTrackMarker',
  17976. value: function setupTrackMarker() {
  17977. if (this.isDiscrete_ && this.hasTrackMarker_ && this.getStep() != 0) {
  17978. var min = this.getMin();
  17979. var max = this.getMax();
  17980. var step = this.getStep();
  17981. var numMarkers = (max - min) / step;
  17982. // In case distance between max & min is indivisible to step,
  17983. // we place the secondary to last marker proportionally at where thumb
  17984. // could reach and place the last marker at max value
  17985. var indivisible = Math.ceil(numMarkers) !== numMarkers;
  17986. if (indivisible) {
  17987. numMarkers = Math.ceil(numMarkers);
  17988. }
  17989. this.adapter_.removeTrackMarkers();
  17990. this.adapter_.appendTrackMarkers(numMarkers);
  17991. if (indivisible) {
  17992. var lastStepRatio = (max - numMarkers * step) / step + 1;
  17993. var flex = Object(__WEBPACK_IMPORTED_MODULE_2__material_animation_index__["b" /* getCorrectPropertyName */])(window, 'flex');
  17994. this.adapter_.setLastTrackMarkersStyleProperty(flex, String(lastStepRatio));
  17995. }
  17996. }
  17997. }
  17998. }, {
  17999. key: 'layout',
  18000. value: function layout() {
  18001. this.rect_ = this.adapter_.computeBoundingRect();
  18002. this.updateUIForCurrentValue_();
  18003. }
  18004. /** @return {number} */
  18005. }, {
  18006. key: 'getValue',
  18007. value: function getValue() {
  18008. return this.value_;
  18009. }
  18010. /** @param {number} value */
  18011. }, {
  18012. key: 'setValue',
  18013. value: function setValue(value) {
  18014. this.setValue_(value, false);
  18015. }
  18016. /** @return {number} */
  18017. }, {
  18018. key: 'getMax',
  18019. value: function getMax() {
  18020. return this.max_;
  18021. }
  18022. /** @param {number} max */
  18023. }, {
  18024. key: 'setMax',
  18025. value: function setMax(max) {
  18026. if (max < this.min_) {
  18027. throw new Error('Cannot set max to be less than the slider\'s minimum value');
  18028. }
  18029. this.max_ = max;
  18030. this.setValue_(this.value_, false, true);
  18031. this.adapter_.setAttribute(__WEBPACK_IMPORTED_MODULE_0__constants__["c" /* strings */].ARIA_VALUEMAX, String(this.max_));
  18032. this.setupTrackMarker();
  18033. }
  18034. /** @return {number} */
  18035. }, {
  18036. key: 'getMin',
  18037. value: function getMin() {
  18038. return this.min_;
  18039. }
  18040. /** @param {number} min */
  18041. }, {
  18042. key: 'setMin',
  18043. value: function setMin(min) {
  18044. if (min > this.max_) {
  18045. throw new Error('Cannot set min to be greater than the slider\'s maximum value');
  18046. }
  18047. this.min_ = min;
  18048. this.setValue_(this.value_, false, true);
  18049. this.adapter_.setAttribute(__WEBPACK_IMPORTED_MODULE_0__constants__["c" /* strings */].ARIA_VALUEMIN, String(this.min_));
  18050. this.setupTrackMarker();
  18051. }
  18052. /** @return {number} */
  18053. }, {
  18054. key: 'getStep',
  18055. value: function getStep() {
  18056. return this.step_;
  18057. }
  18058. /** @param {number} step */
  18059. }, {
  18060. key: 'setStep',
  18061. value: function setStep(step) {
  18062. if (step < 0) {
  18063. throw new Error('Step cannot be set to a negative number');
  18064. }
  18065. if (this.isDiscrete_ && (typeof step !== 'number' || step < 1)) {
  18066. step = 1;
  18067. }
  18068. this.step_ = step;
  18069. this.setValue_(this.value_, false, true);
  18070. this.setupTrackMarker();
  18071. }
  18072. /** @return {boolean} */
  18073. }, {
  18074. key: 'isDisabled',
  18075. value: function isDisabled() {
  18076. return this.disabled_;
  18077. }
  18078. /** @param {boolean} disabled */
  18079. }, {
  18080. key: 'setDisabled',
  18081. value: function setDisabled(disabled) {
  18082. this.disabled_ = disabled;
  18083. this.toggleClass_(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].DISABLED, this.disabled_);
  18084. if (this.disabled_) {
  18085. this.savedTabIndex_ = this.adapter_.getTabIndex();
  18086. this.adapter_.setAttribute(__WEBPACK_IMPORTED_MODULE_0__constants__["c" /* strings */].ARIA_DISABLED, 'true');
  18087. this.adapter_.removeAttribute('tabindex');
  18088. } else {
  18089. this.adapter_.removeAttribute(__WEBPACK_IMPORTED_MODULE_0__constants__["c" /* strings */].ARIA_DISABLED);
  18090. if (!isNaN(this.savedTabIndex_)) {
  18091. this.adapter_.setAttribute('tabindex', String(this.savedTabIndex_));
  18092. }
  18093. }
  18094. }
  18095. /**
  18096. * Called when the user starts interacting with the slider
  18097. * @param {!Event} evt
  18098. * @private
  18099. */
  18100. }, {
  18101. key: 'handleDown_',
  18102. value: function handleDown_(evt) {
  18103. var _this4 = this;
  18104. if (this.disabled_) {
  18105. return;
  18106. }
  18107. this.preventFocusState_ = true;
  18108. this.setInTransit_(!this.handlingThumbTargetEvt_);
  18109. this.handlingThumbTargetEvt_ = false;
  18110. this.setActive_(true);
  18111. var moveHandler = function moveHandler(evt) {
  18112. _this4.handleMove_(evt);
  18113. };
  18114. // Note: upHandler is [de]registered on ALL potential pointer-related release event types, since some browsers
  18115. // do not always fire these consistently in pairs.
  18116. // (See https://github.com/material-components/material-components-web/issues/1192)
  18117. var upHandler = function upHandler() {
  18118. _this4.handleUp_();
  18119. _this4.adapter_.deregisterBodyInteractionHandler(MOVE_EVENT_MAP[evt.type], moveHandler);
  18120. UP_EVENTS.forEach(function (evtName) {
  18121. return _this4.adapter_.deregisterBodyInteractionHandler(evtName, upHandler);
  18122. });
  18123. };
  18124. this.adapter_.registerBodyInteractionHandler(MOVE_EVENT_MAP[evt.type], moveHandler);
  18125. UP_EVENTS.forEach(function (evtName) {
  18126. return _this4.adapter_.registerBodyInteractionHandler(evtName, upHandler);
  18127. });
  18128. this.setValueFromEvt_(evt);
  18129. }
  18130. /**
  18131. * Called when the user moves the slider
  18132. * @param {!Event} evt
  18133. * @private
  18134. */
  18135. }, {
  18136. key: 'handleMove_',
  18137. value: function handleMove_(evt) {
  18138. evt.preventDefault();
  18139. this.setValueFromEvt_(evt);
  18140. }
  18141. /**
  18142. * Called when the user's interaction with the slider ends
  18143. * @private
  18144. */
  18145. }, {
  18146. key: 'handleUp_',
  18147. value: function handleUp_() {
  18148. this.setActive_(false);
  18149. this.adapter_.notifyChange();
  18150. }
  18151. /**
  18152. * Returns the pageX of the event
  18153. * @param {!Event} evt
  18154. * @return {number}
  18155. * @private
  18156. */
  18157. }, {
  18158. key: 'getPageX_',
  18159. value: function getPageX_(evt) {
  18160. if (evt.targetTouches && evt.targetTouches.length > 0) {
  18161. return evt.targetTouches[0].pageX;
  18162. }
  18163. return evt.pageX;
  18164. }
  18165. /**
  18166. * Sets the slider value from an event
  18167. * @param {!Event} evt
  18168. * @private
  18169. */
  18170. }, {
  18171. key: 'setValueFromEvt_',
  18172. value: function setValueFromEvt_(evt) {
  18173. var pageX = this.getPageX_(evt);
  18174. var value = this.computeValueFromPageX_(pageX);
  18175. this.setValue_(value, true);
  18176. }
  18177. /**
  18178. * Computes the new value from the pageX position
  18179. * @param {number} pageX
  18180. * @return {number}
  18181. */
  18182. }, {
  18183. key: 'computeValueFromPageX_',
  18184. value: function computeValueFromPageX_(pageX) {
  18185. var max = this.max_,
  18186. min = this.min_;
  18187. var xPos = pageX - this.rect_.left;
  18188. var pctComplete = xPos / this.rect_.width;
  18189. if (this.adapter_.isRTL()) {
  18190. pctComplete = 1 - pctComplete;
  18191. }
  18192. // Fit the percentage complete between the range [min,max]
  18193. // by remapping from [0, 1] to [min, min+(max-min)].
  18194. return min + pctComplete * (max - min);
  18195. }
  18196. /**
  18197. * Handles keydown events
  18198. * @param {!Event} evt
  18199. */
  18200. }, {
  18201. key: 'handleKeydown_',
  18202. value: function handleKeydown_(evt) {
  18203. var keyId = this.getKeyId_(evt);
  18204. var value = this.getValueForKeyId_(keyId);
  18205. if (isNaN(value)) {
  18206. return;
  18207. }
  18208. // Prevent page from scrolling due to key presses that would normally scroll the page
  18209. evt.preventDefault();
  18210. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].FOCUS);
  18211. this.setValue_(value, true);
  18212. this.adapter_.notifyChange();
  18213. }
  18214. /**
  18215. * Returns the computed name of the event
  18216. * @param {!Event} kbdEvt
  18217. * @return {string}
  18218. */
  18219. }, {
  18220. key: 'getKeyId_',
  18221. value: function getKeyId_(kbdEvt) {
  18222. if (kbdEvt.key === KEY_IDS.ARROW_LEFT || kbdEvt.keyCode === 37) {
  18223. return KEY_IDS.ARROW_LEFT;
  18224. }
  18225. if (kbdEvt.key === KEY_IDS.ARROW_RIGHT || kbdEvt.keyCode === 39) {
  18226. return KEY_IDS.ARROW_RIGHT;
  18227. }
  18228. if (kbdEvt.key === KEY_IDS.ARROW_UP || kbdEvt.keyCode === 38) {
  18229. return KEY_IDS.ARROW_UP;
  18230. }
  18231. if (kbdEvt.key === KEY_IDS.ARROW_DOWN || kbdEvt.keyCode === 40) {
  18232. return KEY_IDS.ARROW_DOWN;
  18233. }
  18234. if (kbdEvt.key === KEY_IDS.HOME || kbdEvt.keyCode === 36) {
  18235. return KEY_IDS.HOME;
  18236. }
  18237. if (kbdEvt.key === KEY_IDS.END || kbdEvt.keyCode === 35) {
  18238. return KEY_IDS.END;
  18239. }
  18240. if (kbdEvt.key === KEY_IDS.PAGE_UP || kbdEvt.keyCode === 33) {
  18241. return KEY_IDS.PAGE_UP;
  18242. }
  18243. if (kbdEvt.key === KEY_IDS.PAGE_DOWN || kbdEvt.keyCode === 34) {
  18244. return KEY_IDS.PAGE_DOWN;
  18245. }
  18246. return '';
  18247. }
  18248. /**
  18249. * Computes the value given a keyboard key ID
  18250. * @param {string} keyId
  18251. * @return {number}
  18252. */
  18253. }, {
  18254. key: 'getValueForKeyId_',
  18255. value: function getValueForKeyId_(keyId) {
  18256. var max = this.max_,
  18257. min = this.min_,
  18258. step = this.step_;
  18259. var delta = step || (max - min) / 100;
  18260. var valueNeedsToBeFlipped = this.adapter_.isRTL() && (keyId === KEY_IDS.ARROW_LEFT || keyId === KEY_IDS.ARROW_RIGHT);
  18261. if (valueNeedsToBeFlipped) {
  18262. delta = -delta;
  18263. }
  18264. switch (keyId) {
  18265. case KEY_IDS.ARROW_LEFT:
  18266. case KEY_IDS.ARROW_DOWN:
  18267. return this.value_ - delta;
  18268. case KEY_IDS.ARROW_RIGHT:
  18269. case KEY_IDS.ARROW_UP:
  18270. return this.value_ + delta;
  18271. case KEY_IDS.HOME:
  18272. return this.min_;
  18273. case KEY_IDS.END:
  18274. return this.max_;
  18275. case KEY_IDS.PAGE_UP:
  18276. return this.value_ + delta * __WEBPACK_IMPORTED_MODULE_0__constants__["b" /* numbers */].PAGE_FACTOR;
  18277. case KEY_IDS.PAGE_DOWN:
  18278. return this.value_ - delta * __WEBPACK_IMPORTED_MODULE_0__constants__["b" /* numbers */].PAGE_FACTOR;
  18279. default:
  18280. return NaN;
  18281. }
  18282. }
  18283. }, {
  18284. key: 'handleFocus_',
  18285. value: function handleFocus_() {
  18286. if (this.preventFocusState_) {
  18287. return;
  18288. }
  18289. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].FOCUS);
  18290. }
  18291. }, {
  18292. key: 'handleBlur_',
  18293. value: function handleBlur_() {
  18294. this.preventFocusState_ = false;
  18295. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].FOCUS);
  18296. }
  18297. /**
  18298. * Sets the value of the slider
  18299. * @param {number} value
  18300. * @param {boolean} shouldFireInput
  18301. * @param {boolean=} force
  18302. */
  18303. }, {
  18304. key: 'setValue_',
  18305. value: function setValue_(value, shouldFireInput) {
  18306. var force = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  18307. if (value === this.value_ && !force) {
  18308. return;
  18309. }
  18310. var min = this.min_,
  18311. max = this.max_;
  18312. var valueSetToBoundary = value === min || value === max;
  18313. if (this.step_ && !valueSetToBoundary) {
  18314. value = this.quantize_(value);
  18315. }
  18316. if (value < min) {
  18317. value = min;
  18318. } else if (value > max) {
  18319. value = max;
  18320. }
  18321. this.value_ = value;
  18322. this.adapter_.setAttribute(__WEBPACK_IMPORTED_MODULE_0__constants__["c" /* strings */].ARIA_VALUENOW, String(this.value_));
  18323. this.updateUIForCurrentValue_();
  18324. if (shouldFireInput) {
  18325. this.adapter_.notifyInput();
  18326. if (this.isDiscrete_) {
  18327. this.adapter_.setMarkerValue(value);
  18328. }
  18329. }
  18330. }
  18331. /**
  18332. * Calculates the quantized value
  18333. * @param {number} value
  18334. * @return {number}
  18335. */
  18336. }, {
  18337. key: 'quantize_',
  18338. value: function quantize_(value) {
  18339. var numSteps = Math.round(value / this.step_);
  18340. var quantizedVal = numSteps * this.step_;
  18341. return quantizedVal;
  18342. }
  18343. }, {
  18344. key: 'updateUIForCurrentValue_',
  18345. value: function updateUIForCurrentValue_() {
  18346. var _this5 = this;
  18347. var max = this.max_,
  18348. min = this.min_,
  18349. value = this.value_;
  18350. var pctComplete = (value - min) / (max - min);
  18351. var translatePx = pctComplete * this.rect_.width;
  18352. if (this.adapter_.isRTL()) {
  18353. translatePx = this.rect_.width - translatePx;
  18354. }
  18355. var transformProp = Object(__WEBPACK_IMPORTED_MODULE_2__material_animation_index__["b" /* getCorrectPropertyName */])(window, 'transform');
  18356. var transitionendEvtName = Object(__WEBPACK_IMPORTED_MODULE_2__material_animation_index__["a" /* getCorrectEventName */])(window, 'transitionend');
  18357. if (this.inTransit_) {
  18358. var onTransitionEnd = function onTransitionEnd() {
  18359. _this5.setInTransit_(false);
  18360. _this5.adapter_.deregisterThumbContainerInteractionHandler(transitionendEvtName, onTransitionEnd);
  18361. };
  18362. this.adapter_.registerThumbContainerInteractionHandler(transitionendEvtName, onTransitionEnd);
  18363. }
  18364. this.updateUIFrame_ = requestAnimationFrame(function () {
  18365. // NOTE(traviskaufman): It would be nice to use calc() here,
  18366. // but IE cannot handle calcs in transforms correctly.
  18367. // See: https://goo.gl/NC2itk
  18368. // Also note that the -50% offset is used to center the slider thumb.
  18369. _this5.adapter_.setThumbContainerStyleProperty(transformProp, 'translateX(' + translatePx + 'px) translateX(-50%)');
  18370. _this5.adapter_.setTrackStyleProperty(transformProp, 'scaleX(' + pctComplete + ')');
  18371. });
  18372. }
  18373. /**
  18374. * Toggles the active state of the slider
  18375. * @param {boolean} active
  18376. */
  18377. }, {
  18378. key: 'setActive_',
  18379. value: function setActive_(active) {
  18380. this.active_ = active;
  18381. this.toggleClass_(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].ACTIVE, this.active_);
  18382. }
  18383. /**
  18384. * Toggles the inTransit state of the slider
  18385. * @param {boolean} inTransit
  18386. */
  18387. }, {
  18388. key: 'setInTransit_',
  18389. value: function setInTransit_(inTransit) {
  18390. this.inTransit_ = inTransit;
  18391. this.toggleClass_(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].IN_TRANSIT, this.inTransit_);
  18392. }
  18393. /**
  18394. * Conditionally adds or removes a class based on shouldBePresent
  18395. * @param {string} className
  18396. * @param {boolean} shouldBePresent
  18397. */
  18398. }, {
  18399. key: 'toggleClass_',
  18400. value: function toggleClass_(className, shouldBePresent) {
  18401. if (shouldBePresent) {
  18402. this.adapter_.addClass(className);
  18403. } else {
  18404. this.adapter_.removeClass(className);
  18405. }
  18406. }
  18407. }]);
  18408. return MDCSliderFoundation;
  18409. }(__WEBPACK_IMPORTED_MODULE_3__material_base_foundation__["a" /* default */]);
  18410. /* harmony default export */ __webpack_exports__["a"] = (MDCSliderFoundation);
  18411. /***/ }),
  18412. /* 129 */
  18413. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18414. "use strict";
  18415. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  18416. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSnackbar", function() { return MDCSnackbar; });
  18417. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  18418. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(130);
  18419. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(23);
  18420. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util__ = __webpack_require__(132);
  18421. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__material_dom_ponyfill__ = __webpack_require__(8);
  18422. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSnackbarFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__foundation__["a"]; });
  18423. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "util", function() { return __WEBPACK_IMPORTED_MODULE_3__util__; });
  18424. var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
  18425. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  18426. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18427. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  18428. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  18429. /**
  18430. * @license
  18431. * Copyright 2018 Google Inc.
  18432. *
  18433. * Permission is hereby granted, free of charge, to any person obtaining a copy
  18434. * of this software and associated documentation files (the "Software"), to deal
  18435. * in the Software without restriction, including without limitation the rights
  18436. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  18437. * copies of the Software, and to permit persons to whom the Software is
  18438. * furnished to do so, subject to the following conditions:
  18439. *
  18440. * The above copyright notice and this permission notice shall be included in
  18441. * all copies or substantial portions of the Software.
  18442. *
  18443. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18444. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18445. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18446. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18447. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18448. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  18449. * THE SOFTWARE.
  18450. */
  18451. var SURFACE_SELECTOR = __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].SURFACE_SELECTOR,
  18452. LABEL_SELECTOR = __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].LABEL_SELECTOR,
  18453. ACTION_SELECTOR = __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].ACTION_SELECTOR,
  18454. DISMISS_SELECTOR = __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].DISMISS_SELECTOR,
  18455. OPENING_EVENT = __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].OPENING_EVENT,
  18456. OPENED_EVENT = __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].OPENED_EVENT,
  18457. CLOSING_EVENT = __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].CLOSING_EVENT,
  18458. CLOSED_EVENT = __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].CLOSED_EVENT;
  18459. var MDCSnackbar = function (_MDCComponent) {
  18460. _inherits(MDCSnackbar, _MDCComponent);
  18461. _createClass(MDCSnackbar, null, [{
  18462. key: 'attachTo',
  18463. value: function attachTo(root) {
  18464. return new MDCSnackbar(root);
  18465. }
  18466. }]);
  18467. function MDCSnackbar() {
  18468. var _ref;
  18469. _classCallCheck(this, MDCSnackbar);
  18470. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  18471. args[_key] = arguments[_key];
  18472. }
  18473. /** @type {!HTMLElement} */
  18474. var _this = _possibleConstructorReturn(this, (_ref = MDCSnackbar.__proto__ || Object.getPrototypeOf(MDCSnackbar)).call.apply(_ref, [this].concat(args)));
  18475. _this.surfaceEl_;
  18476. /** @type {!HTMLElement} */
  18477. _this.labelEl_;
  18478. /** @type {!HTMLElement} */
  18479. _this.actionEl_;
  18480. /** @type {function(!HTMLElement, !HTMLElement=): void} */
  18481. _this.announce_;
  18482. /** @private {!Function} */
  18483. _this.handleKeyDown_;
  18484. /** @private {!Function} */
  18485. _this.handleSurfaceClick_;
  18486. return _this;
  18487. }
  18488. /**
  18489. * @param {function(): function(!HTMLElement, !HTMLElement=):void} announceFactory
  18490. */
  18491. _createClass(MDCSnackbar, [{
  18492. key: 'initialize',
  18493. value: function initialize() {
  18494. var announceFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {
  18495. return __WEBPACK_IMPORTED_MODULE_3__util__["announce"];
  18496. };
  18497. this.announce_ = announceFactory();
  18498. }
  18499. }, {
  18500. key: 'initialSyncWithDOM',
  18501. value: function initialSyncWithDOM() {
  18502. var _this2 = this;
  18503. this.surfaceEl_ = /** @type {!HTMLElement} */this.root_.querySelector(SURFACE_SELECTOR);
  18504. this.labelEl_ = /** @type {!HTMLElement} */this.root_.querySelector(LABEL_SELECTOR);
  18505. this.actionEl_ = /** @type {!HTMLElement} */this.root_.querySelector(ACTION_SELECTOR);
  18506. this.handleKeyDown_ = function (evt) {
  18507. return _this2.foundation_.handleKeyDown(evt);
  18508. };
  18509. this.handleSurfaceClick_ = function (evt) {
  18510. if (_this2.isActionButton_(evt.target)) {
  18511. _this2.foundation_.handleActionButtonClick(evt);
  18512. } else if (_this2.isActionIcon_(evt.target)) {
  18513. _this2.foundation_.handleActionIconClick(evt);
  18514. }
  18515. };
  18516. this.registerKeyDownHandler_(this.handleKeyDown_);
  18517. this.registerSurfaceClickHandler_(this.handleSurfaceClick_);
  18518. }
  18519. }, {
  18520. key: 'destroy',
  18521. value: function destroy() {
  18522. _get(MDCSnackbar.prototype.__proto__ || Object.getPrototypeOf(MDCSnackbar.prototype), 'destroy', this).call(this);
  18523. this.deregisterKeyDownHandler_(this.handleKeyDown_);
  18524. this.deregisterSurfaceClickHandler_(this.handleSurfaceClick_);
  18525. }
  18526. }, {
  18527. key: 'open',
  18528. value: function open() {
  18529. this.foundation_.open();
  18530. }
  18531. /**
  18532. * @param {string=} reason Why the snackbar was closed. Value will be passed to CLOSING_EVENT and CLOSED_EVENT via the
  18533. * `event.detail.reason` property. Standard values are REASON_ACTION and REASON_DISMISS, but custom
  18534. * client-specific values may also be used if desired.
  18535. */
  18536. }, {
  18537. key: 'close',
  18538. value: function close() {
  18539. var reason = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  18540. this.foundation_.close(reason);
  18541. }
  18542. /**
  18543. * @return {!MDCSnackbarFoundation}
  18544. */
  18545. }, {
  18546. key: 'getDefaultFoundation',
  18547. value: function getDefaultFoundation() {
  18548. var _this3 = this;
  18549. /* eslint brace-style: "off" */
  18550. return new __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]({
  18551. addClass: function addClass(className) {
  18552. return _this3.root_.classList.add(className);
  18553. },
  18554. removeClass: function removeClass(className) {
  18555. return _this3.root_.classList.remove(className);
  18556. },
  18557. announce: function announce() {
  18558. return _this3.announce_(_this3.labelEl_);
  18559. },
  18560. notifyOpening: function notifyOpening() {
  18561. return _this3.emit(OPENING_EVENT, {});
  18562. },
  18563. notifyOpened: function notifyOpened() {
  18564. return _this3.emit(OPENED_EVENT, {});
  18565. },
  18566. notifyClosing: function notifyClosing(reason) {
  18567. return _this3.emit(CLOSING_EVENT, reason ? { reason: reason } : {});
  18568. },
  18569. notifyClosed: function notifyClosed(reason) {
  18570. return _this3.emit(CLOSED_EVENT, reason ? { reason: reason } : {});
  18571. }
  18572. });
  18573. }
  18574. /**
  18575. * @return {number}
  18576. */
  18577. }, {
  18578. key: 'registerKeyDownHandler_',
  18579. /**
  18580. * @param {!Function} handler
  18581. * @private
  18582. */
  18583. value: function registerKeyDownHandler_(handler) {
  18584. this.listen('keydown', handler);
  18585. }
  18586. /**
  18587. * @param {!Function} handler
  18588. * @private
  18589. */
  18590. }, {
  18591. key: 'deregisterKeyDownHandler_',
  18592. value: function deregisterKeyDownHandler_(handler) {
  18593. this.unlisten('keydown', handler);
  18594. }
  18595. /**
  18596. * @param {!Function} handler
  18597. * @private
  18598. */
  18599. }, {
  18600. key: 'registerSurfaceClickHandler_',
  18601. value: function registerSurfaceClickHandler_(handler) {
  18602. this.surfaceEl_.addEventListener('click', handler);
  18603. }
  18604. /**
  18605. * @param {!Function} handler
  18606. * @private
  18607. */
  18608. }, {
  18609. key: 'deregisterSurfaceClickHandler_',
  18610. value: function deregisterSurfaceClickHandler_(handler) {
  18611. this.surfaceEl_.removeEventListener('click', handler);
  18612. }
  18613. /**
  18614. * @param {!Element} target
  18615. * @return {boolean}
  18616. * @private
  18617. */
  18618. }, {
  18619. key: 'isActionButton_',
  18620. value: function isActionButton_(target) {
  18621. return Boolean(__WEBPACK_IMPORTED_MODULE_4__material_dom_ponyfill__["closest"](target, ACTION_SELECTOR));
  18622. }
  18623. /**
  18624. * @param {!Element} target
  18625. * @return {boolean}
  18626. * @private
  18627. */
  18628. }, {
  18629. key: 'isActionIcon_',
  18630. value: function isActionIcon_(target) {
  18631. return Boolean(__WEBPACK_IMPORTED_MODULE_4__material_dom_ponyfill__["closest"](target, DISMISS_SELECTOR));
  18632. }
  18633. }, {
  18634. key: 'timeoutMs',
  18635. get: function get() {
  18636. return this.foundation_.getTimeoutMs();
  18637. }
  18638. /**
  18639. * @param {number} timeoutMs
  18640. */
  18641. ,
  18642. set: function set(timeoutMs) {
  18643. this.foundation_.setTimeoutMs(timeoutMs);
  18644. }
  18645. /**
  18646. * @return {boolean}
  18647. */
  18648. }, {
  18649. key: 'closeOnEscape',
  18650. get: function get() {
  18651. return this.foundation_.getCloseOnEscape();
  18652. }
  18653. /**
  18654. * @param {boolean} closeOnEscape
  18655. */
  18656. ,
  18657. set: function set(closeOnEscape) {
  18658. this.foundation_.setCloseOnEscape(closeOnEscape);
  18659. }
  18660. /**
  18661. * @return {boolean}
  18662. */
  18663. }, {
  18664. key: 'isOpen',
  18665. get: function get() {
  18666. return this.foundation_.isOpen();
  18667. }
  18668. /**
  18669. * @return {string}
  18670. */
  18671. }, {
  18672. key: 'labelText',
  18673. get: function get() {
  18674. return this.labelEl_.textContent;
  18675. }
  18676. /**
  18677. * @param {string} labelText
  18678. */
  18679. ,
  18680. set: function set(labelText) {
  18681. this.labelEl_.textContent = labelText;
  18682. }
  18683. /**
  18684. * @return {string}
  18685. */
  18686. }, {
  18687. key: 'actionButtonText',
  18688. get: function get() {
  18689. return this.actionEl_.textContent;
  18690. }
  18691. /**
  18692. * @param {string} actionButtonText
  18693. */
  18694. ,
  18695. set: function set(actionButtonText) {
  18696. this.actionEl_.textContent = actionButtonText;
  18697. }
  18698. }]);
  18699. return MDCSnackbar;
  18700. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  18701. /***/ }),
  18702. /* 130 */
  18703. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18704. "use strict";
  18705. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  18706. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(131);
  18707. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(23);
  18708. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  18709. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  18710. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18711. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  18712. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  18713. /**
  18714. * @license
  18715. * Copyright 2018 Google Inc.
  18716. *
  18717. * Permission is hereby granted, free of charge, to any person obtaining a copy
  18718. * of this software and associated documentation files (the "Software"), to deal
  18719. * in the Software without restriction, including without limitation the rights
  18720. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  18721. * copies of the Software, and to permit persons to whom the Software is
  18722. * furnished to do so, subject to the following conditions:
  18723. *
  18724. * The above copyright notice and this permission notice shall be included in
  18725. * all copies or substantial portions of the Software.
  18726. *
  18727. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18728. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18729. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18730. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18731. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18732. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  18733. * THE SOFTWARE.
  18734. */
  18735. /* eslint no-unused-vars: ["error", {"argsIgnorePattern": "evt", "varsIgnorePattern": "Adapter$"}] */
  18736. var OPENING = __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].OPENING,
  18737. OPEN = __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].OPEN,
  18738. CLOSING = __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CLOSING;
  18739. var REASON_ACTION = __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].REASON_ACTION,
  18740. REASON_DISMISS = __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].REASON_DISMISS;
  18741. var MDCSnackbarFoundation = function (_MDCFoundation) {
  18742. _inherits(MDCSnackbarFoundation, _MDCFoundation);
  18743. _createClass(MDCSnackbarFoundation, null, [{
  18744. key: 'cssClasses',
  18745. get: function get() {
  18746. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  18747. }
  18748. }, {
  18749. key: 'strings',
  18750. get: function get() {
  18751. return __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */];
  18752. }
  18753. }, {
  18754. key: 'numbers',
  18755. get: function get() {
  18756. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */];
  18757. }
  18758. /**
  18759. * @return {!MDCSnackbarAdapter}
  18760. */
  18761. }, {
  18762. key: 'defaultAdapter',
  18763. get: function get() {
  18764. return (/** @type {!MDCSnackbarAdapter} */{
  18765. addClass: function addClass() /* className: string */{},
  18766. removeClass: function removeClass() /* className: string */{},
  18767. announce: function announce() {},
  18768. notifyOpening: function notifyOpening() {},
  18769. notifyOpened: function notifyOpened() {},
  18770. notifyClosing: function notifyClosing() /* reason: string */{},
  18771. notifyClosed: function notifyClosed() /* reason: string */{}
  18772. }
  18773. );
  18774. }
  18775. /**
  18776. * @param {!MDCSnackbarAdapter=} adapter
  18777. */
  18778. }]);
  18779. function MDCSnackbarFoundation(adapter) {
  18780. _classCallCheck(this, MDCSnackbarFoundation);
  18781. /** @private {boolean} */
  18782. var _this = _possibleConstructorReturn(this, (MDCSnackbarFoundation.__proto__ || Object.getPrototypeOf(MDCSnackbarFoundation)).call(this, _extends(MDCSnackbarFoundation.defaultAdapter, adapter)));
  18783. _this.isOpen_ = false;
  18784. /** @private {number} */
  18785. _this.animationFrame_ = 0;
  18786. /** @private {number} */
  18787. _this.animationTimer_ = 0;
  18788. /** @private {number} */
  18789. _this.autoDismissTimer_ = 0;
  18790. /** @private {number} */
  18791. _this.autoDismissTimeoutMs_ = __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].DEFAULT_AUTO_DISMISS_TIMEOUT_MS;
  18792. /** @private {boolean} */
  18793. _this.closeOnEscape_ = true;
  18794. return _this;
  18795. }
  18796. _createClass(MDCSnackbarFoundation, [{
  18797. key: 'destroy',
  18798. value: function destroy() {
  18799. this.clearAutoDismissTimer_();
  18800. cancelAnimationFrame(this.animationFrame_);
  18801. this.animationFrame_ = 0;
  18802. clearTimeout(this.animationTimer_);
  18803. this.animationTimer_ = 0;
  18804. this.adapter_.removeClass(OPENING);
  18805. this.adapter_.removeClass(OPEN);
  18806. this.adapter_.removeClass(CLOSING);
  18807. }
  18808. }, {
  18809. key: 'open',
  18810. value: function open() {
  18811. var _this2 = this;
  18812. this.clearAutoDismissTimer_();
  18813. this.isOpen_ = true;
  18814. this.adapter_.notifyOpening();
  18815. this.adapter_.removeClass(CLOSING);
  18816. this.adapter_.addClass(OPENING);
  18817. this.adapter_.announce();
  18818. // Wait a frame once display is no longer "none", to establish basis for animation
  18819. this.runNextAnimationFrame_(function () {
  18820. _this2.adapter_.addClass(OPEN);
  18821. _this2.animationTimer_ = setTimeout(function () {
  18822. _this2.handleAnimationTimerEnd_();
  18823. _this2.adapter_.notifyOpened();
  18824. _this2.autoDismissTimer_ = setTimeout(function () {
  18825. _this2.close(REASON_DISMISS);
  18826. }, _this2.getTimeoutMs());
  18827. }, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].SNACKBAR_ANIMATION_OPEN_TIME_MS);
  18828. });
  18829. }
  18830. /**
  18831. * @param {string=} reason Why the snackbar was closed. Value will be passed to CLOSING_EVENT and CLOSED_EVENT via the
  18832. * `event.detail.reason` property. Standard values are REASON_ACTION and REASON_DISMISS, but custom
  18833. * client-specific values may also be used if desired.
  18834. */
  18835. }, {
  18836. key: 'close',
  18837. value: function close() {
  18838. var _this3 = this;
  18839. var reason = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  18840. if (!this.isOpen_) {
  18841. // Avoid redundant close calls (and events), e.g. repeated interactions as the snackbar is animating closed
  18842. return;
  18843. }
  18844. cancelAnimationFrame(this.animationFrame_);
  18845. this.animationFrame_ = 0;
  18846. this.clearAutoDismissTimer_();
  18847. this.isOpen_ = false;
  18848. this.adapter_.notifyClosing(reason);
  18849. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CLOSING);
  18850. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].OPEN);
  18851. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].OPENING);
  18852. clearTimeout(this.animationTimer_);
  18853. this.animationTimer_ = setTimeout(function () {
  18854. _this3.handleAnimationTimerEnd_();
  18855. _this3.adapter_.notifyClosed(reason);
  18856. }, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].SNACKBAR_ANIMATION_CLOSE_TIME_MS);
  18857. }
  18858. /**
  18859. * @return {boolean}
  18860. */
  18861. }, {
  18862. key: 'isOpen',
  18863. value: function isOpen() {
  18864. return this.isOpen_;
  18865. }
  18866. /**
  18867. * @return {number}
  18868. */
  18869. }, {
  18870. key: 'getTimeoutMs',
  18871. value: function getTimeoutMs() {
  18872. return this.autoDismissTimeoutMs_;
  18873. }
  18874. /**
  18875. * @param {number} timeoutMs
  18876. */
  18877. }, {
  18878. key: 'setTimeoutMs',
  18879. value: function setTimeoutMs(timeoutMs) {
  18880. // Use shorter variable names to make the code more readable
  18881. var minValue = __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].MIN_AUTO_DISMISS_TIMEOUT_MS;
  18882. var maxValue = __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].MAX_AUTO_DISMISS_TIMEOUT_MS;
  18883. if (timeoutMs <= maxValue && timeoutMs >= minValue) {
  18884. this.autoDismissTimeoutMs_ = timeoutMs;
  18885. } else {
  18886. throw new Error('timeoutMs must be an integer in the range ' + minValue + '\u2013' + maxValue + ', but got \'' + timeoutMs + '\'');
  18887. }
  18888. }
  18889. /**
  18890. * @return {boolean}
  18891. */
  18892. }, {
  18893. key: 'getCloseOnEscape',
  18894. value: function getCloseOnEscape() {
  18895. return this.closeOnEscape_;
  18896. }
  18897. /**
  18898. * @param {boolean} closeOnEscape
  18899. */
  18900. }, {
  18901. key: 'setCloseOnEscape',
  18902. value: function setCloseOnEscape(closeOnEscape) {
  18903. this.closeOnEscape_ = closeOnEscape;
  18904. }
  18905. /**
  18906. * @param {!KeyboardEvent} evt
  18907. */
  18908. }, {
  18909. key: 'handleKeyDown',
  18910. value: function handleKeyDown(evt) {
  18911. if (this.getCloseOnEscape() && (evt.key === 'Escape' || evt.keyCode === 27)) {
  18912. this.close(REASON_DISMISS);
  18913. }
  18914. }
  18915. /**
  18916. * @param {!MouseEvent} evt
  18917. */
  18918. }, {
  18919. key: 'handleActionButtonClick',
  18920. value: function handleActionButtonClick(evt) {
  18921. this.close(REASON_ACTION);
  18922. }
  18923. /**
  18924. * @param {!MouseEvent} evt
  18925. */
  18926. }, {
  18927. key: 'handleActionIconClick',
  18928. value: function handleActionIconClick(evt) {
  18929. this.close(REASON_DISMISS);
  18930. }
  18931. /** @private */
  18932. }, {
  18933. key: 'clearAutoDismissTimer_',
  18934. value: function clearAutoDismissTimer_() {
  18935. clearTimeout(this.autoDismissTimer_);
  18936. this.autoDismissTimer_ = 0;
  18937. }
  18938. /** @private */
  18939. }, {
  18940. key: 'handleAnimationTimerEnd_',
  18941. value: function handleAnimationTimerEnd_() {
  18942. this.animationTimer_ = 0;
  18943. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].OPENING);
  18944. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CLOSING);
  18945. }
  18946. /**
  18947. * Runs the given logic on the next animation frame, using setTimeout to factor in Firefox reflow behavior.
  18948. * @param {Function} callback
  18949. * @private
  18950. */
  18951. }, {
  18952. key: 'runNextAnimationFrame_',
  18953. value: function runNextAnimationFrame_(callback) {
  18954. var _this4 = this;
  18955. cancelAnimationFrame(this.animationFrame_);
  18956. this.animationFrame_ = requestAnimationFrame(function () {
  18957. _this4.animationFrame_ = 0;
  18958. clearTimeout(_this4.animationTimer_);
  18959. _this4.animationTimer_ = setTimeout(callback, 0);
  18960. });
  18961. }
  18962. }]);
  18963. return MDCSnackbarFoundation;
  18964. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  18965. /* harmony default export */ __webpack_exports__["a"] = (MDCSnackbarFoundation);
  18966. /***/ }),
  18967. /* 131 */
  18968. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18969. "use strict";
  18970. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  18971. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18972. /**
  18973. * @license
  18974. * Copyright 2018 Google Inc.
  18975. *
  18976. * Permission is hereby granted, free of charge, to any person obtaining a copy
  18977. * of this software and associated documentation files (the "Software"), to deal
  18978. * in the Software without restriction, including without limitation the rights
  18979. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  18980. * copies of the Software, and to permit persons to whom the Software is
  18981. * furnished to do so, subject to the following conditions:
  18982. *
  18983. * The above copyright notice and this permission notice shall be included in
  18984. * all copies or substantial portions of the Software.
  18985. *
  18986. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18987. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18988. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18989. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18990. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18991. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  18992. * THE SOFTWARE.
  18993. */
  18994. /* eslint no-unused-vars: [2, {"args": "none"}] */
  18995. /**
  18996. * Adapter for MDC Snackbar. Provides an interface for managing:
  18997. * - CSS classes
  18998. * - Event handlers
  18999. *
  19000. * Additionally, provides type information for the adapter to the Closure
  19001. * compiler.
  19002. *
  19003. * Implement this adapter for your framework of choice to delegate updates to
  19004. * the component in your framework of choice. See architecture documentation
  19005. * for more details.
  19006. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  19007. *
  19008. * @record
  19009. */
  19010. var MDCSnackbarAdapter = function () {
  19011. function MDCSnackbarAdapter() {
  19012. _classCallCheck(this, MDCSnackbarAdapter);
  19013. }
  19014. _createClass(MDCSnackbarAdapter, [{
  19015. key: "addClass",
  19016. /** @param {string} className */
  19017. value: function addClass(className) {}
  19018. /** @param {string} className */
  19019. }, {
  19020. key: "removeClass",
  19021. value: function removeClass(className) {}
  19022. }, {
  19023. key: "announce",
  19024. value: function announce() {}
  19025. }, {
  19026. key: "notifyOpening",
  19027. value: function notifyOpening() {}
  19028. }, {
  19029. key: "notifyOpened",
  19030. value: function notifyOpened() {}
  19031. /**
  19032. * @param {string} reason
  19033. */
  19034. }, {
  19035. key: "notifyClosing",
  19036. value: function notifyClosing(reason) {}
  19037. /**
  19038. * @param {string} reason
  19039. */
  19040. }, {
  19041. key: "notifyClosed",
  19042. value: function notifyClosed(reason) {}
  19043. }]);
  19044. return MDCSnackbarAdapter;
  19045. }();
  19046. /* unused harmony default export */ var _unused_webpack_default_export = (MDCSnackbarAdapter);
  19047. /***/ }),
  19048. /* 132 */
  19049. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19050. "use strict";
  19051. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  19052. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "announce", function() { return announce; });
  19053. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__constants__ = __webpack_require__(23);
  19054. /**
  19055. * @license
  19056. * Copyright 2018 Google Inc.
  19057. *
  19058. * Permission is hereby granted, free of charge, to any person obtaining a copy
  19059. * of this software and associated documentation files (the "Software"), to deal
  19060. * in the Software without restriction, including without limitation the rights
  19061. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  19062. * copies of the Software, and to permit persons to whom the Software is
  19063. * furnished to do so, subject to the following conditions:
  19064. *
  19065. * The above copyright notice and this permission notice shall be included in
  19066. * all copies or substantial portions of the Software.
  19067. *
  19068. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19069. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19070. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19071. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19072. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19073. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19074. * THE SOFTWARE.
  19075. */
  19076. var ARIA_LIVE_DELAY_MS = __WEBPACK_IMPORTED_MODULE_0__constants__["b" /* numbers */].ARIA_LIVE_DELAY_MS;
  19077. var ARIA_LIVE_LABEL_TEXT_ATTR = __WEBPACK_IMPORTED_MODULE_0__constants__["c" /* strings */].ARIA_LIVE_LABEL_TEXT_ATTR;
  19078. /**
  19079. * @param {!HTMLElement} ariaEl
  19080. * @param {!HTMLElement=} labelEl
  19081. */
  19082. function announce(ariaEl) {
  19083. var labelEl = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ariaEl;
  19084. var priority = ariaEl.getAttribute('aria-live');
  19085. var labelText = labelEl.textContent.trim(); // Ignore `&nbsp;` (see below)
  19086. if (!labelText) {
  19087. return;
  19088. }
  19089. // Temporarily disable `aria-live` to prevent JAWS+Firefox from announcing the message twice.
  19090. ariaEl.setAttribute('aria-live', 'off');
  19091. // Temporarily clear `textContent` to force a DOM mutation event that will be detected by screen readers.
  19092. // `aria-live` elements are only announced when the element's `textContent` *changes*, so snackbars
  19093. // sent to the browser in the initial HTML response won't be read unless we clear the element's `textContent` first.
  19094. // Similarly, displaying the same snackbar message twice in a row doesn't trigger a DOM mutation event,
  19095. // so screen readers won't announce the second message unless we first clear `textContent`.
  19096. //
  19097. // We have to clear the label text two different ways to make it work in all browsers and screen readers:
  19098. //
  19099. // 1. `textContent = ''` is required for IE11 + JAWS
  19100. // 2. `innerHTML = '&nbsp;'` is required for Chrome + JAWS and NVDA
  19101. //
  19102. // All other browser/screen reader combinations support both methods.
  19103. //
  19104. // The wrapper `<span>` visually hides the space character so that it doesn't cause jank when added/removed.
  19105. // N.B.: Setting `position: absolute`, `opacity: 0`, or `height: 0` prevents Chrome from detecting the DOM change.
  19106. //
  19107. // This technique has been tested in:
  19108. //
  19109. // * JAWS 2019:
  19110. // - Chrome 70
  19111. // - Firefox 60 (ESR)
  19112. // - IE 11
  19113. // * NVDA 2018:
  19114. // - Chrome 70
  19115. // - Firefox 60 (ESR)
  19116. // - IE 11
  19117. // * ChromeVox 53
  19118. labelEl.textContent = '';
  19119. labelEl.innerHTML = '<span style="display: inline-block; width: 0; height: 1px;">&nbsp;</span>';
  19120. // Prevent visual jank by temporarily displaying the label text in the ::before pseudo-element.
  19121. // CSS generated content is normally announced by screen readers
  19122. // (except in IE 11; see https://tink.uk/accessibility-support-for-css-generated-content/);
  19123. // however, `aria-live` is turned off, so this DOM update will be ignored by screen readers.
  19124. labelEl.setAttribute(ARIA_LIVE_LABEL_TEXT_ATTR, labelText);
  19125. setTimeout(function () {
  19126. // Allow screen readers to announce changes to the DOM again.
  19127. ariaEl.setAttribute('aria-live', priority);
  19128. // Remove the message from the ::before pseudo-element.
  19129. labelEl.removeAttribute(ARIA_LIVE_LABEL_TEXT_ATTR);
  19130. // Restore the original label text, which will be announced by screen readers.
  19131. labelEl.textContent = labelText;
  19132. }, ARIA_LIVE_DELAY_MS);
  19133. }
  19134. /***/ }),
  19135. /* 133 */
  19136. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19137. "use strict";
  19138. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  19139. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSwitch", function() { return MDCSwitch; });
  19140. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  19141. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_selection_control_index__ = __webpack_require__(3);
  19142. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(134);
  19143. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_ripple_index__ = __webpack_require__(2);
  19144. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__material_ripple_util__ = __webpack_require__(5);
  19145. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSwitchFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  19146. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  19147. var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
  19148. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  19149. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19150. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  19151. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  19152. /**
  19153. * @license
  19154. * Copyright 2018 Google Inc.
  19155. *
  19156. * Permission is hereby granted, free of charge, to any person obtaining a copy
  19157. * of this software and associated documentation files (the "Software"), to deal
  19158. * in the Software without restriction, including without limitation the rights
  19159. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  19160. * copies of the Software, and to permit persons to whom the Software is
  19161. * furnished to do so, subject to the following conditions:
  19162. *
  19163. * The above copyright notice and this permission notice shall be included in
  19164. * all copies or substantial portions of the Software.
  19165. *
  19166. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19167. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19168. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19169. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19170. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19171. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19172. * THE SOFTWARE.
  19173. */
  19174. /* eslint-disable no-unused-vars */
  19175. /* eslint-enable no-unused-vars */
  19176. /**
  19177. * @extends MDCComponent<!MDCSwitchFoundation>
  19178. * @implements {MDCSelectionControl}
  19179. */
  19180. var MDCSwitch = function (_MDCComponent) {
  19181. _inherits(MDCSwitch, _MDCComponent);
  19182. _createClass(MDCSwitch, null, [{
  19183. key: 'attachTo',
  19184. value: function attachTo(root) {
  19185. return new MDCSwitch(root);
  19186. }
  19187. }]);
  19188. function MDCSwitch() {
  19189. var _ref;
  19190. _classCallCheck(this, MDCSwitch);
  19191. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  19192. args[_key] = arguments[_key];
  19193. }
  19194. /** @private {!MDCRipple} */
  19195. var _this = _possibleConstructorReturn(this, (_ref = MDCSwitch.__proto__ || Object.getPrototypeOf(MDCSwitch)).call.apply(_ref, [this].concat(args)));
  19196. _this.ripple_ = _this.initRipple_();
  19197. /** @private {!Function} */
  19198. _this.changeHandler_;
  19199. return _this;
  19200. }
  19201. _createClass(MDCSwitch, [{
  19202. key: 'destroy',
  19203. value: function destroy() {
  19204. _get(MDCSwitch.prototype.__proto__ || Object.getPrototypeOf(MDCSwitch.prototype), 'destroy', this).call(this);
  19205. this.ripple_.destroy();
  19206. this.nativeControl_.removeEventListener('change', this.changeHandler_);
  19207. }
  19208. }, {
  19209. key: 'initialSyncWithDOM',
  19210. value: function initialSyncWithDOM() {
  19211. this.changeHandler_ = this.foundation_.handleChange.bind(this.foundation_);
  19212. this.nativeControl_.addEventListener('change', this.changeHandler_);
  19213. // Sometimes the checked state of the input element is saved in the history.
  19214. // The switch styling should match the checked state of the input element.
  19215. // Do an initial sync between the native control and the foundation.
  19216. this.checked = this.checked;
  19217. }
  19218. /**
  19219. * Returns the state of the native control element, or null if the native control element is not present.
  19220. * @return {?MDCSelectionControlState}
  19221. * @private
  19222. */
  19223. }, {
  19224. key: 'initRipple_',
  19225. /**
  19226. * @return {!MDCRipple}
  19227. * @private
  19228. */
  19229. value: function initRipple_() {
  19230. var _this2 = this;
  19231. var RIPPLE_SURFACE_SELECTOR = __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.RIPPLE_SURFACE_SELECTOR;
  19232. var rippleSurface = /** @type {!Element} */this.root_.querySelector(RIPPLE_SURFACE_SELECTOR);
  19233. var MATCHES = Object(__WEBPACK_IMPORTED_MODULE_4__material_ripple_util__["getMatchesProperty"])(HTMLElement.prototype);
  19234. var adapter = _extends(__WEBPACK_IMPORTED_MODULE_3__material_ripple_index__["MDCRipple"].createAdapter(this), {
  19235. isUnbounded: function isUnbounded() {
  19236. return true;
  19237. },
  19238. isSurfaceActive: function isSurfaceActive() {
  19239. return _this2.nativeControl_[MATCHES](':active');
  19240. },
  19241. addClass: function addClass(className) {
  19242. return rippleSurface.classList.add(className);
  19243. },
  19244. removeClass: function removeClass(className) {
  19245. return rippleSurface.classList.remove(className);
  19246. },
  19247. registerInteractionHandler: function registerInteractionHandler(type, handler) {
  19248. return _this2.nativeControl_.addEventListener(type, handler);
  19249. },
  19250. deregisterInteractionHandler: function deregisterInteractionHandler(type, handler) {
  19251. return _this2.nativeControl_.removeEventListener(type, handler);
  19252. },
  19253. updateCssVariable: function updateCssVariable(varName, value) {
  19254. return rippleSurface.style.setProperty(varName, value);
  19255. },
  19256. computeBoundingRect: function computeBoundingRect() {
  19257. return rippleSurface.getBoundingClientRect();
  19258. }
  19259. });
  19260. var foundation = new __WEBPACK_IMPORTED_MODULE_3__material_ripple_index__["MDCRippleFoundation"](adapter);
  19261. return new __WEBPACK_IMPORTED_MODULE_3__material_ripple_index__["MDCRipple"](this.root_, foundation);
  19262. }
  19263. /** @return {!MDCSwitchFoundation} */
  19264. }, {
  19265. key: 'getDefaultFoundation',
  19266. value: function getDefaultFoundation() {
  19267. var _this3 = this;
  19268. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]({
  19269. addClass: function addClass(className) {
  19270. return _this3.root_.classList.add(className);
  19271. },
  19272. removeClass: function removeClass(className) {
  19273. return _this3.root_.classList.remove(className);
  19274. },
  19275. setNativeControlChecked: function setNativeControlChecked(checked) {
  19276. return _this3.nativeControl_.checked = checked;
  19277. },
  19278. setNativeControlDisabled: function setNativeControlDisabled(disabled) {
  19279. return _this3.nativeControl_.disabled = disabled;
  19280. }
  19281. });
  19282. }
  19283. /** @return {!MDCRipple} */
  19284. }, {
  19285. key: 'nativeControl_',
  19286. get: function get() {
  19287. var NATIVE_CONTROL_SELECTOR = __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.NATIVE_CONTROL_SELECTOR;
  19288. var el = /** @type {?MDCSelectionControlState} */this.root_.querySelector(NATIVE_CONTROL_SELECTOR);
  19289. return el;
  19290. }
  19291. }, {
  19292. key: 'ripple',
  19293. get: function get() {
  19294. return this.ripple_;
  19295. }
  19296. /** @return {boolean} */
  19297. }, {
  19298. key: 'checked',
  19299. get: function get() {
  19300. return this.nativeControl_.checked;
  19301. }
  19302. /** @param {boolean} checked */
  19303. ,
  19304. set: function set(checked) {
  19305. this.foundation_.setChecked(checked);
  19306. }
  19307. /** @return {boolean} */
  19308. }, {
  19309. key: 'disabled',
  19310. get: function get() {
  19311. return this.nativeControl_.disabled;
  19312. }
  19313. /** @param {boolean} disabled */
  19314. ,
  19315. set: function set(disabled) {
  19316. this.foundation_.setDisabled(disabled);
  19317. }
  19318. }]);
  19319. return MDCSwitch;
  19320. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  19321. /***/ }),
  19322. /* 134 */
  19323. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19324. "use strict";
  19325. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  19326. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(135);
  19327. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(136);
  19328. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  19329. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  19330. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19331. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  19332. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  19333. /**
  19334. * @license
  19335. * Copyright 2018 Google Inc.
  19336. *
  19337. * Permission is hereby granted, free of charge, to any person obtaining a copy
  19338. * of this software and associated documentation files (the "Software"), to deal
  19339. * in the Software without restriction, including without limitation the rights
  19340. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  19341. * copies of the Software, and to permit persons to whom the Software is
  19342. * furnished to do so, subject to the following conditions:
  19343. *
  19344. * The above copyright notice and this permission notice shall be included in
  19345. * all copies or substantial portions of the Software.
  19346. *
  19347. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19348. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19349. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19350. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19351. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19352. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19353. * THE SOFTWARE.
  19354. */
  19355. /* eslint-enable no-unused-vars */
  19356. /**
  19357. * @extends {MDCFoundation<!MDCSwitchAdapter>}
  19358. */
  19359. var MDCSwitchFoundation = function (_MDCFoundation) {
  19360. _inherits(MDCSwitchFoundation, _MDCFoundation);
  19361. _createClass(MDCSwitchFoundation, null, [{
  19362. key: 'strings',
  19363. /** @return enum {string} */
  19364. get: function get() {
  19365. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  19366. }
  19367. /** @return enum {string} */
  19368. }, {
  19369. key: 'cssClasses',
  19370. get: function get() {
  19371. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  19372. }
  19373. /** @return {!MDCSwitchAdapter} */
  19374. }, {
  19375. key: 'defaultAdapter',
  19376. get: function get() {
  19377. return (/** @type {!MDCSwitchAdapter} */{
  19378. addClass: function addClass() /* className: string */{},
  19379. removeClass: function removeClass() /* className: string */{},
  19380. setNativeControlChecked: function setNativeControlChecked() /* checked: boolean */{},
  19381. setNativeControlDisabled: function setNativeControlDisabled() /* disabled: boolean */{}
  19382. }
  19383. );
  19384. }
  19385. }]);
  19386. function MDCSwitchFoundation(adapter) {
  19387. _classCallCheck(this, MDCSwitchFoundation);
  19388. return _possibleConstructorReturn(this, (MDCSwitchFoundation.__proto__ || Object.getPrototypeOf(MDCSwitchFoundation)).call(this, _extends(MDCSwitchFoundation.defaultAdapter, adapter)));
  19389. }
  19390. /** @param {boolean} checked */
  19391. _createClass(MDCSwitchFoundation, [{
  19392. key: 'setChecked',
  19393. value: function setChecked(checked) {
  19394. this.adapter_.setNativeControlChecked(checked);
  19395. this.updateCheckedStyling_(checked);
  19396. }
  19397. /** @param {boolean} disabled */
  19398. }, {
  19399. key: 'setDisabled',
  19400. value: function setDisabled(disabled) {
  19401. this.adapter_.setNativeControlDisabled(disabled);
  19402. if (disabled) {
  19403. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].DISABLED);
  19404. } else {
  19405. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].DISABLED);
  19406. }
  19407. }
  19408. /**
  19409. * Handles the change event for the switch native control.
  19410. * @param {!Event} evt
  19411. */
  19412. }, {
  19413. key: 'handleChange',
  19414. value: function handleChange(evt) {
  19415. this.updateCheckedStyling_(evt.target.checked);
  19416. }
  19417. /**
  19418. * Updates the styling of the switch based on its checked state.
  19419. * @param {boolean} checked
  19420. * @private
  19421. */
  19422. }, {
  19423. key: 'updateCheckedStyling_',
  19424. value: function updateCheckedStyling_(checked) {
  19425. if (checked) {
  19426. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CHECKED);
  19427. } else {
  19428. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CHECKED);
  19429. }
  19430. }
  19431. }]);
  19432. return MDCSwitchFoundation;
  19433. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  19434. /* harmony default export */ __webpack_exports__["a"] = (MDCSwitchFoundation);
  19435. /***/ }),
  19436. /* 135 */
  19437. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19438. "use strict";
  19439. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  19440. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19441. /**
  19442. * @license
  19443. * Copyright 2018 Google Inc.
  19444. *
  19445. * Permission is hereby granted, free of charge, to any person obtaining a copy
  19446. * of this software and associated documentation files (the "Software"), to deal
  19447. * in the Software without restriction, including without limitation the rights
  19448. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  19449. * copies of the Software, and to permit persons to whom the Software is
  19450. * furnished to do so, subject to the following conditions:
  19451. *
  19452. * The above copyright notice and this permission notice shall be included in
  19453. * all copies or substantial portions of the Software.
  19454. *
  19455. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19456. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19457. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19458. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19459. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19460. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19461. * THE SOFTWARE.
  19462. */
  19463. /* eslint no-unused-vars: [2, {"args": "none"}] */
  19464. /**
  19465. * Adapter for MDC Switch. Provides an interface for managing
  19466. * - classes
  19467. * - dom
  19468. *
  19469. * Additionally, provides type information for the adapter to the Closure
  19470. * compiler.
  19471. *
  19472. * Implement this adapter for your framework of choice to delegate updates to
  19473. * the component in your framework of choice. See architecture documentation
  19474. * for more details.
  19475. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  19476. *
  19477. * @record
  19478. */
  19479. var MDCSwitchAdapter = function () {
  19480. function MDCSwitchAdapter() {
  19481. _classCallCheck(this, MDCSwitchAdapter);
  19482. }
  19483. _createClass(MDCSwitchAdapter, [{
  19484. key: "addClass",
  19485. /** @param {string} className */
  19486. value: function addClass(className) {}
  19487. /** @param {string} className */
  19488. }, {
  19489. key: "removeClass",
  19490. value: function removeClass(className) {}
  19491. /** @param {boolean} checked */
  19492. }, {
  19493. key: "setNativeControlChecked",
  19494. value: function setNativeControlChecked(checked) {}
  19495. /** @param {boolean} disabled */
  19496. }, {
  19497. key: "setNativeControlDisabled",
  19498. value: function setNativeControlDisabled(disabled) {}
  19499. }]);
  19500. return MDCSwitchAdapter;
  19501. }();
  19502. /* unused harmony default export */ var _unused_webpack_default_export = (MDCSwitchAdapter);
  19503. /***/ }),
  19504. /* 136 */
  19505. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19506. "use strict";
  19507. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  19508. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  19509. /**
  19510. * @license
  19511. * Copyright 2018 Google Inc.
  19512. *
  19513. * Permission is hereby granted, free of charge, to any person obtaining a copy
  19514. * of this software and associated documentation files (the "Software"), to deal
  19515. * in the Software without restriction, including without limitation the rights
  19516. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  19517. * copies of the Software, and to permit persons to whom the Software is
  19518. * furnished to do so, subject to the following conditions:
  19519. *
  19520. * The above copyright notice and this permission notice shall be included in
  19521. * all copies or substantial portions of the Software.
  19522. *
  19523. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19524. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19525. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19526. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19527. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19528. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19529. * THE SOFTWARE.
  19530. */
  19531. /** @enum {string} */
  19532. var cssClasses = {
  19533. CHECKED: 'mdc-switch--checked',
  19534. DISABLED: 'mdc-switch--disabled'
  19535. };
  19536. /** @enum {string} */
  19537. var strings = {
  19538. NATIVE_CONTROL_SELECTOR: '.mdc-switch__native-control',
  19539. RIPPLE_SURFACE_SELECTOR: '.mdc-switch__thumb-underlay'
  19540. };
  19541. /***/ }),
  19542. /* 137 */
  19543. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19544. "use strict";
  19545. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  19546. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  19547. /**
  19548. * @license
  19549. * Copyright 2018 Google Inc.
  19550. *
  19551. * Permission is hereby granted, free of charge, to any person obtaining a copy
  19552. * of this software and associated documentation files (the "Software"), to deal
  19553. * in the Software without restriction, including without limitation the rights
  19554. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  19555. * copies of the Software, and to permit persons to whom the Software is
  19556. * furnished to do so, subject to the following conditions:
  19557. *
  19558. * The above copyright notice and this permission notice shall be included in
  19559. * all copies or substantial portions of the Software.
  19560. *
  19561. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19562. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19563. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19564. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19565. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19566. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19567. * THE SOFTWARE.
  19568. */
  19569. /** @enum {string} */
  19570. var cssClasses = {
  19571. ACTIVE: 'mdc-tab-indicator--active',
  19572. FADE: 'mdc-tab-indicator--fade',
  19573. NO_TRANSITION: 'mdc-tab-indicator--no-transition'
  19574. };
  19575. /** @enum {string} */
  19576. var strings = {
  19577. CONTENT_SELECTOR: '.mdc-tab-indicator__content'
  19578. };
  19579. /***/ }),
  19580. /* 138 */
  19581. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19582. "use strict";
  19583. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation__ = __webpack_require__(24);
  19584. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  19585. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19586. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  19587. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  19588. /**
  19589. * @license
  19590. * Copyright 2018 Google Inc.
  19591. *
  19592. * Permission is hereby granted, free of charge, to any person obtaining a copy
  19593. * of this software and associated documentation files (the "Software"), to deal
  19594. * in the Software without restriction, including without limitation the rights
  19595. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  19596. * copies of the Software, and to permit persons to whom the Software is
  19597. * furnished to do so, subject to the following conditions:
  19598. *
  19599. * The above copyright notice and this permission notice shall be included in
  19600. * all copies or substantial portions of the Software.
  19601. *
  19602. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19603. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19604. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19605. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19606. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19607. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19608. * THE SOFTWARE.
  19609. */
  19610. /**
  19611. * @extends {MDCTabIndicatorFoundation}
  19612. * @final
  19613. */
  19614. var MDCSlidingTabIndicatorFoundation = function (_MDCTabIndicatorFound) {
  19615. _inherits(MDCSlidingTabIndicatorFoundation, _MDCTabIndicatorFound);
  19616. function MDCSlidingTabIndicatorFoundation() {
  19617. _classCallCheck(this, MDCSlidingTabIndicatorFoundation);
  19618. return _possibleConstructorReturn(this, (MDCSlidingTabIndicatorFoundation.__proto__ || Object.getPrototypeOf(MDCSlidingTabIndicatorFoundation)).apply(this, arguments));
  19619. }
  19620. _createClass(MDCSlidingTabIndicatorFoundation, [{
  19621. key: 'activate',
  19622. /** @param {!ClientRect=} previousIndicatorClientRect */
  19623. value: function activate(previousIndicatorClientRect) {
  19624. // Early exit if no indicator is present to handle cases where an indicator
  19625. // may be activated without a prior indicator state
  19626. if (!previousIndicatorClientRect) {
  19627. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */].cssClasses.ACTIVE);
  19628. return;
  19629. }
  19630. // This animation uses the FLIP approach. You can read more about it at the link below:
  19631. // https://aerotwist.com/blog/flip-your-animations/
  19632. // Calculate the dimensions based on the dimensions of the previous indicator
  19633. var currentClientRect = this.computeContentClientRect();
  19634. var widthDelta = previousIndicatorClientRect.width / currentClientRect.width;
  19635. var xPosition = previousIndicatorClientRect.left - currentClientRect.left;
  19636. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */].cssClasses.NO_TRANSITION);
  19637. this.adapter_.setContentStyleProperty('transform', 'translateX(' + xPosition + 'px) scaleX(' + widthDelta + ')');
  19638. // Force repaint before updating classes and transform to ensure the transform properly takes effect
  19639. this.computeContentClientRect();
  19640. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */].cssClasses.NO_TRANSITION);
  19641. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */].cssClasses.ACTIVE);
  19642. this.adapter_.setContentStyleProperty('transform', '');
  19643. }
  19644. }, {
  19645. key: 'deactivate',
  19646. value: function deactivate() {
  19647. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */].cssClasses.ACTIVE);
  19648. }
  19649. }]);
  19650. return MDCSlidingTabIndicatorFoundation;
  19651. }(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */]);
  19652. /* harmony default export */ __webpack_exports__["a"] = (MDCSlidingTabIndicatorFoundation);
  19653. /***/ }),
  19654. /* 139 */
  19655. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19656. "use strict";
  19657. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation__ = __webpack_require__(24);
  19658. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  19659. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19660. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  19661. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  19662. /**
  19663. * @license
  19664. * Copyright 2018 Google Inc.
  19665. *
  19666. * Permission is hereby granted, free of charge, to any person obtaining a copy
  19667. * of this software and associated documentation files (the "Software"), to deal
  19668. * in the Software without restriction, including without limitation the rights
  19669. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  19670. * copies of the Software, and to permit persons to whom the Software is
  19671. * furnished to do so, subject to the following conditions:
  19672. *
  19673. * The above copyright notice and this permission notice shall be included in
  19674. * all copies or substantial portions of the Software.
  19675. *
  19676. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19677. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19678. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19679. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19680. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19681. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19682. * THE SOFTWARE.
  19683. */
  19684. /**
  19685. * @extends {MDCTabIndicatorFoundation}
  19686. * @final
  19687. */
  19688. var MDCFadingTabIndicatorFoundation = function (_MDCTabIndicatorFound) {
  19689. _inherits(MDCFadingTabIndicatorFoundation, _MDCTabIndicatorFound);
  19690. function MDCFadingTabIndicatorFoundation() {
  19691. _classCallCheck(this, MDCFadingTabIndicatorFoundation);
  19692. return _possibleConstructorReturn(this, (MDCFadingTabIndicatorFoundation.__proto__ || Object.getPrototypeOf(MDCFadingTabIndicatorFoundation)).apply(this, arguments));
  19693. }
  19694. _createClass(MDCFadingTabIndicatorFoundation, [{
  19695. key: 'activate',
  19696. value: function activate() {
  19697. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */].cssClasses.ACTIVE);
  19698. }
  19699. }, {
  19700. key: 'deactivate',
  19701. value: function deactivate() {
  19702. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */].cssClasses.ACTIVE);
  19703. }
  19704. }]);
  19705. return MDCFadingTabIndicatorFoundation;
  19706. }(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */]);
  19707. /* harmony default export */ __webpack_exports__["a"] = (MDCFadingTabIndicatorFoundation);
  19708. /***/ }),
  19709. /* 140 */
  19710. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19711. "use strict";
  19712. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  19713. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(10);
  19714. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(141);
  19715. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  19716. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  19717. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19718. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  19719. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  19720. /**
  19721. * @license
  19722. * Copyright 2018 Google Inc.
  19723. *
  19724. * Permission is hereby granted, free of charge, to any person obtaining a copy
  19725. * of this software and associated documentation files (the "Software"), to deal
  19726. * in the Software without restriction, including without limitation the rights
  19727. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  19728. * copies of the Software, and to permit persons to whom the Software is
  19729. * furnished to do so, subject to the following conditions:
  19730. *
  19731. * The above copyright notice and this permission notice shall be included in
  19732. * all copies or substantial portions of the Software.
  19733. *
  19734. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19735. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19736. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19737. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19738. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19739. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19740. * THE SOFTWARE.
  19741. */
  19742. /* eslint-disable no-unused-vars */
  19743. /* eslint-enable no-unused-vars */
  19744. /**
  19745. * @extends {MDCFoundation<!MDCTabAdapter>}
  19746. * @final
  19747. */
  19748. var MDCTabFoundation = function (_MDCFoundation) {
  19749. _inherits(MDCTabFoundation, _MDCFoundation);
  19750. _createClass(MDCTabFoundation, null, [{
  19751. key: 'cssClasses',
  19752. /** @return enum {string} */
  19753. get: function get() {
  19754. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  19755. }
  19756. /** @return enum {string} */
  19757. }, {
  19758. key: 'strings',
  19759. get: function get() {
  19760. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  19761. }
  19762. /**
  19763. * @see MDCTabAdapter for typing information
  19764. * @return {!MDCTabAdapter}
  19765. */
  19766. }, {
  19767. key: 'defaultAdapter',
  19768. get: function get() {
  19769. return (/** @type {!MDCTabAdapter} */{
  19770. addClass: function addClass() {},
  19771. removeClass: function removeClass() {},
  19772. hasClass: function hasClass() {},
  19773. setAttr: function setAttr() {},
  19774. activateIndicator: function activateIndicator() {},
  19775. deactivateIndicator: function deactivateIndicator() {},
  19776. notifyInteracted: function notifyInteracted() {},
  19777. getOffsetLeft: function getOffsetLeft() {},
  19778. getOffsetWidth: function getOffsetWidth() {},
  19779. getContentOffsetLeft: function getContentOffsetLeft() {},
  19780. getContentOffsetWidth: function getContentOffsetWidth() {},
  19781. focus: function focus() {}
  19782. }
  19783. );
  19784. }
  19785. /** @param {!MDCTabAdapter} adapter */
  19786. }]);
  19787. function MDCTabFoundation(adapter) {
  19788. _classCallCheck(this, MDCTabFoundation);
  19789. /** @private {boolean} */
  19790. var _this = _possibleConstructorReturn(this, (MDCTabFoundation.__proto__ || Object.getPrototypeOf(MDCTabFoundation)).call(this, _extends(MDCTabFoundation.defaultAdapter, adapter)));
  19791. _this.focusOnActivate_ = true;
  19792. return _this;
  19793. }
  19794. /**
  19795. * Handles the "click" event
  19796. */
  19797. _createClass(MDCTabFoundation, [{
  19798. key: 'handleClick',
  19799. value: function handleClick() {
  19800. // It's up to the parent component to keep track of the active Tab and
  19801. // ensure we don't activate a Tab that's already active.
  19802. this.adapter_.notifyInteracted();
  19803. }
  19804. /**
  19805. * Returns the Tab's active state
  19806. * @return {boolean}
  19807. */
  19808. }, {
  19809. key: 'isActive',
  19810. value: function isActive() {
  19811. return this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ACTIVE);
  19812. }
  19813. /**
  19814. * Sets whether the tab should focus itself when activated
  19815. * @param {boolean} focusOnActivate
  19816. */
  19817. }, {
  19818. key: 'setFocusOnActivate',
  19819. value: function setFocusOnActivate(focusOnActivate) {
  19820. this.focusOnActivate_ = focusOnActivate;
  19821. }
  19822. /**
  19823. * Activates the Tab
  19824. * @param {!ClientRect=} previousIndicatorClientRect
  19825. */
  19826. }, {
  19827. key: 'activate',
  19828. value: function activate(previousIndicatorClientRect) {
  19829. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ACTIVE);
  19830. this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_SELECTED, 'true');
  19831. this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].TABINDEX, '0');
  19832. this.adapter_.activateIndicator(previousIndicatorClientRect);
  19833. if (this.focusOnActivate_) {
  19834. this.adapter_.focus();
  19835. }
  19836. }
  19837. /**
  19838. * Deactivates the Tab
  19839. */
  19840. }, {
  19841. key: 'deactivate',
  19842. value: function deactivate() {
  19843. // Early exit
  19844. if (!this.isActive()) {
  19845. return;
  19846. }
  19847. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ACTIVE);
  19848. this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_SELECTED, 'false');
  19849. this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].TABINDEX, '-1');
  19850. this.adapter_.deactivateIndicator();
  19851. }
  19852. /**
  19853. * Returns the dimensions of the Tab
  19854. * @return {!MDCTabDimensions}
  19855. */
  19856. }, {
  19857. key: 'computeDimensions',
  19858. value: function computeDimensions() {
  19859. var rootWidth = this.adapter_.getOffsetWidth();
  19860. var rootLeft = this.adapter_.getOffsetLeft();
  19861. var contentWidth = this.adapter_.getContentOffsetWidth();
  19862. var contentLeft = this.adapter_.getContentOffsetLeft();
  19863. return {
  19864. rootLeft: rootLeft,
  19865. rootRight: rootLeft + rootWidth,
  19866. contentLeft: rootLeft + contentLeft,
  19867. contentRight: rootLeft + contentLeft + contentWidth
  19868. };
  19869. }
  19870. }]);
  19871. return MDCTabFoundation;
  19872. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  19873. /* harmony default export */ __webpack_exports__["a"] = (MDCTabFoundation);
  19874. /***/ }),
  19875. /* 141 */
  19876. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19877. "use strict";
  19878. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  19879. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  19880. /**
  19881. * @license
  19882. * Copyright 2018 Google Inc.
  19883. *
  19884. * Permission is hereby granted, free of charge, to any person obtaining a copy
  19885. * of this software and associated documentation files (the "Software"), to deal
  19886. * in the Software without restriction, including without limitation the rights
  19887. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  19888. * copies of the Software, and to permit persons to whom the Software is
  19889. * furnished to do so, subject to the following conditions:
  19890. *
  19891. * The above copyright notice and this permission notice shall be included in
  19892. * all copies or substantial portions of the Software.
  19893. *
  19894. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19895. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19896. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19897. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19898. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19899. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19900. * THE SOFTWARE.
  19901. */
  19902. /** @enum {string} */
  19903. var cssClasses = {
  19904. ACTIVE: 'mdc-tab--active'
  19905. };
  19906. /** @enum {string} */
  19907. var strings = {
  19908. ARIA_SELECTED: 'aria-selected',
  19909. RIPPLE_SELECTOR: '.mdc-tab__ripple',
  19910. CONTENT_SELECTOR: '.mdc-tab__content',
  19911. TAB_INDICATOR_SELECTOR: '.mdc-tab-indicator',
  19912. TABINDEX: 'tabIndex',
  19913. INTERACTED_EVENT: 'MDCTab:interacted'
  19914. };
  19915. /***/ }),
  19916. /* 142 */
  19917. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19918. "use strict";
  19919. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  19920. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTabBar", function() { return MDCTabBar; });
  19921. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  19922. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_tab_index__ = __webpack_require__(54);
  19923. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_tab_scroller_index__ = __webpack_require__(57);
  19924. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__adapter__ = __webpack_require__(59);
  19925. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation__ = __webpack_require__(148);
  19926. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTabBarFoundation", function() { return __WEBPACK_IMPORTED_MODULE_4__foundation__["a"]; });
  19927. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  19928. var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
  19929. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19930. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  19931. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  19932. /**
  19933. * @license
  19934. * Copyright 2018 Google Inc.
  19935. *
  19936. * Permission is hereby granted, free of charge, to any person obtaining a copy
  19937. * of this software and associated documentation files (the "Software"), to deal
  19938. * in the Software without restriction, including without limitation the rights
  19939. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  19940. * copies of the Software, and to permit persons to whom the Software is
  19941. * furnished to do so, subject to the following conditions:
  19942. *
  19943. * The above copyright notice and this permission notice shall be included in
  19944. * all copies or substantial portions of the Software.
  19945. *
  19946. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19947. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19948. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19949. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19950. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19951. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19952. * THE SOFTWARE.
  19953. */
  19954. var tabIdCounter = 0;
  19955. /**
  19956. * @extends {MDCComponent<!MDCTabBarFoundation>}
  19957. * @final
  19958. */
  19959. var MDCTabBar = function (_MDCComponent) {
  19960. _inherits(MDCTabBar, _MDCComponent);
  19961. /**
  19962. * @param {...?} args
  19963. */
  19964. function MDCTabBar() {
  19965. var _ref;
  19966. _classCallCheck(this, MDCTabBar);
  19967. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  19968. args[_key] = arguments[_key];
  19969. }
  19970. /** @private {!Array<!MDCTab>} */
  19971. var _this = _possibleConstructorReturn(this, (_ref = MDCTabBar.__proto__ || Object.getPrototypeOf(MDCTabBar)).call.apply(_ref, [this].concat(args)));
  19972. _this.tabList_;
  19973. /** @private {?MDCTabScroller} */
  19974. _this.tabScroller_;
  19975. /** @private {?function(?Event): undefined} */
  19976. _this.handleTabInteraction_;
  19977. /** @private {?function(?Event): undefined} */
  19978. _this.handleKeyDown_;
  19979. return _this;
  19980. }
  19981. /**
  19982. * @param {!Element} root
  19983. * @return {!MDCTabBar}
  19984. */
  19985. _createClass(MDCTabBar, [{
  19986. key: 'initialize',
  19987. /**
  19988. * @param {(function(!Element): !MDCTab)=} tabFactory A function which creates a new MDCTab
  19989. * @param {(function(!Element): !MDCTabScroller)=} tabScrollerFactory A function which creates a new MDCTabScroller
  19990. */
  19991. value: function initialize() {
  19992. var tabFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (el) {
  19993. return new __WEBPACK_IMPORTED_MODULE_1__material_tab_index__["MDCTab"](el);
  19994. };
  19995. var tabScrollerFactory = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (el) {
  19996. return new __WEBPACK_IMPORTED_MODULE_2__material_tab_scroller_index__["MDCTabScroller"](el);
  19997. };
  19998. this.tabList_ = this.instantiateTabs_(tabFactory);
  19999. this.tabScroller_ = this.instantiateTabScroller_(tabScrollerFactory);
  20000. }
  20001. }, {
  20002. key: 'initialSyncWithDOM',
  20003. value: function initialSyncWithDOM() {
  20004. var _this2 = this;
  20005. this.handleTabInteraction_ = function (evt) {
  20006. return _this2.foundation_.handleTabInteraction(evt);
  20007. };
  20008. this.handleKeyDown_ = function (evt) {
  20009. return _this2.foundation_.handleKeyDown(evt);
  20010. };
  20011. this.root_.addEventListener(__WEBPACK_IMPORTED_MODULE_1__material_tab_index__["MDCTabFoundation"].strings.INTERACTED_EVENT, this.handleTabInteraction_);
  20012. this.root_.addEventListener('keydown', this.handleKeyDown_);
  20013. for (var i = 0; i < this.tabList_.length; i++) {
  20014. if (this.tabList_[i].active) {
  20015. this.scrollIntoView(i);
  20016. break;
  20017. }
  20018. }
  20019. }
  20020. }, {
  20021. key: 'destroy',
  20022. value: function destroy() {
  20023. _get(MDCTabBar.prototype.__proto__ || Object.getPrototypeOf(MDCTabBar.prototype), 'destroy', this).call(this);
  20024. this.root_.removeEventListener(__WEBPACK_IMPORTED_MODULE_1__material_tab_index__["MDCTabFoundation"].strings.INTERACTED_EVENT, this.handleTabInteraction_);
  20025. this.root_.removeEventListener('keydown', this.handleKeyDown_);
  20026. this.tabList_.forEach(function (tab) {
  20027. return tab.destroy();
  20028. });
  20029. this.tabScroller_.destroy();
  20030. }
  20031. /**
  20032. * @return {!MDCTabBarFoundation}
  20033. */
  20034. }, {
  20035. key: 'getDefaultFoundation',
  20036. value: function getDefaultFoundation() {
  20037. var _this3 = this;
  20038. return new __WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* default */](
  20039. /** @type {!MDCTabBarAdapter} */{
  20040. scrollTo: function scrollTo(scrollX) {
  20041. return _this3.tabScroller_.scrollTo(scrollX);
  20042. },
  20043. incrementScroll: function incrementScroll(scrollXIncrement) {
  20044. return _this3.tabScroller_.incrementScroll(scrollXIncrement);
  20045. },
  20046. getScrollPosition: function getScrollPosition() {
  20047. return _this3.tabScroller_.getScrollPosition();
  20048. },
  20049. getScrollContentWidth: function getScrollContentWidth() {
  20050. return _this3.tabScroller_.getScrollContentWidth();
  20051. },
  20052. getOffsetWidth: function getOffsetWidth() {
  20053. return _this3.root_.offsetWidth;
  20054. },
  20055. isRTL: function isRTL() {
  20056. return window.getComputedStyle(_this3.root_).getPropertyValue('direction') === 'rtl';
  20057. },
  20058. setActiveTab: function setActiveTab(index) {
  20059. return _this3.foundation_.activateTab(index);
  20060. },
  20061. activateTabAtIndex: function activateTabAtIndex(index, clientRect) {
  20062. return _this3.tabList_[index].activate(clientRect);
  20063. },
  20064. deactivateTabAtIndex: function deactivateTabAtIndex(index) {
  20065. return _this3.tabList_[index].deactivate();
  20066. },
  20067. focusTabAtIndex: function focusTabAtIndex(index) {
  20068. return _this3.tabList_[index].focus();
  20069. },
  20070. getTabIndicatorClientRectAtIndex: function getTabIndicatorClientRectAtIndex(index) {
  20071. return _this3.tabList_[index].computeIndicatorClientRect();
  20072. },
  20073. getTabDimensionsAtIndex: function getTabDimensionsAtIndex(index) {
  20074. return _this3.tabList_[index].computeDimensions();
  20075. },
  20076. getPreviousActiveTabIndex: function getPreviousActiveTabIndex() {
  20077. for (var i = 0; i < _this3.tabList_.length; i++) {
  20078. if (_this3.tabList_[i].active) {
  20079. return i;
  20080. }
  20081. }
  20082. return -1;
  20083. },
  20084. getFocusedTabIndex: function getFocusedTabIndex() {
  20085. var tabElements = _this3.getTabElements_();
  20086. var activeElement = document.activeElement;
  20087. return tabElements.indexOf(activeElement);
  20088. },
  20089. getIndexOfTabById: function getIndexOfTabById(id) {
  20090. for (var i = 0; i < _this3.tabList_.length; i++) {
  20091. if (_this3.tabList_[i].id === id) {
  20092. return i;
  20093. }
  20094. }
  20095. return -1;
  20096. },
  20097. getTabListLength: function getTabListLength() {
  20098. return _this3.tabList_.length;
  20099. },
  20100. notifyTabActivated: function notifyTabActivated(index) {
  20101. return _this3.emit(__WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* default */].strings.TAB_ACTIVATED_EVENT, { index: index }, true);
  20102. }
  20103. });
  20104. }
  20105. /**
  20106. * Activates the tab at the given index
  20107. * @param {number} index The index of the tab
  20108. */
  20109. }, {
  20110. key: 'activateTab',
  20111. value: function activateTab(index) {
  20112. this.foundation_.activateTab(index);
  20113. }
  20114. /**
  20115. * Scrolls the tab at the given index into view
  20116. * @param {number} index THe index of the tab
  20117. */
  20118. }, {
  20119. key: 'scrollIntoView',
  20120. value: function scrollIntoView(index) {
  20121. this.foundation_.scrollIntoView(index);
  20122. }
  20123. /**
  20124. * Returns all the tab elements in a nice clean array
  20125. * @return {!Array<!Element>}
  20126. * @private
  20127. */
  20128. }, {
  20129. key: 'getTabElements_',
  20130. value: function getTabElements_() {
  20131. return [].slice.call(this.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* default */].strings.TAB_SELECTOR));
  20132. }
  20133. /**
  20134. * Instantiates tab components on all child tab elements
  20135. * @param {(function(!Element): !MDCTab)} tabFactory
  20136. * @return {!Array<!MDCTab>}
  20137. * @private
  20138. */
  20139. }, {
  20140. key: 'instantiateTabs_',
  20141. value: function instantiateTabs_(tabFactory) {
  20142. return this.getTabElements_().map(function (el) {
  20143. el.id = el.id || 'mdc-tab-' + ++tabIdCounter;
  20144. return tabFactory(el);
  20145. });
  20146. }
  20147. /**
  20148. * Instantiates tab scroller component on the child tab scroller element
  20149. * @param {(function(!Element): !MDCTabScroller)} tabScrollerFactory
  20150. * @return {?MDCTabScroller}
  20151. * @private
  20152. */
  20153. }, {
  20154. key: 'instantiateTabScroller_',
  20155. value: function instantiateTabScroller_(tabScrollerFactory) {
  20156. var tabScrollerElement = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* default */].strings.TAB_SCROLLER_SELECTOR);
  20157. if (tabScrollerElement) {
  20158. return tabScrollerFactory(tabScrollerElement);
  20159. }
  20160. return null;
  20161. }
  20162. }, {
  20163. key: 'focusOnActivate',
  20164. set: function set(focusOnActivate) {
  20165. this.tabList_.forEach(function (tab) {
  20166. return tab.focusOnActivate = focusOnActivate;
  20167. });
  20168. }
  20169. }, {
  20170. key: 'useAutomaticActivation',
  20171. set: function set(useAutomaticActivation) {
  20172. this.foundation_.setUseAutomaticActivation(useAutomaticActivation);
  20173. }
  20174. }], [{
  20175. key: 'attachTo',
  20176. value: function attachTo(root) {
  20177. return new MDCTabBar(root);
  20178. }
  20179. }]);
  20180. return MDCTabBar;
  20181. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  20182. /***/ }),
  20183. /* 143 */
  20184. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20185. "use strict";
  20186. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  20187. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(58);
  20188. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__adapter__ = __webpack_require__(4);
  20189. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__rtl_scroller__ = __webpack_require__(11);
  20190. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__rtl_default_scroller__ = __webpack_require__(144);
  20191. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__rtl_negative_scroller__ = __webpack_require__(145);
  20192. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__rtl_reverse_scroller__ = __webpack_require__(146);
  20193. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  20194. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  20195. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20196. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  20197. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  20198. /**
  20199. * @license
  20200. * Copyright 2018 Google Inc.
  20201. *
  20202. * Permission is hereby granted, free of charge, to any person obtaining a copy
  20203. * of this software and associated documentation files (the "Software"), to deal
  20204. * in the Software without restriction, including without limitation the rights
  20205. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  20206. * copies of the Software, and to permit persons to whom the Software is
  20207. * furnished to do so, subject to the following conditions:
  20208. *
  20209. * The above copyright notice and this permission notice shall be included in
  20210. * all copies or substantial portions of the Software.
  20211. *
  20212. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  20213. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  20214. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  20215. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20216. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20217. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  20218. * THE SOFTWARE.
  20219. */
  20220. /* eslint-disable no-unused-vars */
  20221. /* eslint-enable no-unused-vars */
  20222. /**
  20223. * @extends {MDCFoundation<!MDCTabScrollerAdapter>}
  20224. * @final
  20225. */
  20226. var MDCTabScrollerFoundation = function (_MDCFoundation) {
  20227. _inherits(MDCTabScrollerFoundation, _MDCFoundation);
  20228. _createClass(MDCTabScrollerFoundation, null, [{
  20229. key: 'cssClasses',
  20230. /** @return enum {string} */
  20231. get: function get() {
  20232. return __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */];
  20233. }
  20234. /** @return enum {string} */
  20235. }, {
  20236. key: 'strings',
  20237. get: function get() {
  20238. return __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */];
  20239. }
  20240. /**
  20241. * @see MDCTabScrollerAdapter for typing information
  20242. * @return {!MDCTabScrollerAdapter}
  20243. */
  20244. }, {
  20245. key: 'defaultAdapter',
  20246. get: function get() {
  20247. return (/** @type {!MDCTabScrollerAdapter} */{
  20248. eventTargetMatchesSelector: function eventTargetMatchesSelector() {},
  20249. addClass: function addClass() {},
  20250. removeClass: function removeClass() {},
  20251. addScrollAreaClass: function addScrollAreaClass() {},
  20252. setScrollAreaStyleProperty: function setScrollAreaStyleProperty() {},
  20253. setScrollContentStyleProperty: function setScrollContentStyleProperty() {},
  20254. getScrollContentStyleValue: function getScrollContentStyleValue() {},
  20255. setScrollAreaScrollLeft: function setScrollAreaScrollLeft() {},
  20256. getScrollAreaScrollLeft: function getScrollAreaScrollLeft() {},
  20257. getScrollContentOffsetWidth: function getScrollContentOffsetWidth() {},
  20258. getScrollAreaOffsetWidth: function getScrollAreaOffsetWidth() {},
  20259. computeScrollAreaClientRect: function computeScrollAreaClientRect() {},
  20260. computeScrollContentClientRect: function computeScrollContentClientRect() {},
  20261. computeHorizontalScrollbarHeight: function computeHorizontalScrollbarHeight() {}
  20262. }
  20263. );
  20264. }
  20265. /** @param {!MDCTabScrollerAdapter} adapter */
  20266. }]);
  20267. function MDCTabScrollerFoundation(adapter) {
  20268. _classCallCheck(this, MDCTabScrollerFoundation);
  20269. /**
  20270. * This boolean controls whether we should handle the transitionend and interaction events during the animation.
  20271. * @private {boolean}
  20272. */
  20273. var _this = _possibleConstructorReturn(this, (MDCTabScrollerFoundation.__proto__ || Object.getPrototypeOf(MDCTabScrollerFoundation)).call(this, _extends(MDCTabScrollerFoundation.defaultAdapter, adapter)));
  20274. _this.isAnimating_ = false;
  20275. /**
  20276. * The MDCTabScrollerRTL instance varies per browser and allows us to encapsulate the peculiar browser behavior
  20277. * of RTL scrolling in it's own class.
  20278. * @private {?MDCTabScrollerRTL}
  20279. */
  20280. _this.rtlScrollerInstance_;
  20281. return _this;
  20282. }
  20283. _createClass(MDCTabScrollerFoundation, [{
  20284. key: 'init',
  20285. value: function init() {
  20286. // Compute horizontal scrollbar height on scroller with overflow initially hidden, then update overflow to scroll
  20287. // and immediately adjust bottom margin to avoid the scrollbar initially appearing before JS runs.
  20288. var horizontalScrollbarHeight = this.adapter_.computeHorizontalScrollbarHeight();
  20289. this.adapter_.setScrollAreaStyleProperty('margin-bottom', -horizontalScrollbarHeight + 'px');
  20290. this.adapter_.addScrollAreaClass(MDCTabScrollerFoundation.cssClasses.SCROLL_AREA_SCROLL);
  20291. }
  20292. /**
  20293. * Computes the current visual scroll position
  20294. * @return {number}
  20295. */
  20296. }, {
  20297. key: 'getScrollPosition',
  20298. value: function getScrollPosition() {
  20299. if (this.isRTL_()) {
  20300. return this.computeCurrentScrollPositionRTL_();
  20301. }
  20302. var currentTranslateX = this.calculateCurrentTranslateX_();
  20303. var scrollLeft = this.adapter_.getScrollAreaScrollLeft();
  20304. return scrollLeft - currentTranslateX;
  20305. }
  20306. /**
  20307. * Handles interaction events that occur during transition
  20308. */
  20309. }, {
  20310. key: 'handleInteraction',
  20311. value: function handleInteraction() {
  20312. // Early exit if we aren't animating
  20313. if (!this.isAnimating_) {
  20314. return;
  20315. }
  20316. // Prevent other event listeners from handling this event
  20317. this.stopScrollAnimation_();
  20318. }
  20319. /**
  20320. * Handles the transitionend event
  20321. * @param {!Event} evt
  20322. */
  20323. }, {
  20324. key: 'handleTransitionEnd',
  20325. value: function handleTransitionEnd(evt) {
  20326. // Early exit if we aren't animating or the event was triggered by a different element.
  20327. if (!this.isAnimating_ || !this.adapter_.eventTargetMatchesSelector(evt.target, MDCTabScrollerFoundation.strings.CONTENT_SELECTOR)) {
  20328. return;
  20329. }
  20330. this.isAnimating_ = false;
  20331. this.adapter_.removeClass(MDCTabScrollerFoundation.cssClasses.ANIMATING);
  20332. }
  20333. /**
  20334. * Increment the scroll value by the scrollXIncrement
  20335. * @param {number} scrollXIncrement The value by which to increment the scroll position
  20336. */
  20337. }, {
  20338. key: 'incrementScroll',
  20339. value: function incrementScroll(scrollXIncrement) {
  20340. // Early exit for non-operational increment values
  20341. if (scrollXIncrement === 0) {
  20342. return;
  20343. }
  20344. if (this.isRTL_()) {
  20345. return this.incrementScrollRTL_(scrollXIncrement);
  20346. }
  20347. this.incrementScroll_(scrollXIncrement);
  20348. }
  20349. /**
  20350. * Scrolls to the given scrollX value
  20351. * @param {number} scrollX
  20352. */
  20353. }, {
  20354. key: 'scrollTo',
  20355. value: function scrollTo(scrollX) {
  20356. if (this.isRTL_()) {
  20357. return this.scrollToRTL_(scrollX);
  20358. }
  20359. this.scrollTo_(scrollX);
  20360. }
  20361. /**
  20362. * Returns the appropriate version of the MDCTabScrollerRTL
  20363. * @return {!MDCTabScrollerRTL}
  20364. */
  20365. }, {
  20366. key: 'getRTLScroller',
  20367. value: function getRTLScroller() {
  20368. if (!this.rtlScrollerInstance_) {
  20369. this.rtlScrollerInstance_ = this.rtlScrollerFactory_();
  20370. }
  20371. return this.rtlScrollerInstance_;
  20372. }
  20373. /**
  20374. * Returns the translateX value from a CSS matrix transform function string
  20375. * @return {number}
  20376. * @private
  20377. */
  20378. }, {
  20379. key: 'calculateCurrentTranslateX_',
  20380. value: function calculateCurrentTranslateX_() {
  20381. var transformValue = this.adapter_.getScrollContentStyleValue('transform');
  20382. // Early exit if no transform is present
  20383. if (transformValue === 'none') {
  20384. return 0;
  20385. }
  20386. // The transform value comes back as a matrix transformation in the form
  20387. // of `matrix(a, b, c, d, tx, ty)`. We only care about tx (translateX) so
  20388. // we're going to grab all the parenthesized values, strip out tx, and
  20389. // parse it.
  20390. var results = /\((.+)\)/.exec(transformValue)[1];
  20391. var parts = results.split(',');
  20392. return parseFloat(parts[4]);
  20393. }
  20394. /**
  20395. * Calculates a safe scroll value that is > 0 and < the max scroll value
  20396. * @param {number} scrollX The distance to scroll
  20397. * @return {number}
  20398. * @private
  20399. */
  20400. }, {
  20401. key: 'clampScrollValue_',
  20402. value: function clampScrollValue_(scrollX) {
  20403. var edges = this.calculateScrollEdges_();
  20404. return Math.min(Math.max(edges.left, scrollX), edges.right);
  20405. }
  20406. /**
  20407. * @return {number}
  20408. * @private
  20409. */
  20410. }, {
  20411. key: 'computeCurrentScrollPositionRTL_',
  20412. value: function computeCurrentScrollPositionRTL_() {
  20413. var translateX = this.calculateCurrentTranslateX_();
  20414. return this.getRTLScroller().getScrollPositionRTL(translateX);
  20415. }
  20416. /**
  20417. * @return {!MDCTabScrollerHorizontalEdges}
  20418. * @private
  20419. */
  20420. }, {
  20421. key: 'calculateScrollEdges_',
  20422. value: function calculateScrollEdges_() {
  20423. var contentWidth = this.adapter_.getScrollContentOffsetWidth();
  20424. var rootWidth = this.adapter_.getScrollAreaOffsetWidth();
  20425. return (/** @type {!MDCTabScrollerHorizontalEdges} */{
  20426. left: 0,
  20427. right: contentWidth - rootWidth
  20428. }
  20429. );
  20430. }
  20431. /**
  20432. * Internal scroll method
  20433. * @param {number} scrollX The new scroll position
  20434. * @private
  20435. */
  20436. }, {
  20437. key: 'scrollTo_',
  20438. value: function scrollTo_(scrollX) {
  20439. var currentScrollX = this.getScrollPosition();
  20440. var safeScrollX = this.clampScrollValue_(scrollX);
  20441. var scrollDelta = safeScrollX - currentScrollX;
  20442. this.animate_( /** @type {!MDCTabScrollerAnimation} */{
  20443. finalScrollPosition: safeScrollX,
  20444. scrollDelta: scrollDelta
  20445. });
  20446. }
  20447. /**
  20448. * Internal RTL scroll method
  20449. * @param {number} scrollX The new scroll position
  20450. * @private
  20451. */
  20452. }, {
  20453. key: 'scrollToRTL_',
  20454. value: function scrollToRTL_(scrollX) {
  20455. var animation = this.getRTLScroller().scrollToRTL(scrollX);
  20456. this.animate_(animation);
  20457. }
  20458. /**
  20459. * Internal increment scroll method
  20460. * @param {number} scrollX The new scroll position increment
  20461. * @private
  20462. */
  20463. }, {
  20464. key: 'incrementScroll_',
  20465. value: function incrementScroll_(scrollX) {
  20466. var currentScrollX = this.getScrollPosition();
  20467. var targetScrollX = scrollX + currentScrollX;
  20468. var safeScrollX = this.clampScrollValue_(targetScrollX);
  20469. var scrollDelta = safeScrollX - currentScrollX;
  20470. this.animate_( /** @type {!MDCTabScrollerAnimation} */{
  20471. finalScrollPosition: safeScrollX,
  20472. scrollDelta: scrollDelta
  20473. });
  20474. }
  20475. /**
  20476. * Internal incremenet scroll RTL method
  20477. * @param {number} scrollX The new scroll position RTL increment
  20478. * @private
  20479. */
  20480. }, {
  20481. key: 'incrementScrollRTL_',
  20482. value: function incrementScrollRTL_(scrollX) {
  20483. var animation = this.getRTLScroller().incrementScrollRTL(scrollX);
  20484. this.animate_(animation);
  20485. }
  20486. /**
  20487. * Animates the tab scrolling
  20488. * @param {!MDCTabScrollerAnimation} animation The animation to apply
  20489. * @private
  20490. */
  20491. }, {
  20492. key: 'animate_',
  20493. value: function animate_(animation) {
  20494. var _this2 = this;
  20495. // Early exit if translateX is 0, which means there's no animation to perform
  20496. if (animation.scrollDelta === 0) {
  20497. return;
  20498. }
  20499. this.stopScrollAnimation_();
  20500. // This animation uses the FLIP approach.
  20501. // Read more here: https://aerotwist.com/blog/flip-your-animations/
  20502. this.adapter_.setScrollAreaScrollLeft(animation.finalScrollPosition);
  20503. this.adapter_.setScrollContentStyleProperty('transform', 'translateX(' + animation.scrollDelta + 'px)');
  20504. // Force repaint
  20505. this.adapter_.computeScrollAreaClientRect();
  20506. requestAnimationFrame(function () {
  20507. _this2.adapter_.addClass(MDCTabScrollerFoundation.cssClasses.ANIMATING);
  20508. _this2.adapter_.setScrollContentStyleProperty('transform', 'none');
  20509. });
  20510. this.isAnimating_ = true;
  20511. }
  20512. /**
  20513. * Stops scroll animation
  20514. * @private
  20515. */
  20516. }, {
  20517. key: 'stopScrollAnimation_',
  20518. value: function stopScrollAnimation_() {
  20519. this.isAnimating_ = false;
  20520. var currentScrollPosition = this.getAnimatingScrollPosition_();
  20521. this.adapter_.removeClass(MDCTabScrollerFoundation.cssClasses.ANIMATING);
  20522. this.adapter_.setScrollContentStyleProperty('transform', 'translateX(0px)');
  20523. this.adapter_.setScrollAreaScrollLeft(currentScrollPosition);
  20524. }
  20525. /**
  20526. * Gets the current scroll position during animation
  20527. * @return {number}
  20528. * @private
  20529. */
  20530. }, {
  20531. key: 'getAnimatingScrollPosition_',
  20532. value: function getAnimatingScrollPosition_() {
  20533. var currentTranslateX = this.calculateCurrentTranslateX_();
  20534. var scrollLeft = this.adapter_.getScrollAreaScrollLeft();
  20535. if (this.isRTL_()) {
  20536. return this.getRTLScroller().getAnimatingScrollPosition(scrollLeft, currentTranslateX);
  20537. }
  20538. return scrollLeft - currentTranslateX;
  20539. }
  20540. /**
  20541. * Determines the RTL Scroller to use
  20542. * @return {!MDCTabScrollerRTL}
  20543. * @private
  20544. */
  20545. }, {
  20546. key: 'rtlScrollerFactory_',
  20547. value: function rtlScrollerFactory_() {
  20548. // Browsers have three different implementations of scrollLeft in RTL mode,
  20549. // dependent on the browser. The behavior is based off the max LTR
  20550. // scrollleft value and 0.
  20551. //
  20552. // * Default scrolling in RTL *
  20553. // - Left-most value: 0
  20554. // - Right-most value: Max LTR scrollLeft value
  20555. //
  20556. // * Negative scrolling in RTL *
  20557. // - Left-most value: Negated max LTR scrollLeft value
  20558. // - Right-most value: 0
  20559. //
  20560. // * Reverse scrolling in RTL *
  20561. // - Left-most value: Max LTR scrollLeft value
  20562. // - Right-most value: 0
  20563. //
  20564. // We use those principles below to determine which RTL scrollLeft
  20565. // behavior is implemented in the current browser.
  20566. var initialScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  20567. this.adapter_.setScrollAreaScrollLeft(initialScrollLeft - 1);
  20568. var newScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  20569. // If the newScrollLeft value is negative,then we know that the browser has
  20570. // implemented negative RTL scrolling, since all other implementations have
  20571. // only positive values.
  20572. if (newScrollLeft < 0) {
  20573. // Undo the scrollLeft test check
  20574. this.adapter_.setScrollAreaScrollLeft(initialScrollLeft);
  20575. return new __WEBPACK_IMPORTED_MODULE_5__rtl_negative_scroller__["a" /* default */](this.adapter_);
  20576. }
  20577. var rootClientRect = this.adapter_.computeScrollAreaClientRect();
  20578. var contentClientRect = this.adapter_.computeScrollContentClientRect();
  20579. var rightEdgeDelta = Math.round(contentClientRect.right - rootClientRect.right);
  20580. // Undo the scrollLeft test check
  20581. this.adapter_.setScrollAreaScrollLeft(initialScrollLeft);
  20582. // By calculating the clientRect of the root element and the clientRect of
  20583. // the content element, we can determine how much the scroll value changed
  20584. // when we performed the scrollLeft subtraction above.
  20585. if (rightEdgeDelta === newScrollLeft) {
  20586. return new __WEBPACK_IMPORTED_MODULE_6__rtl_reverse_scroller__["a" /* default */](this.adapter_);
  20587. }
  20588. return new __WEBPACK_IMPORTED_MODULE_4__rtl_default_scroller__["a" /* default */](this.adapter_);
  20589. }
  20590. /**
  20591. * @return {boolean}
  20592. * @private
  20593. */
  20594. }, {
  20595. key: 'isRTL_',
  20596. value: function isRTL_() {
  20597. return this.adapter_.getScrollContentStyleValue('direction') === 'rtl';
  20598. }
  20599. }]);
  20600. return MDCTabScrollerFoundation;
  20601. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  20602. /* harmony default export */ __webpack_exports__["a"] = (MDCTabScrollerFoundation);
  20603. /***/ }),
  20604. /* 144 */
  20605. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20606. "use strict";
  20607. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__rtl_scroller__ = __webpack_require__(11);
  20608. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(4);
  20609. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  20610. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20611. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  20612. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  20613. /**
  20614. * @license
  20615. * Copyright 2018 Google Inc.
  20616. *
  20617. * Permission is hereby granted, free of charge, to any person obtaining a copy
  20618. * of this software and associated documentation files (the "Software"), to deal
  20619. * in the Software without restriction, including without limitation the rights
  20620. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  20621. * copies of the Software, and to permit persons to whom the Software is
  20622. * furnished to do so, subject to the following conditions:
  20623. *
  20624. * The above copyright notice and this permission notice shall be included in
  20625. * all copies or substantial portions of the Software.
  20626. *
  20627. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  20628. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  20629. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  20630. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20631. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20632. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  20633. * THE SOFTWARE.
  20634. */
  20635. /* eslint-disable no-unused-vars */
  20636. /* eslint-enable no-unused-vars */
  20637. /**
  20638. * @extends {MDCTabScrollerRTL}
  20639. * @final
  20640. */
  20641. var MDCTabScrollerRTLDefault = function (_MDCTabScrollerRTL) {
  20642. _inherits(MDCTabScrollerRTLDefault, _MDCTabScrollerRTL);
  20643. function MDCTabScrollerRTLDefault() {
  20644. _classCallCheck(this, MDCTabScrollerRTLDefault);
  20645. return _possibleConstructorReturn(this, (MDCTabScrollerRTLDefault.__proto__ || Object.getPrototypeOf(MDCTabScrollerRTLDefault)).apply(this, arguments));
  20646. }
  20647. _createClass(MDCTabScrollerRTLDefault, [{
  20648. key: 'getScrollPositionRTL',
  20649. /**
  20650. * @return {number}
  20651. */
  20652. value: function getScrollPositionRTL() {
  20653. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  20654. var _calculateScrollEdges = this.calculateScrollEdges_(),
  20655. right = _calculateScrollEdges.right;
  20656. // Scroll values on most browsers are ints instead of floats so we round
  20657. return Math.round(right - currentScrollLeft);
  20658. }
  20659. /**
  20660. * @param {number} scrollX
  20661. * @return {!MDCTabScrollerAnimation}
  20662. */
  20663. }, {
  20664. key: 'scrollToRTL',
  20665. value: function scrollToRTL(scrollX) {
  20666. var edges = this.calculateScrollEdges_();
  20667. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  20668. var clampedScrollLeft = this.clampScrollValue_(edges.right - scrollX);
  20669. return (/** @type {!MDCTabScrollerAnimation} */{
  20670. finalScrollPosition: clampedScrollLeft,
  20671. scrollDelta: clampedScrollLeft - currentScrollLeft
  20672. }
  20673. );
  20674. }
  20675. /**
  20676. * @param {number} scrollX
  20677. * @return {!MDCTabScrollerAnimation}
  20678. */
  20679. }, {
  20680. key: 'incrementScrollRTL',
  20681. value: function incrementScrollRTL(scrollX) {
  20682. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  20683. var clampedScrollLeft = this.clampScrollValue_(currentScrollLeft - scrollX);
  20684. return (/** @type {!MDCTabScrollerAnimation} */{
  20685. finalScrollPosition: clampedScrollLeft,
  20686. scrollDelta: clampedScrollLeft - currentScrollLeft
  20687. }
  20688. );
  20689. }
  20690. /**
  20691. * @param {number} scrollX
  20692. * @return {number}
  20693. */
  20694. }, {
  20695. key: 'getAnimatingScrollPosition',
  20696. value: function getAnimatingScrollPosition(scrollX) {
  20697. return scrollX;
  20698. }
  20699. /**
  20700. * @return {!MDCTabScrollerHorizontalEdges}
  20701. * @private
  20702. */
  20703. }, {
  20704. key: 'calculateScrollEdges_',
  20705. value: function calculateScrollEdges_() {
  20706. var contentWidth = this.adapter_.getScrollContentOffsetWidth();
  20707. var rootWidth = this.adapter_.getScrollAreaOffsetWidth();
  20708. return (/** @type {!MDCTabScrollerHorizontalEdges} */{
  20709. left: 0,
  20710. right: contentWidth - rootWidth
  20711. }
  20712. );
  20713. }
  20714. /**
  20715. * @param {number} scrollX
  20716. * @return {number}
  20717. * @private
  20718. */
  20719. }, {
  20720. key: 'clampScrollValue_',
  20721. value: function clampScrollValue_(scrollX) {
  20722. var edges = this.calculateScrollEdges_();
  20723. return Math.min(Math.max(edges.left, scrollX), edges.right);
  20724. }
  20725. }]);
  20726. return MDCTabScrollerRTLDefault;
  20727. }(__WEBPACK_IMPORTED_MODULE_0__rtl_scroller__["a" /* default */]);
  20728. /* harmony default export */ __webpack_exports__["a"] = (MDCTabScrollerRTLDefault);
  20729. /***/ }),
  20730. /* 145 */
  20731. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20732. "use strict";
  20733. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__rtl_scroller__ = __webpack_require__(11);
  20734. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(4);
  20735. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  20736. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20737. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  20738. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  20739. /**
  20740. * @license
  20741. * Copyright 2018 Google Inc.
  20742. *
  20743. * Permission is hereby granted, free of charge, to any person obtaining a copy
  20744. * of this software and associated documentation files (the "Software"), to deal
  20745. * in the Software without restriction, including without limitation the rights
  20746. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  20747. * copies of the Software, and to permit persons to whom the Software is
  20748. * furnished to do so, subject to the following conditions:
  20749. *
  20750. * The above copyright notice and this permission notice shall be included in
  20751. * all copies or substantial portions of the Software.
  20752. *
  20753. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  20754. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  20755. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  20756. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20757. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20758. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  20759. * THE SOFTWARE.
  20760. */
  20761. /* eslint-disable no-unused-vars */
  20762. /* eslint-enable no-unused-vars */
  20763. /**
  20764. * @extends {MDCTabScrollerRTL}
  20765. * @final
  20766. */
  20767. var MDCTabScrollerRTLNegative = function (_MDCTabScrollerRTL) {
  20768. _inherits(MDCTabScrollerRTLNegative, _MDCTabScrollerRTL);
  20769. function MDCTabScrollerRTLNegative() {
  20770. _classCallCheck(this, MDCTabScrollerRTLNegative);
  20771. return _possibleConstructorReturn(this, (MDCTabScrollerRTLNegative.__proto__ || Object.getPrototypeOf(MDCTabScrollerRTLNegative)).apply(this, arguments));
  20772. }
  20773. _createClass(MDCTabScrollerRTLNegative, [{
  20774. key: 'getScrollPositionRTL',
  20775. /**
  20776. * @param {number} translateX The current translateX position
  20777. * @return {number}
  20778. */
  20779. value: function getScrollPositionRTL(translateX) {
  20780. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  20781. return Math.round(translateX - currentScrollLeft);
  20782. }
  20783. /**
  20784. * @param {number} scrollX
  20785. * @return {!MDCTabScrollerAnimation}
  20786. */
  20787. }, {
  20788. key: 'scrollToRTL',
  20789. value: function scrollToRTL(scrollX) {
  20790. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  20791. var clampedScrollLeft = this.clampScrollValue_(-scrollX);
  20792. return (/** @type {!MDCTabScrollerAnimation} */{
  20793. finalScrollPosition: clampedScrollLeft,
  20794. scrollDelta: clampedScrollLeft - currentScrollLeft
  20795. }
  20796. );
  20797. }
  20798. /**
  20799. * @param {number} scrollX
  20800. * @return {!MDCTabScrollerAnimation}
  20801. */
  20802. }, {
  20803. key: 'incrementScrollRTL',
  20804. value: function incrementScrollRTL(scrollX) {
  20805. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  20806. var clampedScrollLeft = this.clampScrollValue_(currentScrollLeft - scrollX);
  20807. return (/** @type {!MDCTabScrollerAnimation} */{
  20808. finalScrollPosition: clampedScrollLeft,
  20809. scrollDelta: clampedScrollLeft - currentScrollLeft
  20810. }
  20811. );
  20812. }
  20813. /**
  20814. * @param {number} scrollX
  20815. * @param {number} translateX
  20816. * @return {number}
  20817. */
  20818. }, {
  20819. key: 'getAnimatingScrollPosition',
  20820. value: function getAnimatingScrollPosition(scrollX, translateX) {
  20821. return scrollX - translateX;
  20822. }
  20823. /**
  20824. * @return {!MDCTabScrollerHorizontalEdges}
  20825. * @private
  20826. */
  20827. }, {
  20828. key: 'calculateScrollEdges_',
  20829. value: function calculateScrollEdges_() {
  20830. var contentWidth = this.adapter_.getScrollContentOffsetWidth();
  20831. var rootWidth = this.adapter_.getScrollAreaOffsetWidth();
  20832. return (/** @type {!MDCTabScrollerHorizontalEdges} */{
  20833. left: rootWidth - contentWidth,
  20834. right: 0
  20835. }
  20836. );
  20837. }
  20838. /**
  20839. * @param {number} scrollX
  20840. * @return {number}
  20841. * @private
  20842. */
  20843. }, {
  20844. key: 'clampScrollValue_',
  20845. value: function clampScrollValue_(scrollX) {
  20846. var edges = this.calculateScrollEdges_();
  20847. return Math.max(Math.min(edges.right, scrollX), edges.left);
  20848. }
  20849. }]);
  20850. return MDCTabScrollerRTLNegative;
  20851. }(__WEBPACK_IMPORTED_MODULE_0__rtl_scroller__["a" /* default */]);
  20852. /* harmony default export */ __webpack_exports__["a"] = (MDCTabScrollerRTLNegative);
  20853. /***/ }),
  20854. /* 146 */
  20855. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20856. "use strict";
  20857. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__rtl_scroller__ = __webpack_require__(11);
  20858. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(4);
  20859. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  20860. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20861. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  20862. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  20863. /**
  20864. * @license
  20865. * Copyright 2018 Google Inc.
  20866. *
  20867. * Permission is hereby granted, free of charge, to any person obtaining a copy
  20868. * of this software and associated documentation files (the "Software"), to deal
  20869. * in the Software without restriction, including without limitation the rights
  20870. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  20871. * copies of the Software, and to permit persons to whom the Software is
  20872. * furnished to do so, subject to the following conditions:
  20873. *
  20874. * The above copyright notice and this permission notice shall be included in
  20875. * all copies or substantial portions of the Software.
  20876. *
  20877. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  20878. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  20879. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  20880. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20881. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20882. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  20883. * THE SOFTWARE.
  20884. */
  20885. /* eslint-disable no-unused-vars */
  20886. /* eslint-enable no-unused-vars */
  20887. /**
  20888. * @extends {MDCTabScrollerRTL}
  20889. * @final
  20890. */
  20891. var MDCTabScrollerRTLReverse = function (_MDCTabScrollerRTL) {
  20892. _inherits(MDCTabScrollerRTLReverse, _MDCTabScrollerRTL);
  20893. function MDCTabScrollerRTLReverse() {
  20894. _classCallCheck(this, MDCTabScrollerRTLReverse);
  20895. return _possibleConstructorReturn(this, (MDCTabScrollerRTLReverse.__proto__ || Object.getPrototypeOf(MDCTabScrollerRTLReverse)).apply(this, arguments));
  20896. }
  20897. _createClass(MDCTabScrollerRTLReverse, [{
  20898. key: 'getScrollPositionRTL',
  20899. /**
  20900. * @param {number} translateX
  20901. * @return {number}
  20902. */
  20903. value: function getScrollPositionRTL(translateX) {
  20904. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  20905. // Scroll values on most browsers are ints instead of floats so we round
  20906. return Math.round(currentScrollLeft - translateX);
  20907. }
  20908. /**
  20909. * @param {number} scrollX
  20910. * @return {!MDCTabScrollerAnimation}
  20911. */
  20912. }, {
  20913. key: 'scrollToRTL',
  20914. value: function scrollToRTL(scrollX) {
  20915. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  20916. var clampedScrollLeft = this.clampScrollValue_(scrollX);
  20917. return (/** @type {!MDCTabScrollerAnimation} */{
  20918. finalScrollPosition: clampedScrollLeft,
  20919. scrollDelta: currentScrollLeft - clampedScrollLeft
  20920. }
  20921. );
  20922. }
  20923. /**
  20924. * @param {number} scrollX
  20925. * @return {!MDCTabScrollerAnimation}
  20926. */
  20927. }, {
  20928. key: 'incrementScrollRTL',
  20929. value: function incrementScrollRTL(scrollX) {
  20930. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  20931. var clampedScrollLeft = this.clampScrollValue_(currentScrollLeft + scrollX);
  20932. return (/** @type {!MDCTabScrollerAnimation} */{
  20933. finalScrollPosition: clampedScrollLeft,
  20934. scrollDelta: currentScrollLeft - clampedScrollLeft
  20935. }
  20936. );
  20937. }
  20938. /**
  20939. * @param {number} scrollX
  20940. * @return {number}
  20941. */
  20942. }, {
  20943. key: 'getAnimatingScrollPosition',
  20944. value: function getAnimatingScrollPosition(scrollX, translateX) {
  20945. return scrollX + translateX;
  20946. }
  20947. /**
  20948. * @return {!MDCTabScrollerHorizontalEdges}
  20949. * @private
  20950. */
  20951. }, {
  20952. key: 'calculateScrollEdges_',
  20953. value: function calculateScrollEdges_() {
  20954. var contentWidth = this.adapter_.getScrollContentOffsetWidth();
  20955. var rootWidth = this.adapter_.getScrollAreaOffsetWidth();
  20956. return (/** @type {!MDCTabScrollerHorizontalEdges} */{
  20957. left: contentWidth - rootWidth,
  20958. right: 0
  20959. }
  20960. );
  20961. }
  20962. /**
  20963. * @param {number} scrollX
  20964. * @return {number}
  20965. * @private
  20966. */
  20967. }, {
  20968. key: 'clampScrollValue_',
  20969. value: function clampScrollValue_(scrollX) {
  20970. var edges = this.calculateScrollEdges_();
  20971. return Math.min(Math.max(edges.right, scrollX), edges.left);
  20972. }
  20973. }]);
  20974. return MDCTabScrollerRTLReverse;
  20975. }(__WEBPACK_IMPORTED_MODULE_0__rtl_scroller__["a" /* default */]);
  20976. /* harmony default export */ __webpack_exports__["a"] = (MDCTabScrollerRTLReverse);
  20977. /***/ }),
  20978. /* 147 */
  20979. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20980. "use strict";
  20981. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  20982. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "computeHorizontalScrollbarHeight", function() { return computeHorizontalScrollbarHeight; });
  20983. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getMatchesProperty", function() { return getMatchesProperty; });
  20984. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__constants__ = __webpack_require__(58);
  20985. /**
  20986. * @license
  20987. * Copyright 2018 Google Inc.
  20988. *
  20989. * Permission is hereby granted, free of charge, to any person obtaining a copy
  20990. * of this software and associated documentation files (the "Software"), to deal
  20991. * in the Software without restriction, including without limitation the rights
  20992. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  20993. * copies of the Software, and to permit persons to whom the Software is
  20994. * furnished to do so, subject to the following conditions:
  20995. *
  20996. * The above copyright notice and this permission notice shall be included in
  20997. * all copies or substantial portions of the Software.
  20998. *
  20999. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  21000. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  21001. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  21002. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  21003. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  21004. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  21005. * THE SOFTWARE.
  21006. */
  21007. /**
  21008. * Stores result from computeHorizontalScrollbarHeight to avoid redundant processing.
  21009. * @private {number|undefined}
  21010. */
  21011. var horizontalScrollbarHeight_ = void 0;
  21012. /**
  21013. * Computes the height of browser-rendered horizontal scrollbars using a self-created test element.
  21014. * May return 0 (e.g. on OS X browsers under default configuration).
  21015. * @param {!Document} documentObj
  21016. * @param {boolean=} shouldCacheResult
  21017. * @return {number}
  21018. */
  21019. function computeHorizontalScrollbarHeight(documentObj) {
  21020. var shouldCacheResult = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  21021. if (shouldCacheResult && typeof horizontalScrollbarHeight_ !== 'undefined') {
  21022. return horizontalScrollbarHeight_;
  21023. }
  21024. var el = documentObj.createElement('div');
  21025. el.classList.add(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].SCROLL_TEST);
  21026. documentObj.body.appendChild(el);
  21027. var horizontalScrollbarHeight = el.offsetHeight - el.clientHeight;
  21028. documentObj.body.removeChild(el);
  21029. if (shouldCacheResult) {
  21030. horizontalScrollbarHeight_ = horizontalScrollbarHeight;
  21031. }
  21032. return horizontalScrollbarHeight;
  21033. }
  21034. /**
  21035. * @param {!Object} HTMLElementPrototype
  21036. * @return {string}
  21037. */
  21038. function getMatchesProperty(HTMLElementPrototype) {
  21039. return ['msMatchesSelector', 'matches'].filter(function (p) {
  21040. return p in HTMLElementPrototype;
  21041. }).pop();
  21042. }
  21043. /***/ }),
  21044. /* 148 */
  21045. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  21046. "use strict";
  21047. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  21048. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(149);
  21049. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__adapter__ = __webpack_require__(59);
  21050. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_tab_adapter__ = __webpack_require__(10);
  21051. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  21052. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  21053. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21054. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  21055. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  21056. /**
  21057. * @license
  21058. * Copyright 2018 Google Inc.
  21059. *
  21060. * Permission is hereby granted, free of charge, to any person obtaining a copy
  21061. * of this software and associated documentation files (the "Software"), to deal
  21062. * in the Software without restriction, including without limitation the rights
  21063. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  21064. * copies of the Software, and to permit persons to whom the Software is
  21065. * furnished to do so, subject to the following conditions:
  21066. *
  21067. * The above copyright notice and this permission notice shall be included in
  21068. * all copies or substantial portions of the Software.
  21069. *
  21070. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  21071. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  21072. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  21073. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  21074. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  21075. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  21076. * THE SOFTWARE.
  21077. */
  21078. /* eslint-disable no-unused-vars */
  21079. /* eslint-enable no-unused-vars */
  21080. /**
  21081. * @type {Set<string>}
  21082. */
  21083. var ACCEPTABLE_KEYS = new Set();
  21084. // IE11 has no support for new Set with iterable so we need to initialize this by hand
  21085. ACCEPTABLE_KEYS.add(__WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].ARROW_LEFT_KEY);
  21086. ACCEPTABLE_KEYS.add(__WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].ARROW_RIGHT_KEY);
  21087. ACCEPTABLE_KEYS.add(__WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].END_KEY);
  21088. ACCEPTABLE_KEYS.add(__WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].HOME_KEY);
  21089. ACCEPTABLE_KEYS.add(__WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].ENTER_KEY);
  21090. ACCEPTABLE_KEYS.add(__WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].SPACE_KEY);
  21091. /**
  21092. * @type {Map<number, string>}
  21093. */
  21094. var KEYCODE_MAP = new Map();
  21095. // IE11 has no support for new Map with iterable so we need to initialize this by hand
  21096. KEYCODE_MAP.set(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].ARROW_LEFT_KEYCODE, __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].ARROW_LEFT_KEY);
  21097. KEYCODE_MAP.set(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].ARROW_RIGHT_KEYCODE, __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].ARROW_RIGHT_KEY);
  21098. KEYCODE_MAP.set(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].END_KEYCODE, __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].END_KEY);
  21099. KEYCODE_MAP.set(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].HOME_KEYCODE, __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].HOME_KEY);
  21100. KEYCODE_MAP.set(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].ENTER_KEYCODE, __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].ENTER_KEY);
  21101. KEYCODE_MAP.set(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].SPACE_KEYCODE, __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].SPACE_KEY);
  21102. /**
  21103. * @extends {MDCFoundation<!MDCTabBarAdapter>}
  21104. * @final
  21105. */
  21106. var MDCTabBarFoundation = function (_MDCFoundation) {
  21107. _inherits(MDCTabBarFoundation, _MDCFoundation);
  21108. _createClass(MDCTabBarFoundation, null, [{
  21109. key: 'strings',
  21110. /** @return enum {string} */
  21111. get: function get() {
  21112. return __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */];
  21113. }
  21114. /** @return enum {number} */
  21115. }, {
  21116. key: 'numbers',
  21117. get: function get() {
  21118. return __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */];
  21119. }
  21120. /**
  21121. * @see MDCTabBarAdapter for typing information
  21122. * @return {!MDCTabBarAdapter}
  21123. */
  21124. }, {
  21125. key: 'defaultAdapter',
  21126. get: function get() {
  21127. return (/** @type {!MDCTabBarAdapter} */{
  21128. scrollTo: function scrollTo() {},
  21129. incrementScroll: function incrementScroll() {},
  21130. getScrollPosition: function getScrollPosition() {},
  21131. getScrollContentWidth: function getScrollContentWidth() {},
  21132. getOffsetWidth: function getOffsetWidth() {},
  21133. isRTL: function isRTL() {},
  21134. setActiveTab: function setActiveTab() {},
  21135. activateTabAtIndex: function activateTabAtIndex() {},
  21136. deactivateTabAtIndex: function deactivateTabAtIndex() {},
  21137. focusTabAtIndex: function focusTabAtIndex() {},
  21138. getTabIndicatorClientRectAtIndex: function getTabIndicatorClientRectAtIndex() {},
  21139. getTabDimensionsAtIndex: function getTabDimensionsAtIndex() {},
  21140. getPreviousActiveTabIndex: function getPreviousActiveTabIndex() {},
  21141. getFocusedTabIndex: function getFocusedTabIndex() {},
  21142. getIndexOfTabById: function getIndexOfTabById() {},
  21143. getTabListLength: function getTabListLength() {},
  21144. notifyTabActivated: function notifyTabActivated() {}
  21145. }
  21146. );
  21147. }
  21148. /**
  21149. * @param {!MDCTabBarAdapter} adapter
  21150. * */
  21151. }]);
  21152. function MDCTabBarFoundation(adapter) {
  21153. _classCallCheck(this, MDCTabBarFoundation);
  21154. /** @private {boolean} */
  21155. var _this = _possibleConstructorReturn(this, (MDCTabBarFoundation.__proto__ || Object.getPrototypeOf(MDCTabBarFoundation)).call(this, _extends(MDCTabBarFoundation.defaultAdapter, adapter)));
  21156. _this.useAutomaticActivation_ = false;
  21157. return _this;
  21158. }
  21159. /**
  21160. * Switches between automatic and manual activation modes.
  21161. * See https://www.w3.org/TR/wai-aria-practices/#tabpanel for examples.
  21162. * @param {boolean} useAutomaticActivation
  21163. */
  21164. _createClass(MDCTabBarFoundation, [{
  21165. key: 'setUseAutomaticActivation',
  21166. value: function setUseAutomaticActivation(useAutomaticActivation) {
  21167. this.useAutomaticActivation_ = useAutomaticActivation;
  21168. }
  21169. /**
  21170. * Activates the tab at the given index
  21171. * @param {number} index
  21172. */
  21173. }, {
  21174. key: 'activateTab',
  21175. value: function activateTab(index) {
  21176. var previousActiveIndex = this.adapter_.getPreviousActiveTabIndex();
  21177. if (!this.indexIsInRange_(index) || index === previousActiveIndex) {
  21178. return;
  21179. }
  21180. this.adapter_.deactivateTabAtIndex(previousActiveIndex);
  21181. this.adapter_.activateTabAtIndex(index, this.adapter_.getTabIndicatorClientRectAtIndex(previousActiveIndex));
  21182. this.scrollIntoView(index);
  21183. this.adapter_.notifyTabActivated(index);
  21184. }
  21185. /**
  21186. * Handles the keydown event
  21187. * @param {!Event} evt
  21188. */
  21189. }, {
  21190. key: 'handleKeyDown',
  21191. value: function handleKeyDown(evt) {
  21192. // Get the key from the event
  21193. var key = this.getKeyFromEvent_(evt);
  21194. // Early exit if the event key isn't one of the keyboard navigation keys
  21195. if (key === undefined) {
  21196. return;
  21197. }
  21198. // Prevent default behavior for movement keys, but not for activation keys, since :active is used to apply ripple
  21199. if (!this.isActivationKey_(key)) {
  21200. evt.preventDefault();
  21201. }
  21202. if (this.useAutomaticActivation_) {
  21203. if (this.isActivationKey_(key)) {
  21204. return;
  21205. }
  21206. var index = this.determineTargetFromKey_(this.adapter_.getPreviousActiveTabIndex(), key);
  21207. this.adapter_.setActiveTab(index);
  21208. this.scrollIntoView(index);
  21209. } else {
  21210. var focusedTabIndex = this.adapter_.getFocusedTabIndex();
  21211. if (this.isActivationKey_(key)) {
  21212. this.adapter_.setActiveTab(focusedTabIndex);
  21213. } else {
  21214. var _index = this.determineTargetFromKey_(focusedTabIndex, key);
  21215. this.adapter_.focusTabAtIndex(_index);
  21216. this.scrollIntoView(_index);
  21217. }
  21218. }
  21219. }
  21220. /**
  21221. * Handles the MDCTab:interacted event
  21222. * @param {!CustomEvent} evt
  21223. */
  21224. }, {
  21225. key: 'handleTabInteraction',
  21226. value: function handleTabInteraction(evt) {
  21227. this.adapter_.setActiveTab(this.adapter_.getIndexOfTabById(evt.detail.tabId));
  21228. }
  21229. /**
  21230. * Scrolls the tab at the given index into view
  21231. * @param {number} index The tab index to make visible
  21232. */
  21233. }, {
  21234. key: 'scrollIntoView',
  21235. value: function scrollIntoView(index) {
  21236. // Early exit if the index is out of range
  21237. if (!this.indexIsInRange_(index)) {
  21238. return;
  21239. }
  21240. // Always scroll to 0 if scrolling to the 0th index
  21241. if (index === 0) {
  21242. return this.adapter_.scrollTo(0);
  21243. }
  21244. // Always scroll to the max value if scrolling to the Nth index
  21245. // MDCTabScroller.scrollTo() will never scroll past the max possible value
  21246. if (index === this.adapter_.getTabListLength() - 1) {
  21247. return this.adapter_.scrollTo(this.adapter_.getScrollContentWidth());
  21248. }
  21249. if (this.isRTL_()) {
  21250. return this.scrollIntoViewRTL_(index);
  21251. }
  21252. this.scrollIntoView_(index);
  21253. }
  21254. /**
  21255. * Private method for determining the index of the destination tab based on what key was pressed
  21256. * @param {number} origin The original index from which to determine the destination
  21257. * @param {string} key The name of the key
  21258. * @return {number}
  21259. * @private
  21260. */
  21261. }, {
  21262. key: 'determineTargetFromKey_',
  21263. value: function determineTargetFromKey_(origin, key) {
  21264. var isRTL = this.isRTL_();
  21265. var maxIndex = this.adapter_.getTabListLength() - 1;
  21266. var shouldGoToEnd = key === __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].END_KEY;
  21267. var shouldDecrement = key === __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].ARROW_LEFT_KEY && !isRTL || key === __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].ARROW_RIGHT_KEY && isRTL;
  21268. var shouldIncrement = key === __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].ARROW_RIGHT_KEY && !isRTL || key === __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].ARROW_LEFT_KEY && isRTL;
  21269. var index = origin;
  21270. if (shouldGoToEnd) {
  21271. index = maxIndex;
  21272. } else if (shouldDecrement) {
  21273. index -= 1;
  21274. } else if (shouldIncrement) {
  21275. index += 1;
  21276. } else {
  21277. index = 0;
  21278. }
  21279. if (index < 0) {
  21280. index = maxIndex;
  21281. } else if (index > maxIndex) {
  21282. index = 0;
  21283. }
  21284. return index;
  21285. }
  21286. /**
  21287. * Calculates the scroll increment that will make the tab at the given index visible
  21288. * @param {number} index The index of the tab
  21289. * @param {number} nextIndex The index of the next tab
  21290. * @param {number} scrollPosition The current scroll position
  21291. * @param {number} barWidth The width of the Tab Bar
  21292. * @return {number}
  21293. * @private
  21294. */
  21295. }, {
  21296. key: 'calculateScrollIncrement_',
  21297. value: function calculateScrollIncrement_(index, nextIndex, scrollPosition, barWidth) {
  21298. var nextTabDimensions = this.adapter_.getTabDimensionsAtIndex(nextIndex);
  21299. var relativeContentLeft = nextTabDimensions.contentLeft - scrollPosition - barWidth;
  21300. var relativeContentRight = nextTabDimensions.contentRight - scrollPosition;
  21301. var leftIncrement = relativeContentRight - __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].EXTRA_SCROLL_AMOUNT;
  21302. var rightIncrement = relativeContentLeft + __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].EXTRA_SCROLL_AMOUNT;
  21303. if (nextIndex < index) {
  21304. return Math.min(leftIncrement, 0);
  21305. }
  21306. return Math.max(rightIncrement, 0);
  21307. }
  21308. /**
  21309. * Calculates the scroll increment that will make the tab at the given index visible in RTL
  21310. * @param {number} index The index of the tab
  21311. * @param {number} nextIndex The index of the next tab
  21312. * @param {number} scrollPosition The current scroll position
  21313. * @param {number} barWidth The width of the Tab Bar
  21314. * @param {number} scrollContentWidth The width of the scroll content
  21315. * @return {number}
  21316. * @private
  21317. */
  21318. }, {
  21319. key: 'calculateScrollIncrementRTL_',
  21320. value: function calculateScrollIncrementRTL_(index, nextIndex, scrollPosition, barWidth, scrollContentWidth) {
  21321. var nextTabDimensions = this.adapter_.getTabDimensionsAtIndex(nextIndex);
  21322. var relativeContentLeft = scrollContentWidth - nextTabDimensions.contentLeft - scrollPosition;
  21323. var relativeContentRight = scrollContentWidth - nextTabDimensions.contentRight - scrollPosition - barWidth;
  21324. var leftIncrement = relativeContentRight + __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].EXTRA_SCROLL_AMOUNT;
  21325. var rightIncrement = relativeContentLeft - __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].EXTRA_SCROLL_AMOUNT;
  21326. if (nextIndex > index) {
  21327. return Math.max(leftIncrement, 0);
  21328. }
  21329. return Math.min(rightIncrement, 0);
  21330. }
  21331. /**
  21332. * Determines the index of the adjacent tab closest to either edge of the Tab Bar
  21333. * @param {number} index The index of the tab
  21334. * @param {!MDCTabDimensions} tabDimensions The dimensions of the tab
  21335. * @param {number} scrollPosition The current scroll position
  21336. * @param {number} barWidth The width of the tab bar
  21337. * @return {number}
  21338. * @private
  21339. */
  21340. }, {
  21341. key: 'findAdjacentTabIndexClosestToEdge_',
  21342. value: function findAdjacentTabIndexClosestToEdge_(index, tabDimensions, scrollPosition, barWidth) {
  21343. /**
  21344. * Tabs are laid out in the Tab Scroller like this:
  21345. *
  21346. * Scroll Position
  21347. * +---+
  21348. * | | Bar Width
  21349. * | +-----------------------------------+
  21350. * | | |
  21351. * | V V
  21352. * | +-----------------------------------+
  21353. * V | Tab Scroller |
  21354. * +------------+--------------+-------------------+
  21355. * | Tab | Tab | Tab |
  21356. * +------------+--------------+-------------------+
  21357. * | |
  21358. * +-----------------------------------+
  21359. *
  21360. * To determine the next adjacent index, we look at the Tab root left and
  21361. * Tab root right, both relative to the scroll position. If the Tab root
  21362. * left is less than 0, then we know it's out of view to the left. If the
  21363. * Tab root right minus the bar width is greater than 0, we know the Tab is
  21364. * out of view to the right. From there, we either increment or decrement
  21365. * the index.
  21366. */
  21367. var relativeRootLeft = tabDimensions.rootLeft - scrollPosition;
  21368. var relativeRootRight = tabDimensions.rootRight - scrollPosition - barWidth;
  21369. var relativeRootDelta = relativeRootLeft + relativeRootRight;
  21370. var leftEdgeIsCloser = relativeRootLeft < 0 || relativeRootDelta < 0;
  21371. var rightEdgeIsCloser = relativeRootRight > 0 || relativeRootDelta > 0;
  21372. if (leftEdgeIsCloser) {
  21373. return index - 1;
  21374. }
  21375. if (rightEdgeIsCloser) {
  21376. return index + 1;
  21377. }
  21378. return -1;
  21379. }
  21380. /**
  21381. * Determines the index of the adjacent tab closest to either edge of the Tab Bar in RTL
  21382. * @param {number} index The index of the tab
  21383. * @param {!MDCTabDimensions} tabDimensions The dimensions of the tab
  21384. * @param {number} scrollPosition The current scroll position
  21385. * @param {number} barWidth The width of the tab bar
  21386. * @param {number} scrollContentWidth The width of the scroller content
  21387. * @return {number}
  21388. * @private
  21389. */
  21390. }, {
  21391. key: 'findAdjacentTabIndexClosestToEdgeRTL_',
  21392. value: function findAdjacentTabIndexClosestToEdgeRTL_(index, tabDimensions, scrollPosition, barWidth, scrollContentWidth) {
  21393. var rootLeft = scrollContentWidth - tabDimensions.rootLeft - barWidth - scrollPosition;
  21394. var rootRight = scrollContentWidth - tabDimensions.rootRight - scrollPosition;
  21395. var rootDelta = rootLeft + rootRight;
  21396. var leftEdgeIsCloser = rootLeft > 0 || rootDelta > 0;
  21397. var rightEdgeIsCloser = rootRight < 0 || rootDelta < 0;
  21398. if (leftEdgeIsCloser) {
  21399. return index + 1;
  21400. }
  21401. if (rightEdgeIsCloser) {
  21402. return index - 1;
  21403. }
  21404. return -1;
  21405. }
  21406. /**
  21407. * Returns the key associated with a keydown event
  21408. * @param {!Event} evt The keydown event
  21409. * @return {string}
  21410. * @private
  21411. */
  21412. }, {
  21413. key: 'getKeyFromEvent_',
  21414. value: function getKeyFromEvent_(evt) {
  21415. if (ACCEPTABLE_KEYS.has(evt.key)) {
  21416. return evt.key;
  21417. }
  21418. return KEYCODE_MAP.get(evt.keyCode);
  21419. }
  21420. }, {
  21421. key: 'isActivationKey_',
  21422. value: function isActivationKey_(key) {
  21423. return key === __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].SPACE_KEY || key === __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].ENTER_KEY;
  21424. }
  21425. /**
  21426. * Returns whether a given index is inclusively between the ends
  21427. * @param {number} index The index to test
  21428. * @private
  21429. */
  21430. }, {
  21431. key: 'indexIsInRange_',
  21432. value: function indexIsInRange_(index) {
  21433. return index >= 0 && index < this.adapter_.getTabListLength();
  21434. }
  21435. /**
  21436. * Returns the view's RTL property
  21437. * @return {boolean}
  21438. * @private
  21439. */
  21440. }, {
  21441. key: 'isRTL_',
  21442. value: function isRTL_() {
  21443. return this.adapter_.isRTL();
  21444. }
  21445. /**
  21446. * Scrolls the tab at the given index into view for left-to-right useragents
  21447. * @param {number} index The index of the tab to scroll into view
  21448. * @private
  21449. */
  21450. }, {
  21451. key: 'scrollIntoView_',
  21452. value: function scrollIntoView_(index) {
  21453. var scrollPosition = this.adapter_.getScrollPosition();
  21454. var barWidth = this.adapter_.getOffsetWidth();
  21455. var tabDimensions = this.adapter_.getTabDimensionsAtIndex(index);
  21456. var nextIndex = this.findAdjacentTabIndexClosestToEdge_(index, tabDimensions, scrollPosition, barWidth);
  21457. if (!this.indexIsInRange_(nextIndex)) {
  21458. return;
  21459. }
  21460. var scrollIncrement = this.calculateScrollIncrement_(index, nextIndex, scrollPosition, barWidth);
  21461. this.adapter_.incrementScroll(scrollIncrement);
  21462. }
  21463. /**
  21464. * Scrolls the tab at the given index into view in RTL
  21465. * @param {number} index The tab index to make visible
  21466. * @private
  21467. */
  21468. }, {
  21469. key: 'scrollIntoViewRTL_',
  21470. value: function scrollIntoViewRTL_(index) {
  21471. var scrollPosition = this.adapter_.getScrollPosition();
  21472. var barWidth = this.adapter_.getOffsetWidth();
  21473. var tabDimensions = this.adapter_.getTabDimensionsAtIndex(index);
  21474. var scrollWidth = this.adapter_.getScrollContentWidth();
  21475. var nextIndex = this.findAdjacentTabIndexClosestToEdgeRTL_(index, tabDimensions, scrollPosition, barWidth, scrollWidth);
  21476. if (!this.indexIsInRange_(nextIndex)) {
  21477. return;
  21478. }
  21479. var scrollIncrement = this.calculateScrollIncrementRTL_(index, nextIndex, scrollPosition, barWidth, scrollWidth);
  21480. this.adapter_.incrementScroll(scrollIncrement);
  21481. }
  21482. }]);
  21483. return MDCTabBarFoundation;
  21484. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  21485. /* harmony default export */ __webpack_exports__["a"] = (MDCTabBarFoundation);
  21486. /***/ }),
  21487. /* 149 */
  21488. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  21489. "use strict";
  21490. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return numbers; });
  21491. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  21492. /**
  21493. * @license
  21494. * Copyright 2018 Google Inc.
  21495. *
  21496. * Permission is hereby granted, free of charge, to any person obtaining a copy
  21497. * of this software and associated documentation files (the "Software"), to deal
  21498. * in the Software without restriction, including without limitation the rights
  21499. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  21500. * copies of the Software, and to permit persons to whom the Software is
  21501. * furnished to do so, subject to the following conditions:
  21502. *
  21503. * The above copyright notice and this permission notice shall be included in
  21504. * all copies or substantial portions of the Software.
  21505. *
  21506. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  21507. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  21508. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  21509. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  21510. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  21511. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  21512. * THE SOFTWARE.
  21513. */
  21514. /** @enum {string} */
  21515. var strings = {
  21516. TAB_ACTIVATED_EVENT: 'MDCTabBar:activated',
  21517. TAB_SCROLLER_SELECTOR: '.mdc-tab-scroller',
  21518. TAB_SELECTOR: '.mdc-tab',
  21519. ARROW_LEFT_KEY: 'ArrowLeft',
  21520. ARROW_RIGHT_KEY: 'ArrowRight',
  21521. END_KEY: 'End',
  21522. HOME_KEY: 'Home',
  21523. ENTER_KEY: 'Enter',
  21524. SPACE_KEY: 'Space'
  21525. };
  21526. /** @enum {number} */
  21527. var numbers = {
  21528. EXTRA_SCROLL_AMOUNT: 20,
  21529. ARROW_LEFT_KEYCODE: 37,
  21530. ARROW_RIGHT_KEYCODE: 39,
  21531. END_KEYCODE: 35,
  21532. HOME_KEYCODE: 36,
  21533. ENTER_KEYCODE: 13,
  21534. SPACE_KEYCODE: 32
  21535. };
  21536. /***/ }),
  21537. /* 150 */
  21538. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  21539. "use strict";
  21540. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  21541. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTextField", function() { return MDCTextField; });
  21542. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  21543. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__ = __webpack_require__(2);
  21544. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_ripple_util__ = __webpack_require__(5);
  21545. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__constants__ = __webpack_require__(60);
  21546. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__adapter__ = __webpack_require__(61);
  21547. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__foundation__ = __webpack_require__(154);
  21548. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__material_line_ripple_index__ = __webpack_require__(16);
  21549. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__helper_text_index__ = __webpack_require__(155);
  21550. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__character_counter_index__ = __webpack_require__(156);
  21551. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__icon_index__ = __webpack_require__(157);
  21552. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__material_floating_label_index__ = __webpack_require__(9);
  21553. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__material_notched_outline_index__ = __webpack_require__(20);
  21554. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTextFieldFoundation", function() { return __WEBPACK_IMPORTED_MODULE_5__foundation__["a"]; });
  21555. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTextFieldHelperText", function() { return __WEBPACK_IMPORTED_MODULE_7__helper_text_index__["a"]; });
  21556. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTextFieldHelperTextFoundation", function() { return __WEBPACK_IMPORTED_MODULE_7__helper_text_index__["b"]; });
  21557. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTextFieldCharacterCounter", function() { return __WEBPACK_IMPORTED_MODULE_8__character_counter_index__["a"]; });
  21558. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTextFieldCharacterCounterFoundation", function() { return __WEBPACK_IMPORTED_MODULE_8__character_counter_index__["b"]; });
  21559. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTextFieldIcon", function() { return __WEBPACK_IMPORTED_MODULE_9__icon_index__["a"]; });
  21560. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTextFieldIconFoundation", function() { return __WEBPACK_IMPORTED_MODULE_9__icon_index__["b"]; });
  21561. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  21562. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  21563. var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
  21564. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21565. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  21566. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  21567. /**
  21568. * @license
  21569. * Copyright 2016 Google Inc.
  21570. *
  21571. * Permission is hereby granted, free of charge, to any person obtaining a copy
  21572. * of this software and associated documentation files (the "Software"), to deal
  21573. * in the Software without restriction, including without limitation the rights
  21574. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  21575. * copies of the Software, and to permit persons to whom the Software is
  21576. * furnished to do so, subject to the following conditions:
  21577. *
  21578. * The above copyright notice and this permission notice shall be included in
  21579. * all copies or substantial portions of the Software.
  21580. *
  21581. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  21582. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  21583. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  21584. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  21585. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  21586. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  21587. * THE SOFTWARE.
  21588. */
  21589. /* eslint-disable no-unused-vars */
  21590. /* eslint-enable no-unused-vars */
  21591. /* eslint-disable no-unused-vars */
  21592. /* eslint-enable no-unused-vars */
  21593. /**
  21594. * @extends {MDCComponent<!MDCTextFieldFoundation>}
  21595. * @final
  21596. */
  21597. var MDCTextField = function (_MDCComponent) {
  21598. _inherits(MDCTextField, _MDCComponent);
  21599. /**
  21600. * @param {...?} args
  21601. */
  21602. function MDCTextField() {
  21603. var _ref;
  21604. _classCallCheck(this, MDCTextField);
  21605. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  21606. args[_key] = arguments[_key];
  21607. }
  21608. /** @private {?Element} */
  21609. var _this = _possibleConstructorReturn(this, (_ref = MDCTextField.__proto__ || Object.getPrototypeOf(MDCTextField)).call.apply(_ref, [this].concat(args)));
  21610. _this.input_;
  21611. /** @type {?MDCRipple} */
  21612. _this.ripple;
  21613. /** @private {?MDCLineRipple} */
  21614. _this.lineRipple_;
  21615. /** @private {?MDCTextFieldHelperText} */
  21616. _this.helperText_;
  21617. /** @private {?MDCTextFieldCharacterCounter} */
  21618. _this.characterCounter_;
  21619. /** @private {?MDCTextFieldIcon} */
  21620. _this.leadingIcon_;
  21621. /** @private {?MDCTextFieldIcon} */
  21622. _this.trailingIcon_;
  21623. /** @private {?MDCFloatingLabel} */
  21624. _this.label_;
  21625. /** @private {?MDCNotchedOutline} */
  21626. _this.outline_;
  21627. return _this;
  21628. }
  21629. /**
  21630. * @param {!Element} root
  21631. * @return {!MDCTextField}
  21632. */
  21633. _createClass(MDCTextField, [{
  21634. key: 'initialize',
  21635. /**
  21636. * @param {(function(!Element, MDCRippleFoundation): !MDCRipple)=} rippleFactory A function which
  21637. * creates a new MDCRipple.
  21638. * @param {(function(!Element): !MDCLineRipple)=} lineRippleFactory A function which
  21639. * creates a new MDCLineRipple.
  21640. * @param {(function(!Element): !MDCTextFieldHelperText)=} helperTextFactory A function which
  21641. * creates a new MDCTextFieldHelperText.
  21642. * @param {(function(!Element): !MDCTextFieldCharacterCounter)=} characterCounterFactory A function which
  21643. * creates a new MDCTextFieldCharacterCounter.
  21644. * @param {(function(!Element): !MDCTextFieldIcon)=} iconFactory A function which
  21645. * creates a new MDCTextFieldIcon.
  21646. * @param {(function(!Element): !MDCFloatingLabel)=} labelFactory A function which
  21647. * creates a new MDCFloatingLabel.
  21648. * @param {(function(!Element): !MDCNotchedOutline)=} outlineFactory A function which
  21649. * creates a new MDCNotchedOutline.
  21650. */
  21651. value: function initialize() {
  21652. var rippleFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (el, foundation) {
  21653. return new __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRipple"](el, foundation);
  21654. };
  21655. var lineRippleFactory = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (el) {
  21656. return new __WEBPACK_IMPORTED_MODULE_6__material_line_ripple_index__["MDCLineRipple"](el);
  21657. };
  21658. var helperTextFactory = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function (el) {
  21659. return new __WEBPACK_IMPORTED_MODULE_7__helper_text_index__["a" /* MDCTextFieldHelperText */](el);
  21660. };
  21661. var characterCounterFactory = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : function (el) {
  21662. return new __WEBPACK_IMPORTED_MODULE_8__character_counter_index__["a" /* MDCTextFieldCharacterCounter */](el);
  21663. };
  21664. var iconFactory = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : function (el) {
  21665. return new __WEBPACK_IMPORTED_MODULE_9__icon_index__["a" /* MDCTextFieldIcon */](el);
  21666. };
  21667. var _this2 = this;
  21668. var labelFactory = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : function (el) {
  21669. return new __WEBPACK_IMPORTED_MODULE_10__material_floating_label_index__["MDCFloatingLabel"](el);
  21670. };
  21671. var outlineFactory = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : function (el) {
  21672. return new __WEBPACK_IMPORTED_MODULE_11__material_notched_outline_index__["MDCNotchedOutline"](el);
  21673. };
  21674. this.input_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["e" /* strings */].INPUT_SELECTOR);
  21675. var labelElement = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["e" /* strings */].LABEL_SELECTOR);
  21676. if (labelElement) {
  21677. this.label_ = labelFactory(labelElement);
  21678. }
  21679. var lineRippleElement = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["e" /* strings */].LINE_RIPPLE_SELECTOR);
  21680. if (lineRippleElement) {
  21681. this.lineRipple_ = lineRippleFactory(lineRippleElement);
  21682. }
  21683. var outlineElement = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["e" /* strings */].OUTLINE_SELECTOR);
  21684. if (outlineElement) {
  21685. this.outline_ = outlineFactory(outlineElement);
  21686. }
  21687. // Helper text
  21688. var helperTextStrings = __WEBPACK_IMPORTED_MODULE_7__helper_text_index__["b" /* MDCTextFieldHelperTextFoundation */].strings;
  21689. var nextElementSibling = this.root_.nextElementSibling;
  21690. var hasHelperLine = nextElementSibling && nextElementSibling.classList.contains(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* cssClasses */].HELPER_LINE);
  21691. var helperTextEl = hasHelperLine && nextElementSibling.querySelector(helperTextStrings.ROOT_SELECTOR);
  21692. if (helperTextEl) {
  21693. this.helperText_ = helperTextFactory(helperTextEl);
  21694. }
  21695. // Character counter
  21696. var characterCounterStrings = __WEBPACK_IMPORTED_MODULE_8__character_counter_index__["b" /* MDCTextFieldCharacterCounterFoundation */].strings;
  21697. var characterCounterEl = this.root_.querySelector(characterCounterStrings.ROOT_SELECTOR);
  21698. // If character counter is not found in root element search in sibling element.
  21699. if (!characterCounterEl && hasHelperLine) {
  21700. characterCounterEl = nextElementSibling.querySelector(characterCounterStrings.ROOT_SELECTOR);
  21701. }
  21702. if (characterCounterEl) {
  21703. this.characterCounter_ = characterCounterFactory(characterCounterEl);
  21704. }
  21705. var iconElements = this.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_3__constants__["e" /* strings */].ICON_SELECTOR);
  21706. if (iconElements.length > 0) {
  21707. if (iconElements.length > 1) {
  21708. // Has both icons.
  21709. this.leadingIcon_ = iconFactory(iconElements[0]);
  21710. this.trailingIcon_ = iconFactory(iconElements[1]);
  21711. } else {
  21712. if (this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* cssClasses */].WITH_LEADING_ICON)) {
  21713. this.leadingIcon_ = iconFactory(iconElements[0]);
  21714. } else {
  21715. this.trailingIcon_ = iconFactory(iconElements[0]);
  21716. }
  21717. }
  21718. }
  21719. this.ripple = null;
  21720. if (!this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* cssClasses */].TEXTAREA) && !this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* cssClasses */].OUTLINED)) {
  21721. var MATCHES = Object(__WEBPACK_IMPORTED_MODULE_2__material_ripple_util__["getMatchesProperty"])(HTMLElement.prototype);
  21722. var adapter = _extends(__WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRipple"].createAdapter( /** @type {!RippleCapableSurface} */this), {
  21723. isSurfaceActive: function isSurfaceActive() {
  21724. return _this2.input_[MATCHES](':active');
  21725. },
  21726. registerInteractionHandler: function registerInteractionHandler(type, handler) {
  21727. return _this2.input_.addEventListener(type, handler);
  21728. },
  21729. deregisterInteractionHandler: function deregisterInteractionHandler(type, handler) {
  21730. return _this2.input_.removeEventListener(type, handler);
  21731. }
  21732. });
  21733. var foundation = new __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRippleFoundation"](adapter);
  21734. this.ripple = rippleFactory(this.root_, foundation);
  21735. }
  21736. }
  21737. }, {
  21738. key: 'destroy',
  21739. value: function destroy() {
  21740. if (this.ripple) {
  21741. this.ripple.destroy();
  21742. }
  21743. if (this.lineRipple_) {
  21744. this.lineRipple_.destroy();
  21745. }
  21746. if (this.helperText_) {
  21747. this.helperText_.destroy();
  21748. }
  21749. if (this.characterCounter_) {
  21750. this.characterCounter_.destroy();
  21751. }
  21752. if (this.leadingIcon_) {
  21753. this.leadingIcon_.destroy();
  21754. }
  21755. if (this.trailingIcon_) {
  21756. this.trailingIcon_.destroy();
  21757. }
  21758. if (this.label_) {
  21759. this.label_.destroy();
  21760. }
  21761. if (this.outline_) {
  21762. this.outline_.destroy();
  21763. }
  21764. _get(MDCTextField.prototype.__proto__ || Object.getPrototypeOf(MDCTextField.prototype), 'destroy', this).call(this);
  21765. }
  21766. /**
  21767. * Initiliazes the Text Field's internal state based on the environment's
  21768. * state.
  21769. */
  21770. }, {
  21771. key: 'initialSyncWithDom',
  21772. value: function initialSyncWithDom() {
  21773. this.disabled = this.input_.disabled;
  21774. }
  21775. /**
  21776. * @return {string} The value of the input.
  21777. */
  21778. }, {
  21779. key: 'focus',
  21780. /**
  21781. * Focuses the input element.
  21782. */
  21783. value: function focus() {
  21784. this.input_.focus();
  21785. }
  21786. /**
  21787. * Recomputes the outline SVG path for the outline element.
  21788. */
  21789. }, {
  21790. key: 'layout',
  21791. value: function layout() {
  21792. var openNotch = this.foundation_.shouldFloat;
  21793. this.foundation_.notchOutline(openNotch);
  21794. }
  21795. /**
  21796. * @return {!MDCTextFieldFoundation}
  21797. */
  21798. }, {
  21799. key: 'getDefaultFoundation',
  21800. value: function getDefaultFoundation() {
  21801. var _this3 = this;
  21802. return new __WEBPACK_IMPORTED_MODULE_5__foundation__["a" /* default */](
  21803. /** @type {!MDCTextFieldAdapter} */_extends({
  21804. addClass: function addClass(className) {
  21805. return _this3.root_.classList.add(className);
  21806. },
  21807. removeClass: function removeClass(className) {
  21808. return _this3.root_.classList.remove(className);
  21809. },
  21810. hasClass: function hasClass(className) {
  21811. return _this3.root_.classList.contains(className);
  21812. },
  21813. registerTextFieldInteractionHandler: function registerTextFieldInteractionHandler(evtType, handler) {
  21814. return _this3.root_.addEventListener(evtType, handler);
  21815. },
  21816. deregisterTextFieldInteractionHandler: function deregisterTextFieldInteractionHandler(evtType, handler) {
  21817. return _this3.root_.removeEventListener(evtType, handler);
  21818. },
  21819. registerValidationAttributeChangeHandler: function registerValidationAttributeChangeHandler(handler) {
  21820. var getAttributesList = function getAttributesList(mutationsList) {
  21821. return mutationsList.map(function (mutation) {
  21822. return mutation.attributeName;
  21823. });
  21824. };
  21825. var observer = new MutationObserver(function (mutationsList) {
  21826. return handler(getAttributesList(mutationsList));
  21827. });
  21828. var targetNode = _this3.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["e" /* strings */].INPUT_SELECTOR);
  21829. var config = { attributes: true };
  21830. observer.observe(targetNode, config);
  21831. return observer;
  21832. },
  21833. deregisterValidationAttributeChangeHandler: function deregisterValidationAttributeChangeHandler(observer) {
  21834. return observer.disconnect();
  21835. },
  21836. isFocused: function isFocused() {
  21837. return document.activeElement === _this3.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["e" /* strings */].INPUT_SELECTOR);
  21838. }
  21839. }, this.getInputAdapterMethods_(), this.getLabelAdapterMethods_(), this.getLineRippleAdapterMethods_(), this.getOutlineAdapterMethods_()), this.getFoundationMap_());
  21840. }
  21841. /**
  21842. * @return {!{
  21843. * shakeLabel: function(boolean): undefined,
  21844. * floatLabel: function(boolean): undefined,
  21845. * hasLabel: function(): boolean,
  21846. * getLabelWidth: function(): number,
  21847. * }}
  21848. */
  21849. }, {
  21850. key: 'getLabelAdapterMethods_',
  21851. value: function getLabelAdapterMethods_() {
  21852. var _this4 = this;
  21853. return {
  21854. shakeLabel: function shakeLabel(shouldShake) {
  21855. return _this4.label_.shake(shouldShake);
  21856. },
  21857. floatLabel: function floatLabel(shouldFloat) {
  21858. return _this4.label_.float(shouldFloat);
  21859. },
  21860. hasLabel: function hasLabel() {
  21861. return !!_this4.label_;
  21862. },
  21863. getLabelWidth: function getLabelWidth() {
  21864. return _this4.label_ ? _this4.label_.getWidth() : 0;
  21865. }
  21866. };
  21867. }
  21868. /**
  21869. * @return {!{
  21870. * activateLineRipple: function(): undefined,
  21871. * deactivateLineRipple: function(): undefined,
  21872. * setLineRippleTransformOrigin: function(number): undefined,
  21873. * }}
  21874. */
  21875. }, {
  21876. key: 'getLineRippleAdapterMethods_',
  21877. value: function getLineRippleAdapterMethods_() {
  21878. var _this5 = this;
  21879. return {
  21880. activateLineRipple: function activateLineRipple() {
  21881. if (_this5.lineRipple_) {
  21882. _this5.lineRipple_.activate();
  21883. }
  21884. },
  21885. deactivateLineRipple: function deactivateLineRipple() {
  21886. if (_this5.lineRipple_) {
  21887. _this5.lineRipple_.deactivate();
  21888. }
  21889. },
  21890. setLineRippleTransformOrigin: function setLineRippleTransformOrigin(normalizedX) {
  21891. if (_this5.lineRipple_) {
  21892. _this5.lineRipple_.setRippleCenter(normalizedX);
  21893. }
  21894. }
  21895. };
  21896. }
  21897. /**
  21898. * @return {!{
  21899. * notchOutline: function(number, boolean): undefined,
  21900. * hasOutline: function(): boolean,
  21901. * }}
  21902. */
  21903. }, {
  21904. key: 'getOutlineAdapterMethods_',
  21905. value: function getOutlineAdapterMethods_() {
  21906. var _this6 = this;
  21907. return {
  21908. notchOutline: function notchOutline(labelWidth) {
  21909. return _this6.outline_.notch(labelWidth);
  21910. },
  21911. closeOutline: function closeOutline() {
  21912. return _this6.outline_.closeNotch();
  21913. },
  21914. hasOutline: function hasOutline() {
  21915. return !!_this6.outline_;
  21916. }
  21917. };
  21918. }
  21919. /**
  21920. * @return {!{
  21921. * registerInputInteractionHandler: function(string, function()): undefined,
  21922. * deregisterInputInteractionHandler: function(string, function()): undefined,
  21923. * getNativeInput: function(): ?Element,
  21924. * }}
  21925. */
  21926. }, {
  21927. key: 'getInputAdapterMethods_',
  21928. value: function getInputAdapterMethods_() {
  21929. var _this7 = this;
  21930. return {
  21931. registerInputInteractionHandler: function registerInputInteractionHandler(evtType, handler) {
  21932. return _this7.input_.addEventListener(evtType, handler);
  21933. },
  21934. deregisterInputInteractionHandler: function deregisterInputInteractionHandler(evtType, handler) {
  21935. return _this7.input_.removeEventListener(evtType, handler);
  21936. },
  21937. getNativeInput: function getNativeInput() {
  21938. return _this7.input_;
  21939. }
  21940. };
  21941. }
  21942. /**
  21943. * Returns a map of all subcomponents to subfoundations.
  21944. * @return {!FoundationMapType}
  21945. */
  21946. }, {
  21947. key: 'getFoundationMap_',
  21948. value: function getFoundationMap_() {
  21949. return {
  21950. helperText: this.helperText_ ? this.helperText_.foundation : undefined,
  21951. characterCounter: this.characterCounter_ ? this.characterCounter_.foundation : undefined,
  21952. leadingIcon: this.leadingIcon_ ? this.leadingIcon_.foundation : undefined,
  21953. trailingIcon: this.trailingIcon_ ? this.trailingIcon_.foundation : undefined
  21954. };
  21955. }
  21956. }, {
  21957. key: 'value',
  21958. get: function get() {
  21959. return this.foundation_.getValue();
  21960. }
  21961. /**
  21962. * @param {string} value The value to set on the input.
  21963. */
  21964. ,
  21965. set: function set(value) {
  21966. this.foundation_.setValue(value);
  21967. }
  21968. /**
  21969. * @return {boolean} True if the Text Field is disabled.
  21970. */
  21971. }, {
  21972. key: 'disabled',
  21973. get: function get() {
  21974. return this.foundation_.isDisabled();
  21975. }
  21976. /**
  21977. * @param {boolean} disabled Sets the Text Field disabled or enabled.
  21978. */
  21979. ,
  21980. set: function set(disabled) {
  21981. this.foundation_.setDisabled(disabled);
  21982. }
  21983. /**
  21984. * @return {boolean} valid True if the Text Field is valid.
  21985. */
  21986. }, {
  21987. key: 'valid',
  21988. get: function get() {
  21989. return this.foundation_.isValid();
  21990. }
  21991. /**
  21992. * @param {boolean} valid Sets the Text Field valid or invalid.
  21993. */
  21994. ,
  21995. set: function set(valid) {
  21996. this.foundation_.setValid(valid);
  21997. }
  21998. /**
  21999. * @return {boolean} True if the Text Field is required.
  22000. */
  22001. }, {
  22002. key: 'required',
  22003. get: function get() {
  22004. return this.input_.required;
  22005. }
  22006. /**
  22007. * @param {boolean} required Sets the Text Field to required.
  22008. */
  22009. ,
  22010. set: function set(required) {
  22011. this.input_.required = required;
  22012. }
  22013. /**
  22014. * @return {string} The input element's validation pattern.
  22015. */
  22016. }, {
  22017. key: 'pattern',
  22018. get: function get() {
  22019. return this.input_.pattern;
  22020. }
  22021. /**
  22022. * @param {string} pattern Sets the input element's validation pattern.
  22023. */
  22024. ,
  22025. set: function set(pattern) {
  22026. this.input_.pattern = pattern;
  22027. }
  22028. /**
  22029. * @return {number} The input element's minLength.
  22030. */
  22031. }, {
  22032. key: 'minLength',
  22033. get: function get() {
  22034. return this.input_.minLength;
  22035. }
  22036. /**
  22037. * @param {number} minLength Sets the input element's minLength.
  22038. */
  22039. ,
  22040. set: function set(minLength) {
  22041. this.input_.minLength = minLength;
  22042. }
  22043. /**
  22044. * @return {number} The input element's maxLength.
  22045. */
  22046. }, {
  22047. key: 'maxLength',
  22048. get: function get() {
  22049. return this.input_.maxLength;
  22050. }
  22051. /**
  22052. * @param {number} maxLength Sets the input element's maxLength.
  22053. */
  22054. ,
  22055. set: function set(maxLength) {
  22056. // Chrome throws exception if maxLength is set < 0
  22057. if (maxLength < 0) {
  22058. this.input_.removeAttribute('maxLength');
  22059. } else {
  22060. this.input_.maxLength = maxLength;
  22061. }
  22062. }
  22063. /**
  22064. * @return {string} The input element's min.
  22065. */
  22066. }, {
  22067. key: 'min',
  22068. get: function get() {
  22069. return this.input_.min;
  22070. }
  22071. /**
  22072. * @param {string} min Sets the input element's min.
  22073. */
  22074. ,
  22075. set: function set(min) {
  22076. this.input_.min = min;
  22077. }
  22078. /**
  22079. * @return {string} The input element's max.
  22080. */
  22081. }, {
  22082. key: 'max',
  22083. get: function get() {
  22084. return this.input_.max;
  22085. }
  22086. /**
  22087. * @param {string} max Sets the input element's max.
  22088. */
  22089. ,
  22090. set: function set(max) {
  22091. this.input_.max = max;
  22092. }
  22093. /**
  22094. * @return {string} The input element's step.
  22095. */
  22096. }, {
  22097. key: 'step',
  22098. get: function get() {
  22099. return this.input_.step;
  22100. }
  22101. /**
  22102. * @param {string} step Sets the input element's step.
  22103. */
  22104. ,
  22105. set: function set(step) {
  22106. this.input_.step = step;
  22107. }
  22108. /**
  22109. * Sets the helper text element content.
  22110. * @param {string} content
  22111. */
  22112. }, {
  22113. key: 'helperTextContent',
  22114. set: function set(content) {
  22115. this.foundation_.setHelperTextContent(content);
  22116. }
  22117. /**
  22118. * Sets the aria label of the leading icon.
  22119. * @param {string} label
  22120. */
  22121. }, {
  22122. key: 'leadingIconAriaLabel',
  22123. set: function set(label) {
  22124. this.foundation_.setLeadingIconAriaLabel(label);
  22125. }
  22126. /**
  22127. * Sets the text content of the leading icon.
  22128. * @param {string} content
  22129. */
  22130. }, {
  22131. key: 'leadingIconContent',
  22132. set: function set(content) {
  22133. this.foundation_.setLeadingIconContent(content);
  22134. }
  22135. /**
  22136. * Sets the aria label of the trailing icon.
  22137. * @param {string} label
  22138. */
  22139. }, {
  22140. key: 'trailingIconAriaLabel',
  22141. set: function set(label) {
  22142. this.foundation_.setTrailingIconAriaLabel(label);
  22143. }
  22144. /**
  22145. * Sets the text content of the trailing icon.
  22146. * @param {string} content
  22147. */
  22148. }, {
  22149. key: 'trailingIconContent',
  22150. set: function set(content) {
  22151. this.foundation_.setTrailingIconContent(content);
  22152. }
  22153. /**
  22154. * Enables or disables the use of native validation. Use this for custom validation.
  22155. * @param {boolean} useNativeValidation Set this to false to ignore native input validation.
  22156. */
  22157. }, {
  22158. key: 'useNativeValidation',
  22159. set: function set(useNativeValidation) {
  22160. this.foundation_.setUseNativeValidation(useNativeValidation);
  22161. }
  22162. }], [{
  22163. key: 'attachTo',
  22164. value: function attachTo(root) {
  22165. return new MDCTextField(root);
  22166. }
  22167. }]);
  22168. return MDCTextField;
  22169. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  22170. /***/ }),
  22171. /* 151 */
  22172. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22173. "use strict";
  22174. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  22175. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  22176. /**
  22177. * @license
  22178. * Copyright 2016 Google Inc.
  22179. *
  22180. * Permission is hereby granted, free of charge, to any person obtaining a copy
  22181. * of this software and associated documentation files (the "Software"), to deal
  22182. * in the Software without restriction, including without limitation the rights
  22183. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  22184. * copies of the Software, and to permit persons to whom the Software is
  22185. * furnished to do so, subject to the following conditions:
  22186. *
  22187. * The above copyright notice and this permission notice shall be included in
  22188. * all copies or substantial portions of the Software.
  22189. *
  22190. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  22191. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  22192. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  22193. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  22194. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  22195. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  22196. * THE SOFTWARE.
  22197. */
  22198. /** @enum {string} */
  22199. var cssClasses = {
  22200. ROOT: 'mdc-text-field-helper-text',
  22201. HELPER_TEXT_PERSISTENT: 'mdc-text-field-helper-text--persistent',
  22202. HELPER_TEXT_VALIDATION_MSG: 'mdc-text-field-helper-text--validation-msg'
  22203. };
  22204. /** @enum {string} */
  22205. var strings = {
  22206. ARIA_HIDDEN: 'aria-hidden',
  22207. ROLE: 'role',
  22208. ROOT_SELECTOR: '.' + cssClasses.ROOT
  22209. };
  22210. /***/ }),
  22211. /* 152 */
  22212. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22213. "use strict";
  22214. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  22215. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  22216. /**
  22217. * @license
  22218. * Copyright 2019 Google Inc.
  22219. *
  22220. * Permission is hereby granted, free of charge, to any person obtaining a copy
  22221. * of this software and associated documentation files (the "Software"), to deal
  22222. * in the Software without restriction, including without limitation the rights
  22223. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  22224. * copies of the Software, and to permit persons to whom the Software is
  22225. * furnished to do so, subject to the following conditions:
  22226. *
  22227. * The above copyright notice and this permission notice shall be included in
  22228. * all copies or substantial portions of the Software.
  22229. *
  22230. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  22231. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  22232. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  22233. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  22234. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  22235. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  22236. * THE SOFTWARE.
  22237. */
  22238. /** @enum {string} */
  22239. var cssClasses = {
  22240. ROOT: 'mdc-text-field-character-counter'
  22241. };
  22242. /** @enum {string} */
  22243. var strings = {
  22244. ROOT_SELECTOR: '.' + cssClasses.ROOT
  22245. };
  22246. /***/ }),
  22247. /* 153 */
  22248. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22249. "use strict";
  22250. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return strings; });
  22251. /**
  22252. * @license
  22253. * Copyright 2016 Google Inc.
  22254. *
  22255. * Permission is hereby granted, free of charge, to any person obtaining a copy
  22256. * of this software and associated documentation files (the "Software"), to deal
  22257. * in the Software without restriction, including without limitation the rights
  22258. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  22259. * copies of the Software, and to permit persons to whom the Software is
  22260. * furnished to do so, subject to the following conditions:
  22261. *
  22262. * The above copyright notice and this permission notice shall be included in
  22263. * all copies or substantial portions of the Software.
  22264. *
  22265. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  22266. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  22267. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  22268. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  22269. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  22270. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  22271. * THE SOFTWARE.
  22272. */
  22273. /** @enum {string} */
  22274. var strings = {
  22275. ICON_EVENT: 'MDCTextField:icon',
  22276. ICON_ROLE: 'button'
  22277. };
  22278. /***/ }),
  22279. /* 154 */
  22280. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22281. "use strict";
  22282. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  22283. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__helper_text_foundation__ = __webpack_require__(25);
  22284. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__character_counter_foundation__ = __webpack_require__(26);
  22285. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__icon_foundation__ = __webpack_require__(27);
  22286. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__adapter__ = __webpack_require__(61);
  22287. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__constants__ = __webpack_require__(60);
  22288. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  22289. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  22290. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22291. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  22292. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  22293. /**
  22294. * @license
  22295. * Copyright 2016 Google Inc.
  22296. *
  22297. * Permission is hereby granted, free of charge, to any person obtaining a copy
  22298. * of this software and associated documentation files (the "Software"), to deal
  22299. * in the Software without restriction, including without limitation the rights
  22300. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  22301. * copies of the Software, and to permit persons to whom the Software is
  22302. * furnished to do so, subject to the following conditions:
  22303. *
  22304. * The above copyright notice and this permission notice shall be included in
  22305. * all copies or substantial portions of the Software.
  22306. *
  22307. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  22308. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  22309. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  22310. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  22311. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  22312. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  22313. * THE SOFTWARE.
  22314. */
  22315. /* eslint-disable no-unused-vars */
  22316. /* eslint-enable no-unused-vars */
  22317. /**
  22318. * @extends {MDCFoundation<!MDCTextFieldAdapter>}
  22319. * @final
  22320. */
  22321. var MDCTextFieldFoundation = function (_MDCFoundation) {
  22322. _inherits(MDCTextFieldFoundation, _MDCFoundation);
  22323. _createClass(MDCTextFieldFoundation, [{
  22324. key: 'shouldShake',
  22325. /** @return {boolean} */
  22326. get: function get() {
  22327. return !this.isValid() && !this.isFocused_ && !!this.getValue();
  22328. }
  22329. /**
  22330. * @return {boolean}
  22331. * @private
  22332. */
  22333. }, {
  22334. key: 'shouldAlwaysFloat_',
  22335. get: function get() {
  22336. var type = this.getNativeInput_().type;
  22337. return __WEBPACK_IMPORTED_MODULE_5__constants__["a" /* ALWAYS_FLOAT_TYPES */].indexOf(type) >= 0;
  22338. }
  22339. /** @return {boolean} */
  22340. }, {
  22341. key: 'shouldFloat',
  22342. get: function get() {
  22343. return this.shouldAlwaysFloat_ || this.isFocused_ || !!this.getValue() || this.isBadInput_();
  22344. }
  22345. /**
  22346. * {@see MDCTextFieldAdapter} for typing information on parameters and return
  22347. * types.
  22348. * @return {!MDCTextFieldAdapter}
  22349. */
  22350. }], [{
  22351. key: 'cssClasses',
  22352. /** @return enum {string} */
  22353. get: function get() {
  22354. return __WEBPACK_IMPORTED_MODULE_5__constants__["c" /* cssClasses */];
  22355. }
  22356. /** @return enum {string} */
  22357. }, {
  22358. key: 'strings',
  22359. get: function get() {
  22360. return __WEBPACK_IMPORTED_MODULE_5__constants__["e" /* strings */];
  22361. }
  22362. /** @return enum {string} */
  22363. }, {
  22364. key: 'numbers',
  22365. get: function get() {
  22366. return __WEBPACK_IMPORTED_MODULE_5__constants__["d" /* numbers */];
  22367. }
  22368. }, {
  22369. key: 'defaultAdapter',
  22370. get: function get() {
  22371. return (/** @type {!MDCTextFieldAdapter} */{
  22372. addClass: function addClass() {},
  22373. removeClass: function removeClass() {},
  22374. hasClass: function hasClass() {},
  22375. registerTextFieldInteractionHandler: function registerTextFieldInteractionHandler() {},
  22376. deregisterTextFieldInteractionHandler: function deregisterTextFieldInteractionHandler() {},
  22377. registerInputInteractionHandler: function registerInputInteractionHandler() {},
  22378. deregisterInputInteractionHandler: function deregisterInputInteractionHandler() {},
  22379. registerValidationAttributeChangeHandler: function registerValidationAttributeChangeHandler() {},
  22380. deregisterValidationAttributeChangeHandler: function deregisterValidationAttributeChangeHandler() {},
  22381. getNativeInput: function getNativeInput() {},
  22382. isFocused: function isFocused() {},
  22383. activateLineRipple: function activateLineRipple() {},
  22384. deactivateLineRipple: function deactivateLineRipple() {},
  22385. setLineRippleTransformOrigin: function setLineRippleTransformOrigin() {},
  22386. shakeLabel: function shakeLabel() {},
  22387. floatLabel: function floatLabel() {},
  22388. hasLabel: function hasLabel() {},
  22389. getLabelWidth: function getLabelWidth() {},
  22390. hasOutline: function hasOutline() {},
  22391. notchOutline: function notchOutline() {},
  22392. closeOutline: function closeOutline() {}
  22393. }
  22394. );
  22395. }
  22396. /**
  22397. * @param {!MDCTextFieldAdapter} adapter
  22398. * @param {!FoundationMapType=} foundationMap Map from subcomponent names to their subfoundations.
  22399. */
  22400. }]);
  22401. function MDCTextFieldFoundation(adapter) {
  22402. var foundationMap = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : /** @type {!FoundationMapType} */{};
  22403. _classCallCheck(this, MDCTextFieldFoundation);
  22404. /** @type {!MDCTextFieldHelperTextFoundation|undefined} */
  22405. var _this = _possibleConstructorReturn(this, (MDCTextFieldFoundation.__proto__ || Object.getPrototypeOf(MDCTextFieldFoundation)).call(this, _extends(MDCTextFieldFoundation.defaultAdapter, adapter)));
  22406. _this.helperText_ = foundationMap.helperText;
  22407. /** @type {!MDCTextFieldCharacterCounterFoundation|undefined} */
  22408. _this.characterCounter_ = foundationMap.characterCounter;
  22409. /** @type {!MDCTextFieldIconFoundation|undefined} */
  22410. _this.leadingIcon_ = foundationMap.leadingIcon;
  22411. /** @type {!MDCTextFieldIconFoundation|undefined} */
  22412. _this.trailingIcon_ = foundationMap.trailingIcon;
  22413. /** @private {boolean} */
  22414. _this.isFocused_ = false;
  22415. /** @private {boolean} */
  22416. _this.receivedUserInput_ = false;
  22417. /** @private {boolean} */
  22418. _this.useCustomValidityChecking_ = false;
  22419. /** @private {boolean} */
  22420. _this.isValid_ = true;
  22421. /** @private {boolean} */
  22422. _this.useNativeValidation_ = true;
  22423. /** @private {function(): undefined} */
  22424. _this.inputFocusHandler_ = function () {
  22425. return _this.activateFocus();
  22426. };
  22427. /** @private {function(): undefined} */
  22428. _this.inputBlurHandler_ = function () {
  22429. return _this.deactivateFocus();
  22430. };
  22431. /** @private {function(): undefined} */
  22432. _this.inputInputHandler_ = function () {
  22433. return _this.handleInput();
  22434. };
  22435. /** @private {function(!Event): undefined} */
  22436. _this.setPointerXOffset_ = function (evt) {
  22437. return _this.setTransformOrigin(evt);
  22438. };
  22439. /** @private {function(!Event): undefined} */
  22440. _this.textFieldInteractionHandler_ = function () {
  22441. return _this.handleTextFieldInteraction();
  22442. };
  22443. /** @private {function(!Array): undefined} */
  22444. _this.validationAttributeChangeHandler_ = function (attributesList) {
  22445. return _this.handleValidationAttributeChange(attributesList);
  22446. };
  22447. /** @private {!MutationObserver} */
  22448. _this.validationObserver_;
  22449. return _this;
  22450. }
  22451. _createClass(MDCTextFieldFoundation, [{
  22452. key: 'init',
  22453. value: function init() {
  22454. var _this2 = this;
  22455. if (this.adapter_.isFocused()) {
  22456. this.inputFocusHandler_();
  22457. } else if (this.adapter_.hasLabel() && this.shouldFloat) {
  22458. this.notchOutline(true);
  22459. this.adapter_.floatLabel(true);
  22460. }
  22461. this.adapter_.registerInputInteractionHandler('focus', this.inputFocusHandler_);
  22462. this.adapter_.registerInputInteractionHandler('blur', this.inputBlurHandler_);
  22463. this.adapter_.registerInputInteractionHandler('input', this.inputInputHandler_);
  22464. ['mousedown', 'touchstart'].forEach(function (evtType) {
  22465. _this2.adapter_.registerInputInteractionHandler(evtType, _this2.setPointerXOffset_);
  22466. });
  22467. ['click', 'keydown'].forEach(function (evtType) {
  22468. _this2.adapter_.registerTextFieldInteractionHandler(evtType, _this2.textFieldInteractionHandler_);
  22469. });
  22470. this.validationObserver_ = this.adapter_.registerValidationAttributeChangeHandler(this.validationAttributeChangeHandler_);
  22471. this.setCharacterCounter_(this.getValue().length);
  22472. }
  22473. }, {
  22474. key: 'destroy',
  22475. value: function destroy() {
  22476. var _this3 = this;
  22477. this.adapter_.deregisterInputInteractionHandler('focus', this.inputFocusHandler_);
  22478. this.adapter_.deregisterInputInteractionHandler('blur', this.inputBlurHandler_);
  22479. this.adapter_.deregisterInputInteractionHandler('input', this.inputInputHandler_);
  22480. ['mousedown', 'touchstart'].forEach(function (evtType) {
  22481. _this3.adapter_.deregisterInputInteractionHandler(evtType, _this3.setPointerXOffset_);
  22482. });
  22483. ['click', 'keydown'].forEach(function (evtType) {
  22484. _this3.adapter_.deregisterTextFieldInteractionHandler(evtType, _this3.textFieldInteractionHandler_);
  22485. });
  22486. this.adapter_.deregisterValidationAttributeChangeHandler(this.validationObserver_);
  22487. }
  22488. /**
  22489. * Handles user interactions with the Text Field.
  22490. */
  22491. }, {
  22492. key: 'handleTextFieldInteraction',
  22493. value: function handleTextFieldInteraction() {
  22494. if (this.adapter_.getNativeInput().disabled) {
  22495. return;
  22496. }
  22497. this.receivedUserInput_ = true;
  22498. }
  22499. /**
  22500. * Handles validation attribute changes
  22501. * @param {!Array<string>} attributesList
  22502. */
  22503. }, {
  22504. key: 'handleValidationAttributeChange',
  22505. value: function handleValidationAttributeChange(attributesList) {
  22506. var _this4 = this;
  22507. attributesList.some(function (attributeName) {
  22508. if (__WEBPACK_IMPORTED_MODULE_5__constants__["b" /* VALIDATION_ATTR_WHITELIST */].indexOf(attributeName) > -1) {
  22509. _this4.styleValidity_(true);
  22510. return true;
  22511. }
  22512. });
  22513. if (attributesList.indexOf('maxlength') > -1) {
  22514. this.setCharacterCounter_(this.getValue().length);
  22515. }
  22516. }
  22517. /**
  22518. * Opens/closes the notched outline.
  22519. * @param {boolean} openNotch
  22520. */
  22521. }, {
  22522. key: 'notchOutline',
  22523. value: function notchOutline(openNotch) {
  22524. if (!this.adapter_.hasOutline()) {
  22525. return;
  22526. }
  22527. if (openNotch) {
  22528. var isDense = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_5__constants__["c" /* cssClasses */].DENSE);
  22529. var labelScale = isDense ? __WEBPACK_IMPORTED_MODULE_5__constants__["d" /* numbers */].DENSE_LABEL_SCALE : __WEBPACK_IMPORTED_MODULE_5__constants__["d" /* numbers */].LABEL_SCALE;
  22530. var labelWidth = this.adapter_.getLabelWidth() * labelScale;
  22531. this.adapter_.notchOutline(labelWidth);
  22532. } else {
  22533. this.adapter_.closeOutline();
  22534. }
  22535. }
  22536. /**
  22537. * Activates the text field focus state.
  22538. */
  22539. }, {
  22540. key: 'activateFocus',
  22541. value: function activateFocus() {
  22542. this.isFocused_ = true;
  22543. this.styleFocused_(this.isFocused_);
  22544. this.adapter_.activateLineRipple();
  22545. if (this.adapter_.hasLabel()) {
  22546. this.notchOutline(this.shouldFloat);
  22547. this.adapter_.floatLabel(this.shouldFloat);
  22548. this.adapter_.shakeLabel(this.shouldShake);
  22549. }
  22550. if (this.helperText_) {
  22551. this.helperText_.showToScreenReader();
  22552. }
  22553. }
  22554. /**
  22555. * Sets the line ripple's transform origin, so that the line ripple activate
  22556. * animation will animate out from the user's click location.
  22557. * @param {!Event} evt
  22558. */
  22559. }, {
  22560. key: 'setTransformOrigin',
  22561. value: function setTransformOrigin(evt) {
  22562. var targetEvent = void 0;
  22563. if (evt.touches) {
  22564. targetEvent = evt.touches[0];
  22565. } else {
  22566. targetEvent = evt;
  22567. }
  22568. var targetClientRect = targetEvent.target.getBoundingClientRect();
  22569. var normalizedX = targetEvent.clientX - targetClientRect.left;
  22570. this.adapter_.setLineRippleTransformOrigin(normalizedX);
  22571. }
  22572. /**
  22573. * Handles input change of text input and text area.
  22574. */
  22575. }, {
  22576. key: 'handleInput',
  22577. value: function handleInput() {
  22578. this.autoCompleteFocus();
  22579. this.setCharacterCounter_(this.getValue().length);
  22580. }
  22581. /**
  22582. * Activates the Text Field's focus state in cases when the input value
  22583. * changes without user input (e.g. programatically).
  22584. */
  22585. }, {
  22586. key: 'autoCompleteFocus',
  22587. value: function autoCompleteFocus() {
  22588. if (!this.receivedUserInput_) {
  22589. this.activateFocus();
  22590. }
  22591. }
  22592. /**
  22593. * Deactivates the Text Field's focus state.
  22594. */
  22595. }, {
  22596. key: 'deactivateFocus',
  22597. value: function deactivateFocus() {
  22598. this.isFocused_ = false;
  22599. this.adapter_.deactivateLineRipple();
  22600. var isValid = this.isValid();
  22601. this.styleValidity_(isValid);
  22602. this.styleFocused_(this.isFocused_);
  22603. if (this.adapter_.hasLabel()) {
  22604. this.notchOutline(this.shouldFloat);
  22605. this.adapter_.floatLabel(this.shouldFloat);
  22606. this.adapter_.shakeLabel(this.shouldShake);
  22607. }
  22608. if (!this.shouldFloat) {
  22609. this.receivedUserInput_ = false;
  22610. }
  22611. }
  22612. /**
  22613. * @return {string} The value of the input Element.
  22614. */
  22615. }, {
  22616. key: 'getValue',
  22617. value: function getValue() {
  22618. return this.getNativeInput_().value;
  22619. }
  22620. /**
  22621. * @param {string} value The value to set on the input Element.
  22622. */
  22623. }, {
  22624. key: 'setValue',
  22625. value: function setValue(value) {
  22626. // Prevent Safari from moving the caret to the end of the input when the value has not changed.
  22627. if (this.getValue() !== value) {
  22628. this.getNativeInput_().value = value;
  22629. }
  22630. var isValid = this.isValid();
  22631. this.styleValidity_(isValid);
  22632. if (this.adapter_.hasLabel()) {
  22633. this.notchOutline(this.shouldFloat);
  22634. this.adapter_.floatLabel(this.shouldFloat);
  22635. this.adapter_.shakeLabel(this.shouldShake);
  22636. }
  22637. }
  22638. /**
  22639. * @return {boolean} If a custom validity is set, returns that value.
  22640. * Otherwise, returns the result of native validity checks.
  22641. */
  22642. }, {
  22643. key: 'isValid',
  22644. value: function isValid() {
  22645. return this.useNativeValidation_ ? this.isNativeInputValid_() : this.isValid_;
  22646. }
  22647. /**
  22648. * @param {boolean} isValid Sets the validity state of the Text Field.
  22649. */
  22650. }, {
  22651. key: 'setValid',
  22652. value: function setValid(isValid) {
  22653. this.isValid_ = isValid;
  22654. this.styleValidity_(isValid);
  22655. var shouldShake = !isValid && !this.isFocused_;
  22656. if (this.adapter_.hasLabel()) {
  22657. this.adapter_.shakeLabel(shouldShake);
  22658. }
  22659. }
  22660. /**
  22661. * Enables or disables the use of native validation. Use this for custom validation.
  22662. * @param {boolean} useNativeValidation Set this to false to ignore native input validation.
  22663. */
  22664. }, {
  22665. key: 'setUseNativeValidation',
  22666. value: function setUseNativeValidation(useNativeValidation) {
  22667. this.useNativeValidation_ = useNativeValidation;
  22668. }
  22669. /**
  22670. * @return {boolean} True if the Text Field is disabled.
  22671. */
  22672. }, {
  22673. key: 'isDisabled',
  22674. value: function isDisabled() {
  22675. return this.getNativeInput_().disabled;
  22676. }
  22677. /**
  22678. * @param {boolean} disabled Sets the text-field disabled or enabled.
  22679. */
  22680. }, {
  22681. key: 'setDisabled',
  22682. value: function setDisabled(disabled) {
  22683. this.getNativeInput_().disabled = disabled;
  22684. this.styleDisabled_(disabled);
  22685. }
  22686. /**
  22687. * @param {string} content Sets the content of the helper text.
  22688. */
  22689. }, {
  22690. key: 'setHelperTextContent',
  22691. value: function setHelperTextContent(content) {
  22692. if (this.helperText_) {
  22693. this.helperText_.setContent(content);
  22694. }
  22695. }
  22696. /**
  22697. * Sets character counter values that shows characters used and the total character limit.
  22698. * @param {number} currentLength
  22699. * @private
  22700. */
  22701. }, {
  22702. key: 'setCharacterCounter_',
  22703. value: function setCharacterCounter_(currentLength) {
  22704. if (!this.characterCounter_) return;
  22705. var maxLength = this.getNativeInput_().maxLength;
  22706. if (maxLength === -1) {
  22707. throw new Error('MDCTextFieldFoundation: Expected maxlength html property on text input or textarea.');
  22708. }
  22709. this.characterCounter_.setCounterValue(currentLength, maxLength);
  22710. }
  22711. /**
  22712. * Sets the aria label of the leading icon.
  22713. * @param {string} label
  22714. */
  22715. }, {
  22716. key: 'setLeadingIconAriaLabel',
  22717. value: function setLeadingIconAriaLabel(label) {
  22718. if (this.leadingIcon_) {
  22719. this.leadingIcon_.setAriaLabel(label);
  22720. }
  22721. }
  22722. /**
  22723. * Sets the text content of the leading icon.
  22724. * @param {string} content
  22725. */
  22726. }, {
  22727. key: 'setLeadingIconContent',
  22728. value: function setLeadingIconContent(content) {
  22729. if (this.leadingIcon_) {
  22730. this.leadingIcon_.setContent(content);
  22731. }
  22732. }
  22733. /**
  22734. * Sets the aria label of the trailing icon.
  22735. * @param {string} label
  22736. */
  22737. }, {
  22738. key: 'setTrailingIconAriaLabel',
  22739. value: function setTrailingIconAriaLabel(label) {
  22740. if (this.trailingIcon_) {
  22741. this.trailingIcon_.setAriaLabel(label);
  22742. }
  22743. }
  22744. /**
  22745. * Sets the text content of the trailing icon.
  22746. * @param {string} content
  22747. */
  22748. }, {
  22749. key: 'setTrailingIconContent',
  22750. value: function setTrailingIconContent(content) {
  22751. if (this.trailingIcon_) {
  22752. this.trailingIcon_.setContent(content);
  22753. }
  22754. }
  22755. /**
  22756. * @return {boolean} True if the Text Field input fails in converting the
  22757. * user-supplied value.
  22758. * @private
  22759. */
  22760. }, {
  22761. key: 'isBadInput_',
  22762. value: function isBadInput_() {
  22763. return this.getNativeInput_().validity.badInput;
  22764. }
  22765. /**
  22766. * @return {boolean} The result of native validity checking
  22767. * (ValidityState.valid).
  22768. */
  22769. }, {
  22770. key: 'isNativeInputValid_',
  22771. value: function isNativeInputValid_() {
  22772. return this.getNativeInput_().validity.valid;
  22773. }
  22774. /**
  22775. * Styles the component based on the validity state.
  22776. * @param {boolean} isValid
  22777. * @private
  22778. */
  22779. }, {
  22780. key: 'styleValidity_',
  22781. value: function styleValidity_(isValid) {
  22782. var INVALID = MDCTextFieldFoundation.cssClasses.INVALID;
  22783. if (isValid) {
  22784. this.adapter_.removeClass(INVALID);
  22785. } else {
  22786. this.adapter_.addClass(INVALID);
  22787. }
  22788. if (this.helperText_) {
  22789. this.helperText_.setValidity(isValid);
  22790. }
  22791. }
  22792. /**
  22793. * Styles the component based on the focused state.
  22794. * @param {boolean} isFocused
  22795. * @private
  22796. */
  22797. }, {
  22798. key: 'styleFocused_',
  22799. value: function styleFocused_(isFocused) {
  22800. var FOCUSED = MDCTextFieldFoundation.cssClasses.FOCUSED;
  22801. if (isFocused) {
  22802. this.adapter_.addClass(FOCUSED);
  22803. } else {
  22804. this.adapter_.removeClass(FOCUSED);
  22805. }
  22806. }
  22807. /**
  22808. * Styles the component based on the disabled state.
  22809. * @param {boolean} isDisabled
  22810. * @private
  22811. */
  22812. }, {
  22813. key: 'styleDisabled_',
  22814. value: function styleDisabled_(isDisabled) {
  22815. var _MDCTextFieldFoundati = MDCTextFieldFoundation.cssClasses,
  22816. DISABLED = _MDCTextFieldFoundati.DISABLED,
  22817. INVALID = _MDCTextFieldFoundati.INVALID;
  22818. if (isDisabled) {
  22819. this.adapter_.addClass(DISABLED);
  22820. this.adapter_.removeClass(INVALID);
  22821. } else {
  22822. this.adapter_.removeClass(DISABLED);
  22823. }
  22824. if (this.leadingIcon_) {
  22825. this.leadingIcon_.setDisabled(isDisabled);
  22826. }
  22827. if (this.trailingIcon_) {
  22828. this.trailingIcon_.setDisabled(isDisabled);
  22829. }
  22830. }
  22831. /**
  22832. * @return {!Element|!NativeInputType} The native text input from the
  22833. * host environment, or a dummy if none exists.
  22834. * @private
  22835. */
  22836. }, {
  22837. key: 'getNativeInput_',
  22838. value: function getNativeInput_() {
  22839. return this.adapter_.getNativeInput() ||
  22840. /** @type {!NativeInputType} */{
  22841. value: '',
  22842. disabled: false,
  22843. validity: {
  22844. badInput: false,
  22845. valid: true
  22846. }
  22847. };
  22848. }
  22849. }]);
  22850. return MDCTextFieldFoundation;
  22851. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  22852. /* harmony default export */ __webpack_exports__["a"] = (MDCTextFieldFoundation);
  22853. /***/ }),
  22854. /* 155 */
  22855. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22856. "use strict";
  22857. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCTextFieldHelperText; });
  22858. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  22859. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(62);
  22860. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(25);
  22861. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  22862. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  22863. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  22864. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22865. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  22866. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  22867. /**
  22868. * @license
  22869. * Copyright 2017 Google Inc.
  22870. *
  22871. * Permission is hereby granted, free of charge, to any person obtaining a copy
  22872. * of this software and associated documentation files (the "Software"), to deal
  22873. * in the Software without restriction, including without limitation the rights
  22874. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  22875. * copies of the Software, and to permit persons to whom the Software is
  22876. * furnished to do so, subject to the following conditions:
  22877. *
  22878. * The above copyright notice and this permission notice shall be included in
  22879. * all copies or substantial portions of the Software.
  22880. *
  22881. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  22882. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  22883. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  22884. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  22885. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  22886. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  22887. * THE SOFTWARE.
  22888. */
  22889. /**
  22890. * @extends {MDCComponent<!MDCTextFieldHelperTextFoundation>}
  22891. * @final
  22892. */
  22893. var MDCTextFieldHelperText = function (_MDCComponent) {
  22894. _inherits(MDCTextFieldHelperText, _MDCComponent);
  22895. function MDCTextFieldHelperText() {
  22896. _classCallCheck(this, MDCTextFieldHelperText);
  22897. return _possibleConstructorReturn(this, (MDCTextFieldHelperText.__proto__ || Object.getPrototypeOf(MDCTextFieldHelperText)).apply(this, arguments));
  22898. }
  22899. _createClass(MDCTextFieldHelperText, [{
  22900. key: 'getDefaultFoundation',
  22901. /**
  22902. * @return {!MDCTextFieldHelperTextFoundation}
  22903. */
  22904. value: function getDefaultFoundation() {
  22905. var _this2 = this;
  22906. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]( /** @type {!MDCTextFieldHelperTextAdapter} */_extends({
  22907. addClass: function addClass(className) {
  22908. return _this2.root_.classList.add(className);
  22909. },
  22910. removeClass: function removeClass(className) {
  22911. return _this2.root_.classList.remove(className);
  22912. },
  22913. hasClass: function hasClass(className) {
  22914. return _this2.root_.classList.contains(className);
  22915. },
  22916. setAttr: function setAttr(attr, value) {
  22917. return _this2.root_.setAttribute(attr, value);
  22918. },
  22919. removeAttr: function removeAttr(attr) {
  22920. return _this2.root_.removeAttribute(attr);
  22921. },
  22922. setContent: function setContent(content) {
  22923. _this2.root_.textContent = content;
  22924. }
  22925. }));
  22926. }
  22927. }, {
  22928. key: 'foundation',
  22929. /**
  22930. * @return {!MDCTextFieldHelperTextFoundation}
  22931. */
  22932. get: function get() {
  22933. return this.foundation_;
  22934. }
  22935. }], [{
  22936. key: 'attachTo',
  22937. /**
  22938. * @param {!Element} root
  22939. * @return {!MDCTextFieldHelperText}
  22940. */
  22941. value: function attachTo(root) {
  22942. return new MDCTextFieldHelperText(root);
  22943. }
  22944. }]);
  22945. return MDCTextFieldHelperText;
  22946. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  22947. /***/ }),
  22948. /* 156 */
  22949. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22950. "use strict";
  22951. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCTextFieldCharacterCounter; });
  22952. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  22953. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(63);
  22954. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(26);
  22955. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  22956. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  22957. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  22958. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22959. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  22960. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  22961. /**
  22962. * @license
  22963. * Copyright 2019 Google Inc.
  22964. *
  22965. * Permission is hereby granted, free of charge, to any person obtaining a copy
  22966. * of this software and associated documentation files (the "Software"), to deal
  22967. * in the Software without restriction, including without limitation the rights
  22968. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  22969. * copies of the Software, and to permit persons to whom the Software is
  22970. * furnished to do so, subject to the following conditions:
  22971. *
  22972. * The above copyright notice and this permission notice shall be included in
  22973. * all copies or substantial portions of the Software.
  22974. *
  22975. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  22976. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  22977. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  22978. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  22979. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  22980. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  22981. * THE SOFTWARE.
  22982. */
  22983. /**
  22984. * @extends {MDCComponent<!MDCTextFieldCharacterCounterFoundation>}
  22985. * @final
  22986. */
  22987. var MDCTextFieldCharacterCounter = function (_MDCComponent) {
  22988. _inherits(MDCTextFieldCharacterCounter, _MDCComponent);
  22989. function MDCTextFieldCharacterCounter() {
  22990. _classCallCheck(this, MDCTextFieldCharacterCounter);
  22991. return _possibleConstructorReturn(this, (MDCTextFieldCharacterCounter.__proto__ || Object.getPrototypeOf(MDCTextFieldCharacterCounter)).apply(this, arguments));
  22992. }
  22993. _createClass(MDCTextFieldCharacterCounter, [{
  22994. key: 'getDefaultFoundation',
  22995. /**
  22996. * @return {!MDCTextFieldCharacterCounterFoundation}
  22997. */
  22998. value: function getDefaultFoundation() {
  22999. var _this2 = this;
  23000. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */](
  23001. /** @type {!MDCTextFieldCharacterCounterAdapter} */_extends({
  23002. setContent: function setContent(content) {
  23003. _this2.root_.textContent = content;
  23004. }
  23005. }));
  23006. }
  23007. }, {
  23008. key: 'foundation',
  23009. /**
  23010. * @return {!MDCTextFieldCharacterCounterFoundation}
  23011. */
  23012. get: function get() {
  23013. return this.foundation_;
  23014. }
  23015. }], [{
  23016. key: 'attachTo',
  23017. /**
  23018. * @param {!Element} root
  23019. * @return {!MDCTextFieldCharacterCounter}
  23020. */
  23021. value: function attachTo(root) {
  23022. return new MDCTextFieldCharacterCounter(root);
  23023. }
  23024. }]);
  23025. return MDCTextFieldCharacterCounter;
  23026. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  23027. /***/ }),
  23028. /* 157 */
  23029. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  23030. "use strict";
  23031. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCTextFieldIcon; });
  23032. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  23033. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(64);
  23034. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(27);
  23035. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  23036. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  23037. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  23038. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  23039. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  23040. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  23041. /**
  23042. * @license
  23043. * Copyright 2017 Google Inc.
  23044. *
  23045. * Permission is hereby granted, free of charge, to any person obtaining a copy
  23046. * of this software and associated documentation files (the "Software"), to deal
  23047. * in the Software without restriction, including without limitation the rights
  23048. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  23049. * copies of the Software, and to permit persons to whom the Software is
  23050. * furnished to do so, subject to the following conditions:
  23051. *
  23052. * The above copyright notice and this permission notice shall be included in
  23053. * all copies or substantial portions of the Software.
  23054. *
  23055. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  23056. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  23057. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  23058. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  23059. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  23060. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  23061. * THE SOFTWARE.
  23062. */
  23063. /**
  23064. * @extends {MDCComponent<!MDCTextFieldIconFoundation>}
  23065. * @final
  23066. */
  23067. var MDCTextFieldIcon = function (_MDCComponent) {
  23068. _inherits(MDCTextFieldIcon, _MDCComponent);
  23069. function MDCTextFieldIcon() {
  23070. _classCallCheck(this, MDCTextFieldIcon);
  23071. return _possibleConstructorReturn(this, (MDCTextFieldIcon.__proto__ || Object.getPrototypeOf(MDCTextFieldIcon)).apply(this, arguments));
  23072. }
  23073. _createClass(MDCTextFieldIcon, [{
  23074. key: 'getDefaultFoundation',
  23075. /**
  23076. * @return {!MDCTextFieldIconFoundation}
  23077. */
  23078. value: function getDefaultFoundation() {
  23079. var _this2 = this;
  23080. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]( /** @type {!MDCTextFieldIconAdapter} */_extends({
  23081. getAttr: function getAttr(attr) {
  23082. return _this2.root_.getAttribute(attr);
  23083. },
  23084. setAttr: function setAttr(attr, value) {
  23085. return _this2.root_.setAttribute(attr, value);
  23086. },
  23087. removeAttr: function removeAttr(attr) {
  23088. return _this2.root_.removeAttribute(attr);
  23089. },
  23090. setContent: function setContent(content) {
  23091. _this2.root_.textContent = content;
  23092. },
  23093. registerInteractionHandler: function registerInteractionHandler(evtType, handler) {
  23094. return _this2.root_.addEventListener(evtType, handler);
  23095. },
  23096. deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) {
  23097. return _this2.root_.removeEventListener(evtType, handler);
  23098. },
  23099. notifyIconAction: function notifyIconAction() {
  23100. return _this2.emit(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.ICON_EVENT, {} /* evtData */, true /* shouldBubble */);
  23101. }
  23102. }));
  23103. }
  23104. }, {
  23105. key: 'foundation',
  23106. /**
  23107. * @return {!MDCTextFieldIconFoundation}
  23108. */
  23109. get: function get() {
  23110. return this.foundation_;
  23111. }
  23112. }], [{
  23113. key: 'attachTo',
  23114. /**
  23115. * @param {!Element} root
  23116. * @return {!MDCTextFieldIcon}
  23117. */
  23118. value: function attachTo(root) {
  23119. return new MDCTextFieldIcon(root);
  23120. }
  23121. }]);
  23122. return MDCTextFieldIcon;
  23123. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  23124. /***/ }),
  23125. /* 158 */
  23126. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  23127. "use strict";
  23128. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  23129. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCToolbar", function() { return MDCToolbar; });
  23130. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  23131. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__ = __webpack_require__(2);
  23132. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(159);
  23133. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCToolbarFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  23134. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  23135. var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
  23136. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  23137. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  23138. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  23139. /**
  23140. * @license
  23141. * Copyright 2017 Google Inc.
  23142. *
  23143. * Permission is hereby granted, free of charge, to any person obtaining a copy
  23144. * of this software and associated documentation files (the "Software"), to deal
  23145. * in the Software without restriction, including without limitation the rights
  23146. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  23147. * copies of the Software, and to permit persons to whom the Software is
  23148. * furnished to do so, subject to the following conditions:
  23149. *
  23150. * The above copyright notice and this permission notice shall be included in
  23151. * all copies or substantial portions of the Software.
  23152. *
  23153. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  23154. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  23155. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  23156. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  23157. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  23158. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  23159. * THE SOFTWARE.
  23160. */
  23161. var MDCToolbar = function (_MDCComponent) {
  23162. _inherits(MDCToolbar, _MDCComponent);
  23163. function MDCToolbar() {
  23164. _classCallCheck(this, MDCToolbar);
  23165. return _possibleConstructorReturn(this, (MDCToolbar.__proto__ || Object.getPrototypeOf(MDCToolbar)).apply(this, arguments));
  23166. }
  23167. _createClass(MDCToolbar, [{
  23168. key: 'initialize',
  23169. value: function initialize() {
  23170. this.ripples_ = [].map.call(this.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.ICON_SELECTOR), function (icon) {
  23171. var ripple = __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRipple"].attachTo(icon);
  23172. ripple.unbounded = true;
  23173. return ripple;
  23174. });
  23175. }
  23176. }, {
  23177. key: 'destroy',
  23178. value: function destroy() {
  23179. this.ripples_.forEach(function (ripple) {
  23180. ripple.destroy();
  23181. });
  23182. _get(MDCToolbar.prototype.__proto__ || Object.getPrototypeOf(MDCToolbar.prototype), 'destroy', this).call(this);
  23183. }
  23184. }, {
  23185. key: 'getDefaultFoundation',
  23186. value: function getDefaultFoundation() {
  23187. var _this2 = this;
  23188. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]({
  23189. hasClass: function hasClass(className) {
  23190. return _this2.root_.classList.contains(className);
  23191. },
  23192. addClass: function addClass(className) {
  23193. return _this2.root_.classList.add(className);
  23194. },
  23195. removeClass: function removeClass(className) {
  23196. return _this2.root_.classList.remove(className);
  23197. },
  23198. registerScrollHandler: function registerScrollHandler(handler) {
  23199. return window.addEventListener('scroll', handler);
  23200. },
  23201. deregisterScrollHandler: function deregisterScrollHandler(handler) {
  23202. return window.removeEventListener('scroll', handler);
  23203. },
  23204. registerResizeHandler: function registerResizeHandler(handler) {
  23205. return window.addEventListener('resize', handler);
  23206. },
  23207. deregisterResizeHandler: function deregisterResizeHandler(handler) {
  23208. return window.removeEventListener('resize', handler);
  23209. },
  23210. getViewportWidth: function getViewportWidth() {
  23211. return window.innerWidth;
  23212. },
  23213. getViewportScrollY: function getViewportScrollY() {
  23214. return window.pageYOffset;
  23215. },
  23216. getOffsetHeight: function getOffsetHeight() {
  23217. return _this2.root_.offsetHeight;
  23218. },
  23219. getFirstRowElementOffsetHeight: function getFirstRowElementOffsetHeight() {
  23220. return _this2.firstRowElement_.offsetHeight;
  23221. },
  23222. notifyChange: function notifyChange(evtData) {
  23223. return _this2.emit(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.CHANGE_EVENT, evtData);
  23224. },
  23225. setStyle: function setStyle(property, value) {
  23226. return _this2.root_.style.setProperty(property, value);
  23227. },
  23228. setStyleForTitleElement: function setStyleForTitleElement(property, value) {
  23229. return _this2.titleElement_.style.setProperty(property, value);
  23230. },
  23231. setStyleForFlexibleRowElement: function setStyleForFlexibleRowElement(property, value) {
  23232. return _this2.firstRowElement_.style.setProperty(property, value);
  23233. },
  23234. setStyleForFixedAdjustElement: function setStyleForFixedAdjustElement(property, value) {
  23235. if (_this2.fixedAdjustElement) {
  23236. _this2.fixedAdjustElement.style.setProperty(property, value);
  23237. }
  23238. }
  23239. });
  23240. }
  23241. }, {
  23242. key: 'firstRowElement_',
  23243. get: function get() {
  23244. return this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.FIRST_ROW_SELECTOR);
  23245. }
  23246. }, {
  23247. key: 'titleElement_',
  23248. get: function get() {
  23249. return this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.TITLE_SELECTOR);
  23250. }
  23251. }, {
  23252. key: 'fixedAdjustElement',
  23253. set: function set(fixedAdjustElement) {
  23254. this.fixedAdjustElement_ = fixedAdjustElement;
  23255. this.foundation_.updateAdjustElementStyles();
  23256. },
  23257. get: function get() {
  23258. return this.fixedAdjustElement_;
  23259. }
  23260. }], [{
  23261. key: 'attachTo',
  23262. value: function attachTo(root) {
  23263. return new MDCToolbar(root);
  23264. }
  23265. }]);
  23266. return MDCToolbar;
  23267. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  23268. /***/ }),
  23269. /* 159 */
  23270. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  23271. "use strict";
  23272. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  23273. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(160);
  23274. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  23275. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  23276. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  23277. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  23278. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  23279. /**
  23280. * @license
  23281. * Copyright 2017 Google Inc.
  23282. *
  23283. * Permission is hereby granted, free of charge, to any person obtaining a copy
  23284. * of this software and associated documentation files (the "Software"), to deal
  23285. * in the Software without restriction, including without limitation the rights
  23286. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  23287. * copies of the Software, and to permit persons to whom the Software is
  23288. * furnished to do so, subject to the following conditions:
  23289. *
  23290. * The above copyright notice and this permission notice shall be included in
  23291. * all copies or substantial portions of the Software.
  23292. *
  23293. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  23294. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  23295. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  23296. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  23297. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  23298. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  23299. * THE SOFTWARE.
  23300. */
  23301. var MDCToolbarFoundation = function (_MDCFoundation) {
  23302. _inherits(MDCToolbarFoundation, _MDCFoundation);
  23303. _createClass(MDCToolbarFoundation, null, [{
  23304. key: 'cssClasses',
  23305. get: function get() {
  23306. return __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */];
  23307. }
  23308. }, {
  23309. key: 'strings',
  23310. get: function get() {
  23311. return __WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */];
  23312. }
  23313. }, {
  23314. key: 'numbers',
  23315. get: function get() {
  23316. return __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* numbers */];
  23317. }
  23318. }, {
  23319. key: 'defaultAdapter',
  23320. get: function get() {
  23321. return {
  23322. hasClass: function hasClass() {
  23323. return (/* className: string */ /* boolean */false
  23324. );
  23325. },
  23326. addClass: function addClass() /* className: string */{},
  23327. removeClass: function removeClass() /* className: string */{},
  23328. registerScrollHandler: function registerScrollHandler() /* handler: EventListener */{},
  23329. deregisterScrollHandler: function deregisterScrollHandler() /* handler: EventListener */{},
  23330. registerResizeHandler: function registerResizeHandler() /* handler: EventListener */{},
  23331. deregisterResizeHandler: function deregisterResizeHandler() /* handler: EventListener */{},
  23332. getViewportWidth: function getViewportWidth() {
  23333. return (/* number */0
  23334. );
  23335. },
  23336. getViewportScrollY: function getViewportScrollY() {
  23337. return (/* number */0
  23338. );
  23339. },
  23340. getOffsetHeight: function getOffsetHeight() {
  23341. return (/* number */0
  23342. );
  23343. },
  23344. getFirstRowElementOffsetHeight: function getFirstRowElementOffsetHeight() {
  23345. return (/* number */0
  23346. );
  23347. },
  23348. notifyChange: function notifyChange() /* evtData: {flexibleExpansionRatio: number} */{},
  23349. setStyle: function setStyle() /* property: string, value: string */{},
  23350. setStyleForTitleElement: function setStyleForTitleElement() /* property: string, value: string */{},
  23351. setStyleForFlexibleRowElement: function setStyleForFlexibleRowElement() /* property: string, value: string */{},
  23352. setStyleForFixedAdjustElement: function setStyleForFixedAdjustElement() /* property: string, value: string */{}
  23353. };
  23354. }
  23355. }]);
  23356. function MDCToolbarFoundation(adapter) {
  23357. _classCallCheck(this, MDCToolbarFoundation);
  23358. var _this = _possibleConstructorReturn(this, (MDCToolbarFoundation.__proto__ || Object.getPrototypeOf(MDCToolbarFoundation)).call(this, _extends(MDCToolbarFoundation.defaultAdapter, adapter)));
  23359. _this.resizeHandler_ = function () {
  23360. return _this.checkRowHeight_();
  23361. };
  23362. _this.scrollHandler_ = function () {
  23363. return _this.updateToolbarStyles_();
  23364. };
  23365. _this.checkRowHeightFrame_ = 0;
  23366. _this.scrollFrame_ = 0;
  23367. _this.executedLastChange_ = false;
  23368. _this.calculations_ = {
  23369. toolbarRowHeight: 0,
  23370. // Calculated Height ratio. We use ratio to calculate corresponding heights in resize event.
  23371. toolbarRatio: 0, // The ratio of toolbar height to row height
  23372. flexibleExpansionRatio: 0, // The ratio of flexible space height to row height
  23373. maxTranslateYRatio: 0, // The ratio of max toolbar move up distance to row height
  23374. scrollThresholdRatio: 0, // The ratio of max scrollTop that we should listen to to row height
  23375. // Derived Heights based on the above key ratios.
  23376. toolbarHeight: 0,
  23377. flexibleExpansionHeight: 0, // Flexible row minus toolbar height (derived)
  23378. maxTranslateYDistance: 0, // When toolbar only fix last row (derived)
  23379. scrollThreshold: 0
  23380. };
  23381. // Toolbar fixed behavior
  23382. // If toolbar is fixed
  23383. _this.fixed_ = false;
  23384. // If fixed is targeted only at the last row
  23385. _this.fixedLastrow_ = false;
  23386. // Toolbar flexible behavior
  23387. // If the first row is flexible
  23388. _this.hasFlexibleRow_ = false;
  23389. // If use the default behavior
  23390. _this.useFlexDefaultBehavior_ = false;
  23391. return _this;
  23392. }
  23393. _createClass(MDCToolbarFoundation, [{
  23394. key: 'init',
  23395. value: function init() {
  23396. this.fixed_ = this.adapter_.hasClass(MDCToolbarFoundation.cssClasses.FIXED);
  23397. this.fixedLastrow_ = this.adapter_.hasClass(MDCToolbarFoundation.cssClasses.FIXED_LASTROW) & this.fixed_;
  23398. this.hasFlexibleRow_ = this.adapter_.hasClass(MDCToolbarFoundation.cssClasses.TOOLBAR_ROW_FLEXIBLE);
  23399. if (this.hasFlexibleRow_) {
  23400. this.useFlexDefaultBehavior_ = this.adapter_.hasClass(MDCToolbarFoundation.cssClasses.FLEXIBLE_DEFAULT_BEHAVIOR);
  23401. }
  23402. this.initKeyRatio_();
  23403. this.setKeyHeights_();
  23404. this.adapter_.registerResizeHandler(this.resizeHandler_);
  23405. this.adapter_.registerScrollHandler(this.scrollHandler_);
  23406. }
  23407. }, {
  23408. key: 'destroy',
  23409. value: function destroy() {
  23410. this.adapter_.deregisterResizeHandler(this.resizeHandler_);
  23411. this.adapter_.deregisterScrollHandler(this.scrollHandler_);
  23412. }
  23413. }, {
  23414. key: 'updateAdjustElementStyles',
  23415. value: function updateAdjustElementStyles() {
  23416. if (this.fixed_) {
  23417. this.adapter_.setStyleForFixedAdjustElement('margin-top', this.calculations_.toolbarHeight + 'px');
  23418. }
  23419. }
  23420. }, {
  23421. key: 'getFlexibleExpansionRatio_',
  23422. value: function getFlexibleExpansionRatio_(scrollTop) {
  23423. // To prevent division by zero when there is no flexibleExpansionHeight
  23424. var delta = 0.0001;
  23425. return Math.max(0, 1 - scrollTop / (this.calculations_.flexibleExpansionHeight + delta));
  23426. }
  23427. }, {
  23428. key: 'checkRowHeight_',
  23429. value: function checkRowHeight_() {
  23430. var _this2 = this;
  23431. cancelAnimationFrame(this.checkRowHeightFrame_);
  23432. this.checkRowHeightFrame_ = requestAnimationFrame(function () {
  23433. return _this2.setKeyHeights_();
  23434. });
  23435. }
  23436. }, {
  23437. key: 'setKeyHeights_',
  23438. value: function setKeyHeights_() {
  23439. var newToolbarRowHeight = this.getRowHeight_();
  23440. if (newToolbarRowHeight !== this.calculations_.toolbarRowHeight) {
  23441. this.calculations_.toolbarRowHeight = newToolbarRowHeight;
  23442. this.calculations_.toolbarHeight = this.calculations_.toolbarRatio * this.calculations_.toolbarRowHeight;
  23443. this.calculations_.flexibleExpansionHeight = this.calculations_.flexibleExpansionRatio * this.calculations_.toolbarRowHeight;
  23444. this.calculations_.maxTranslateYDistance = this.calculations_.maxTranslateYRatio * this.calculations_.toolbarRowHeight;
  23445. this.calculations_.scrollThreshold = this.calculations_.scrollThresholdRatio * this.calculations_.toolbarRowHeight;
  23446. this.updateAdjustElementStyles();
  23447. this.updateToolbarStyles_();
  23448. }
  23449. }
  23450. }, {
  23451. key: 'updateToolbarStyles_',
  23452. value: function updateToolbarStyles_() {
  23453. var _this3 = this;
  23454. cancelAnimationFrame(this.scrollFrame_);
  23455. this.scrollFrame_ = requestAnimationFrame(function () {
  23456. var scrollTop = _this3.adapter_.getViewportScrollY();
  23457. var hasScrolledOutOfThreshold = _this3.scrolledOutOfThreshold_(scrollTop);
  23458. if (hasScrolledOutOfThreshold && _this3.executedLastChange_) {
  23459. return;
  23460. }
  23461. var flexibleExpansionRatio = _this3.getFlexibleExpansionRatio_(scrollTop);
  23462. _this3.updateToolbarFlexibleState_(flexibleExpansionRatio);
  23463. if (_this3.fixedLastrow_) {
  23464. _this3.updateToolbarFixedState_(scrollTop);
  23465. }
  23466. if (_this3.hasFlexibleRow_) {
  23467. _this3.updateFlexibleRowElementStyles_(flexibleExpansionRatio);
  23468. }
  23469. _this3.executedLastChange_ = hasScrolledOutOfThreshold;
  23470. _this3.adapter_.notifyChange({ flexibleExpansionRatio: flexibleExpansionRatio });
  23471. });
  23472. }
  23473. }, {
  23474. key: 'scrolledOutOfThreshold_',
  23475. value: function scrolledOutOfThreshold_(scrollTop) {
  23476. return scrollTop > this.calculations_.scrollThreshold;
  23477. }
  23478. }, {
  23479. key: 'initKeyRatio_',
  23480. value: function initKeyRatio_() {
  23481. var toolbarRowHeight = this.getRowHeight_();
  23482. var firstRowMaxRatio = this.adapter_.getFirstRowElementOffsetHeight() / toolbarRowHeight;
  23483. this.calculations_.toolbarRatio = this.adapter_.getOffsetHeight() / toolbarRowHeight;
  23484. this.calculations_.flexibleExpansionRatio = firstRowMaxRatio - 1;
  23485. this.calculations_.maxTranslateYRatio = this.fixedLastrow_ ? this.calculations_.toolbarRatio - firstRowMaxRatio : 0;
  23486. this.calculations_.scrollThresholdRatio = (this.fixedLastrow_ ? this.calculations_.toolbarRatio : firstRowMaxRatio) - 1;
  23487. }
  23488. }, {
  23489. key: 'getRowHeight_',
  23490. value: function getRowHeight_() {
  23491. var breakpoint = MDCToolbarFoundation.numbers.TOOLBAR_MOBILE_BREAKPOINT;
  23492. return this.adapter_.getViewportWidth() < breakpoint ? MDCToolbarFoundation.numbers.TOOLBAR_ROW_MOBILE_HEIGHT : MDCToolbarFoundation.numbers.TOOLBAR_ROW_HEIGHT;
  23493. }
  23494. }, {
  23495. key: 'updateToolbarFlexibleState_',
  23496. value: function updateToolbarFlexibleState_(flexibleExpansionRatio) {
  23497. this.adapter_.removeClass(MDCToolbarFoundation.cssClasses.FLEXIBLE_MAX);
  23498. this.adapter_.removeClass(MDCToolbarFoundation.cssClasses.FLEXIBLE_MIN);
  23499. if (flexibleExpansionRatio === 1) {
  23500. this.adapter_.addClass(MDCToolbarFoundation.cssClasses.FLEXIBLE_MAX);
  23501. } else if (flexibleExpansionRatio === 0) {
  23502. this.adapter_.addClass(MDCToolbarFoundation.cssClasses.FLEXIBLE_MIN);
  23503. }
  23504. }
  23505. }, {
  23506. key: 'updateToolbarFixedState_',
  23507. value: function updateToolbarFixedState_(scrollTop) {
  23508. var translateDistance = Math.max(0, Math.min(scrollTop - this.calculations_.flexibleExpansionHeight, this.calculations_.maxTranslateYDistance));
  23509. this.adapter_.setStyle('transform', 'translateY(' + -translateDistance + 'px)');
  23510. if (translateDistance === this.calculations_.maxTranslateYDistance) {
  23511. this.adapter_.addClass(MDCToolbarFoundation.cssClasses.FIXED_AT_LAST_ROW);
  23512. } else {
  23513. this.adapter_.removeClass(MDCToolbarFoundation.cssClasses.FIXED_AT_LAST_ROW);
  23514. }
  23515. }
  23516. }, {
  23517. key: 'updateFlexibleRowElementStyles_',
  23518. value: function updateFlexibleRowElementStyles_(flexibleExpansionRatio) {
  23519. if (this.fixed_) {
  23520. var height = this.calculations_.flexibleExpansionHeight * flexibleExpansionRatio;
  23521. this.adapter_.setStyleForFlexibleRowElement('height', height + this.calculations_.toolbarRowHeight + 'px');
  23522. }
  23523. if (this.useFlexDefaultBehavior_) {
  23524. this.updateElementStylesDefaultBehavior_(flexibleExpansionRatio);
  23525. }
  23526. }
  23527. }, {
  23528. key: 'updateElementStylesDefaultBehavior_',
  23529. value: function updateElementStylesDefaultBehavior_(flexibleExpansionRatio) {
  23530. var maxTitleSize = MDCToolbarFoundation.numbers.MAX_TITLE_SIZE;
  23531. var minTitleSize = MDCToolbarFoundation.numbers.MIN_TITLE_SIZE;
  23532. var currentTitleSize = (maxTitleSize - minTitleSize) * flexibleExpansionRatio + minTitleSize;
  23533. this.adapter_.setStyleForTitleElement('font-size', currentTitleSize + 'rem');
  23534. }
  23535. }]);
  23536. return MDCToolbarFoundation;
  23537. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  23538. /* harmony default export */ __webpack_exports__["a"] = (MDCToolbarFoundation);
  23539. /***/ }),
  23540. /* 160 */
  23541. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  23542. "use strict";
  23543. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  23544. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; });
  23545. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; });
  23546. /**
  23547. * @license
  23548. * Copyright 2017 Google Inc.
  23549. *
  23550. * Permission is hereby granted, free of charge, to any person obtaining a copy
  23551. * of this software and associated documentation files (the "Software"), to deal
  23552. * in the Software without restriction, including without limitation the rights
  23553. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  23554. * copies of the Software, and to permit persons to whom the Software is
  23555. * furnished to do so, subject to the following conditions:
  23556. *
  23557. * The above copyright notice and this permission notice shall be included in
  23558. * all copies or substantial portions of the Software.
  23559. *
  23560. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  23561. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  23562. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  23563. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  23564. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  23565. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  23566. * THE SOFTWARE.
  23567. */
  23568. var cssClasses = {
  23569. FIXED: 'mdc-toolbar--fixed',
  23570. FIXED_LASTROW: 'mdc-toolbar--fixed-lastrow-only',
  23571. FIXED_AT_LAST_ROW: 'mdc-toolbar--fixed-at-last-row',
  23572. TOOLBAR_ROW_FLEXIBLE: 'mdc-toolbar--flexible',
  23573. FLEXIBLE_DEFAULT_BEHAVIOR: 'mdc-toolbar--flexible-default-behavior',
  23574. FLEXIBLE_MAX: 'mdc-toolbar--flexible-space-maximized',
  23575. FLEXIBLE_MIN: 'mdc-toolbar--flexible-space-minimized'
  23576. };
  23577. var strings = {
  23578. TITLE_SELECTOR: '.mdc-toolbar__title',
  23579. ICON_SELECTOR: '.mdc-toolbar__icon',
  23580. FIRST_ROW_SELECTOR: '.mdc-toolbar__row:first-child',
  23581. CHANGE_EVENT: 'MDCToolbar:change'
  23582. };
  23583. var numbers = {
  23584. MAX_TITLE_SIZE: 2.125,
  23585. MIN_TITLE_SIZE: 1.25,
  23586. TOOLBAR_ROW_HEIGHT: 64,
  23587. TOOLBAR_ROW_MOBILE_HEIGHT: 56,
  23588. TOOLBAR_MOBILE_BREAKPOINT: 600
  23589. };
  23590. /***/ }),
  23591. /* 161 */
  23592. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  23593. "use strict";
  23594. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  23595. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTopAppBar", function() { return MDCTopAppBar; });
  23596. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__adapter__ = __webpack_require__(6);
  23597. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_component__ = __webpack_require__(1);
  23598. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_ripple_index__ = __webpack_require__(2);
  23599. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__constants__ = __webpack_require__(7);
  23600. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation__ = __webpack_require__(12);
  23601. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__fixed_foundation__ = __webpack_require__(162);
  23602. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__short_foundation__ = __webpack_require__(163);
  23603. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__standard_foundation__ = __webpack_require__(164);
  23604. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTopAppBarBaseFoundation", function() { return __WEBPACK_IMPORTED_MODULE_4__foundation__["a"]; });
  23605. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTopAppBarFoundation", function() { return __WEBPACK_IMPORTED_MODULE_7__standard_foundation__["a"]; });
  23606. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCFixedTopAppBarFoundation", function() { return __WEBPACK_IMPORTED_MODULE_5__fixed_foundation__["a"]; });
  23607. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCShortTopAppBarFoundation", function() { return __WEBPACK_IMPORTED_MODULE_6__short_foundation__["a"]; });
  23608. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  23609. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  23610. var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
  23611. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  23612. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  23613. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  23614. /**
  23615. * @license
  23616. * Copyright 2018 Google Inc.
  23617. *
  23618. * Permission is hereby granted, free of charge, to any person obtaining a copy
  23619. * of this software and associated documentation files (the "Software"), to deal
  23620. * in the Software without restriction, including without limitation the rights
  23621. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  23622. * copies of the Software, and to permit persons to whom the Software is
  23623. * furnished to do so, subject to the following conditions:
  23624. *
  23625. * The above copyright notice and this permission notice shall be included in
  23626. * all copies or substantial portions of the Software.
  23627. *
  23628. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  23629. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  23630. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  23631. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  23632. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  23633. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  23634. * THE SOFTWARE.
  23635. */
  23636. /**
  23637. * @extends {MDCComponent<!MDCTopAppBarBaseFoundation>}
  23638. * @final
  23639. */
  23640. var MDCTopAppBar = function (_MDCComponent) {
  23641. _inherits(MDCTopAppBar, _MDCComponent);
  23642. /**
  23643. * @param {...?} args
  23644. */
  23645. function MDCTopAppBar() {
  23646. var _ref;
  23647. _classCallCheck(this, MDCTopAppBar);
  23648. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  23649. args[_key] = arguments[_key];
  23650. }
  23651. /** @private {?Element} */
  23652. var _this = _possibleConstructorReturn(this, (_ref = MDCTopAppBar.__proto__ || Object.getPrototypeOf(MDCTopAppBar)).call.apply(_ref, [this].concat(args)));
  23653. _this.navIcon_;
  23654. /** @type {?Array<MDCRipple>} */
  23655. _this.iconRipples_;
  23656. /** @type {Object} */
  23657. _this.scrollTarget_;
  23658. return _this;
  23659. }
  23660. _createClass(MDCTopAppBar, [{
  23661. key: 'initialize',
  23662. value: function initialize() {
  23663. var rippleFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (el) {
  23664. return __WEBPACK_IMPORTED_MODULE_2__material_ripple_index__["MDCRipple"].attachTo(el);
  23665. };
  23666. this.navIcon_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].NAVIGATION_ICON_SELECTOR);
  23667. // Get all icons in the toolbar and instantiate the ripples
  23668. var icons = [].slice.call(this.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].ACTION_ITEM_SELECTOR));
  23669. if (this.navIcon_) {
  23670. icons.push(this.navIcon_);
  23671. }
  23672. this.iconRipples_ = icons.map(function (icon) {
  23673. var ripple = rippleFactory(icon);
  23674. ripple.unbounded = true;
  23675. return ripple;
  23676. });
  23677. this.scrollTarget_ = window;
  23678. }
  23679. }, {
  23680. key: 'destroy',
  23681. value: function destroy() {
  23682. this.iconRipples_.forEach(function (iconRipple) {
  23683. return iconRipple.destroy();
  23684. });
  23685. _get(MDCTopAppBar.prototype.__proto__ || Object.getPrototypeOf(MDCTopAppBar.prototype), 'destroy', this).call(this);
  23686. }
  23687. }, {
  23688. key: 'setScrollTarget',
  23689. value: function setScrollTarget(target) {
  23690. this.foundation_.destroyScrollHandler();
  23691. this.scrollTarget_ = target;
  23692. this.foundation_.initScrollHandler();
  23693. }
  23694. /**
  23695. * @param {!Element} root
  23696. * @return {!MDCTopAppBar}
  23697. */
  23698. }, {
  23699. key: 'getDefaultFoundation',
  23700. /**
  23701. * @return {!MDCTopAppBarBaseFoundation}
  23702. */
  23703. value: function getDefaultFoundation() {
  23704. var _this2 = this;
  23705. /** @type {!MDCTopAppBarAdapter} */
  23706. var adapter = /** @type {!MDCTopAppBarAdapter} */_extends({
  23707. hasClass: function hasClass(className) {
  23708. return _this2.root_.classList.contains(className);
  23709. },
  23710. addClass: function addClass(className) {
  23711. return _this2.root_.classList.add(className);
  23712. },
  23713. removeClass: function removeClass(className) {
  23714. return _this2.root_.classList.remove(className);
  23715. },
  23716. setStyle: function setStyle(property, value) {
  23717. return _this2.root_.style.setProperty(property, value);
  23718. },
  23719. getTopAppBarHeight: function getTopAppBarHeight() {
  23720. return _this2.root_.clientHeight;
  23721. },
  23722. registerNavigationIconInteractionHandler: function registerNavigationIconInteractionHandler(evtType, handler) {
  23723. if (_this2.navIcon_) {
  23724. _this2.navIcon_.addEventListener(evtType, handler);
  23725. }
  23726. },
  23727. deregisterNavigationIconInteractionHandler: function deregisterNavigationIconInteractionHandler(evtType, handler) {
  23728. if (_this2.navIcon_) {
  23729. _this2.navIcon_.removeEventListener(evtType, handler);
  23730. }
  23731. },
  23732. notifyNavigationIconClicked: function notifyNavigationIconClicked() {
  23733. _this2.emit(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].NAVIGATION_EVENT, {});
  23734. },
  23735. registerScrollHandler: function registerScrollHandler(handler) {
  23736. return _this2.scrollTarget_.addEventListener('scroll', handler);
  23737. },
  23738. deregisterScrollHandler: function deregisterScrollHandler(handler) {
  23739. return _this2.scrollTarget_.removeEventListener('scroll', handler);
  23740. },
  23741. registerResizeHandler: function registerResizeHandler(handler) {
  23742. return window.addEventListener('resize', handler);
  23743. },
  23744. deregisterResizeHandler: function deregisterResizeHandler(handler) {
  23745. return window.removeEventListener('resize', handler);
  23746. },
  23747. getViewportScrollY: function getViewportScrollY() {
  23748. return _this2.scrollTarget_[_this2.scrollTarget_ === window ? 'pageYOffset' : 'scrollTop'];
  23749. },
  23750. getTotalActionItems: function getTotalActionItems() {
  23751. return _this2.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].ACTION_ITEM_SELECTOR).length;
  23752. }
  23753. });
  23754. /** @type {!MDCTopAppBarBaseFoundation} */
  23755. var foundation = void 0;
  23756. if (this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].SHORT_CLASS)) {
  23757. foundation = new __WEBPACK_IMPORTED_MODULE_6__short_foundation__["a" /* default */](adapter);
  23758. } else if (this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].FIXED_CLASS)) {
  23759. foundation = new __WEBPACK_IMPORTED_MODULE_5__fixed_foundation__["a" /* default */](adapter);
  23760. } else {
  23761. foundation = new __WEBPACK_IMPORTED_MODULE_7__standard_foundation__["a" /* default */](adapter);
  23762. }
  23763. return foundation;
  23764. }
  23765. }], [{
  23766. key: 'attachTo',
  23767. value: function attachTo(root) {
  23768. return new MDCTopAppBar(root);
  23769. }
  23770. }]);
  23771. return MDCTopAppBar;
  23772. }(__WEBPACK_IMPORTED_MODULE_1__material_base_component__["a" /* default */]);
  23773. /***/ }),
  23774. /* 162 */
  23775. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  23776. "use strict";
  23777. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__constants__ = __webpack_require__(7);
  23778. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(6);
  23779. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(12);
  23780. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  23781. var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
  23782. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  23783. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  23784. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  23785. /**
  23786. * @license
  23787. * Copyright 2018 Google Inc.
  23788. *
  23789. * Permission is hereby granted, free of charge, to any person obtaining a copy
  23790. * of this software and associated documentation files (the "Software"), to deal
  23791. * in the Software without restriction, including without limitation the rights
  23792. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  23793. * copies of the Software, and to permit persons to whom the Software is
  23794. * furnished to do so, subject to the following conditions:
  23795. *
  23796. * The above copyright notice and this permission notice shall be included in
  23797. * all copies or substantial portions of the Software.
  23798. *
  23799. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  23800. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  23801. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  23802. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  23803. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  23804. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  23805. * THE SOFTWARE.
  23806. */
  23807. /**
  23808. * @extends {MDCTopAppBarFoundation<!MDCFixedTopAppBarFoundation>}
  23809. * @final
  23810. */
  23811. var MDCFixedTopAppBarFoundation = function (_MDCTopAppBarFoundati) {
  23812. _inherits(MDCFixedTopAppBarFoundation, _MDCTopAppBarFoundati);
  23813. /**
  23814. * @param {!MDCTopAppBarAdapter} adapter
  23815. */
  23816. function MDCFixedTopAppBarFoundation(adapter) {
  23817. _classCallCheck(this, MDCFixedTopAppBarFoundation);
  23818. /** State variable for the previous scroll iteration top app bar state */
  23819. var _this = _possibleConstructorReturn(this, (MDCFixedTopAppBarFoundation.__proto__ || Object.getPrototypeOf(MDCFixedTopAppBarFoundation)).call(this, adapter));
  23820. _this.wasScrolled_ = false;
  23821. _this.scrollHandler_ = function () {
  23822. return _this.fixedScrollHandler_();
  23823. };
  23824. return _this;
  23825. }
  23826. _createClass(MDCFixedTopAppBarFoundation, [{
  23827. key: 'init',
  23828. value: function init() {
  23829. _get(MDCFixedTopAppBarFoundation.prototype.__proto__ || Object.getPrototypeOf(MDCFixedTopAppBarFoundation.prototype), 'init', this).call(this);
  23830. this.adapter_.registerScrollHandler(this.scrollHandler_);
  23831. }
  23832. }, {
  23833. key: 'destroy',
  23834. value: function destroy() {
  23835. _get(MDCFixedTopAppBarFoundation.prototype.__proto__ || Object.getPrototypeOf(MDCFixedTopAppBarFoundation.prototype), 'destroy', this).call(this);
  23836. this.adapter_.deregisterScrollHandler(this.scrollHandler_);
  23837. }
  23838. /**
  23839. * Scroll handler for applying/removing the modifier class
  23840. * on the fixed top app bar.
  23841. */
  23842. }, {
  23843. key: 'fixedScrollHandler_',
  23844. value: function fixedScrollHandler_() {
  23845. var currentScroll = this.adapter_.getViewportScrollY();
  23846. if (currentScroll <= 0) {
  23847. if (this.wasScrolled_) {
  23848. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].FIXED_SCROLLED_CLASS);
  23849. this.wasScrolled_ = false;
  23850. }
  23851. } else {
  23852. if (!this.wasScrolled_) {
  23853. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].FIXED_SCROLLED_CLASS);
  23854. this.wasScrolled_ = true;
  23855. }
  23856. }
  23857. }
  23858. }]);
  23859. return MDCFixedTopAppBarFoundation;
  23860. }(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]);
  23861. /* harmony default export */ __webpack_exports__["a"] = (MDCFixedTopAppBarFoundation);
  23862. /***/ }),
  23863. /* 163 */
  23864. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  23865. "use strict";
  23866. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__adapter__ = __webpack_require__(6);
  23867. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(12);
  23868. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(7);
  23869. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  23870. var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
  23871. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  23872. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  23873. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  23874. /**
  23875. * @license
  23876. * Copyright 2018 Google Inc.
  23877. *
  23878. * Permission is hereby granted, free of charge, to any person obtaining a copy
  23879. * of this software and associated documentation files (the "Software"), to deal
  23880. * in the Software without restriction, including without limitation the rights
  23881. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  23882. * copies of the Software, and to permit persons to whom the Software is
  23883. * furnished to do so, subject to the following conditions:
  23884. *
  23885. * The above copyright notice and this permission notice shall be included in
  23886. * all copies or substantial portions of the Software.
  23887. *
  23888. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  23889. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  23890. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  23891. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  23892. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  23893. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  23894. * THE SOFTWARE.
  23895. */
  23896. /**
  23897. * @extends {MDCTopAppBarBaseFoundation<!MDCShortTopAppBarFoundation>}
  23898. * @final
  23899. */
  23900. var MDCShortTopAppBarFoundation = function (_MDCTopAppBarBaseFoun) {
  23901. _inherits(MDCShortTopAppBarFoundation, _MDCTopAppBarBaseFoun);
  23902. /**
  23903. * @param {!MDCTopAppBarAdapter} adapter
  23904. */
  23905. function MDCShortTopAppBarFoundation(adapter) {
  23906. _classCallCheck(this, MDCShortTopAppBarFoundation);
  23907. // State variable for the current top app bar state
  23908. var _this = _possibleConstructorReturn(this, (MDCShortTopAppBarFoundation.__proto__ || Object.getPrototypeOf(MDCShortTopAppBarFoundation)).call(this, adapter));
  23909. _this.isCollapsed = false;
  23910. _this.scrollHandler_ = function () {
  23911. return _this.shortAppBarScrollHandler_();
  23912. };
  23913. return _this;
  23914. }
  23915. _createClass(MDCShortTopAppBarFoundation, [{
  23916. key: 'init',
  23917. value: function init() {
  23918. _get(MDCShortTopAppBarFoundation.prototype.__proto__ || Object.getPrototypeOf(MDCShortTopAppBarFoundation.prototype), 'init', this).call(this);
  23919. var isAlwaysCollapsed = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SHORT_COLLAPSED_CLASS);
  23920. if (this.adapter_.getTotalActionItems() > 0) {
  23921. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SHORT_HAS_ACTION_ITEM_CLASS);
  23922. }
  23923. if (!isAlwaysCollapsed) {
  23924. this.adapter_.registerScrollHandler(this.scrollHandler_);
  23925. this.shortAppBarScrollHandler_();
  23926. }
  23927. }
  23928. }, {
  23929. key: 'destroy',
  23930. value: function destroy() {
  23931. _get(MDCShortTopAppBarFoundation.prototype.__proto__ || Object.getPrototypeOf(MDCShortTopAppBarFoundation.prototype), 'destroy', this).call(this);
  23932. this.adapter_.deregisterScrollHandler(this.scrollHandler_);
  23933. }
  23934. /**
  23935. * Scroll handler for applying/removing the collapsed modifier class
  23936. * on the short top app bar.
  23937. * @private
  23938. */
  23939. }, {
  23940. key: 'shortAppBarScrollHandler_',
  23941. value: function shortAppBarScrollHandler_() {
  23942. var currentScroll = this.adapter_.getViewportScrollY();
  23943. if (currentScroll <= 0) {
  23944. if (this.isCollapsed) {
  23945. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SHORT_COLLAPSED_CLASS);
  23946. this.isCollapsed = false;
  23947. }
  23948. } else {
  23949. if (!this.isCollapsed) {
  23950. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SHORT_COLLAPSED_CLASS);
  23951. this.isCollapsed = true;
  23952. }
  23953. }
  23954. }
  23955. }]);
  23956. return MDCShortTopAppBarFoundation;
  23957. }(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]);
  23958. /* harmony default export */ __webpack_exports__["a"] = (MDCShortTopAppBarFoundation);
  23959. /***/ }),
  23960. /* 164 */
  23961. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  23962. "use strict";
  23963. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__adapter__ = __webpack_require__(6);
  23964. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(12);
  23965. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(7);
  23966. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  23967. var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
  23968. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  23969. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  23970. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  23971. /**
  23972. * @license
  23973. * Copyright 2018 Google Inc.
  23974. *
  23975. * Permission is hereby granted, free of charge, to any person obtaining a copy
  23976. * of this software and associated documentation files (the "Software"), to deal
  23977. * in the Software without restriction, including without limitation the rights
  23978. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  23979. * copies of the Software, and to permit persons to whom the Software is
  23980. * furnished to do so, subject to the following conditions:
  23981. *
  23982. * The above copyright notice and this permission notice shall be included in
  23983. * all copies or substantial portions of the Software.
  23984. *
  23985. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  23986. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  23987. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  23988. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  23989. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  23990. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  23991. * THE SOFTWARE.
  23992. */
  23993. var INITIAL_VALUE = 0;
  23994. /**
  23995. * @extends {MDCTopAppBarBaseFoundation<!MDCTopAppBarFoundation>}
  23996. * @final
  23997. */
  23998. var MDCTopAppBarFoundation = function (_MDCTopAppBarBaseFoun) {
  23999. _inherits(MDCTopAppBarFoundation, _MDCTopAppBarBaseFoun);
  24000. /**
  24001. * @param {!MDCTopAppBarAdapter} adapter
  24002. */
  24003. function MDCTopAppBarFoundation(adapter) {
  24004. _classCallCheck(this, MDCTopAppBarFoundation);
  24005. /**
  24006. * Used for diffs of current scroll position vs previous scroll position
  24007. * @private {number}
  24008. */
  24009. var _this = _possibleConstructorReturn(this, (MDCTopAppBarFoundation.__proto__ || Object.getPrototypeOf(MDCTopAppBarFoundation)).call(this, adapter));
  24010. _this.lastScrollPosition_ = _this.adapter_.getViewportScrollY();
  24011. /**
  24012. * Used to verify when the top app bar is completely showing or completely hidden
  24013. * @private {number}
  24014. */
  24015. _this.topAppBarHeight_ = _this.adapter_.getTopAppBarHeight();
  24016. /**
  24017. * wasDocked_ is used to indicate if the top app bar was docked in the previous
  24018. * scroll handler iteration.
  24019. * @private {boolean}
  24020. */
  24021. _this.wasDocked_ = true;
  24022. /**
  24023. * isDockedShowing_ is used to indicate if the top app bar is docked in the fully
  24024. * shown position.
  24025. * @private {boolean}
  24026. */
  24027. _this.isDockedShowing_ = true;
  24028. /**
  24029. * Variable for current scroll position of the top app bar
  24030. * @private {number}
  24031. */
  24032. _this.currentAppBarOffsetTop_ = 0;
  24033. /**
  24034. * Used to prevent the top app bar from being scrolled out of view during resize events
  24035. * @private {boolean} */
  24036. _this.isCurrentlyBeingResized_ = false;
  24037. /**
  24038. * The timeout that's used to throttle the resize events
  24039. * @private {number}
  24040. */
  24041. _this.resizeThrottleId_ = INITIAL_VALUE;
  24042. /**
  24043. * The timeout that's used to debounce toggling the isCurrentlyBeingResized_ variable after a resize
  24044. * @private {number}
  24045. */
  24046. _this.resizeDebounceId_ = INITIAL_VALUE;
  24047. _this.scrollHandler_ = function () {
  24048. return _this.topAppBarScrollHandler_();
  24049. };
  24050. _this.resizeHandler_ = function () {
  24051. return _this.topAppBarResizeHandler_();
  24052. };
  24053. return _this;
  24054. }
  24055. _createClass(MDCTopAppBarFoundation, [{
  24056. key: 'init',
  24057. value: function init() {
  24058. _get(MDCTopAppBarFoundation.prototype.__proto__ || Object.getPrototypeOf(MDCTopAppBarFoundation.prototype), 'init', this).call(this);
  24059. this.adapter_.registerScrollHandler(this.scrollHandler_);
  24060. this.adapter_.registerResizeHandler(this.resizeHandler_);
  24061. }
  24062. }, {
  24063. key: 'destroy',
  24064. value: function destroy() {
  24065. _get(MDCTopAppBarFoundation.prototype.__proto__ || Object.getPrototypeOf(MDCTopAppBarFoundation.prototype), 'destroy', this).call(this);
  24066. this.adapter_.deregisterScrollHandler(this.scrollHandler_);
  24067. this.adapter_.deregisterResizeHandler(this.resizeHandler_);
  24068. this.adapter_.setStyle('top', '');
  24069. }
  24070. /**
  24071. * Function to determine if the DOM needs to update.
  24072. * @return {boolean}
  24073. * @private
  24074. */
  24075. }, {
  24076. key: 'checkForUpdate_',
  24077. value: function checkForUpdate_() {
  24078. var offscreenBoundaryTop = -this.topAppBarHeight_;
  24079. var hasAnyPixelsOffscreen = this.currentAppBarOffsetTop_ < 0;
  24080. var hasAnyPixelsOnscreen = this.currentAppBarOffsetTop_ > offscreenBoundaryTop;
  24081. var partiallyShowing = hasAnyPixelsOffscreen && hasAnyPixelsOnscreen;
  24082. // If it's partially showing, it can't be docked.
  24083. if (partiallyShowing) {
  24084. this.wasDocked_ = false;
  24085. } else {
  24086. // Not previously docked and not partially showing, it's now docked.
  24087. if (!this.wasDocked_) {
  24088. this.wasDocked_ = true;
  24089. return true;
  24090. } else if (this.isDockedShowing_ !== hasAnyPixelsOnscreen) {
  24091. this.isDockedShowing_ = hasAnyPixelsOnscreen;
  24092. return true;
  24093. }
  24094. }
  24095. return partiallyShowing;
  24096. }
  24097. /**
  24098. * Function to move the top app bar if needed.
  24099. * @private
  24100. */
  24101. }, {
  24102. key: 'moveTopAppBar_',
  24103. value: function moveTopAppBar_() {
  24104. if (this.checkForUpdate_()) {
  24105. // Once the top app bar is fully hidden we use the max potential top app bar height as our offset
  24106. // so the top app bar doesn't show if the window resizes and the new height > the old height.
  24107. var offset = this.currentAppBarOffsetTop_;
  24108. if (Math.abs(offset) >= this.topAppBarHeight_) {
  24109. offset = -__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].MAX_TOP_APP_BAR_HEIGHT;
  24110. }
  24111. this.adapter_.setStyle('top', offset + 'px');
  24112. }
  24113. }
  24114. /**
  24115. * Scroll handler for the default scroll behavior of the top app bar.
  24116. * @private
  24117. */
  24118. }, {
  24119. key: 'topAppBarScrollHandler_',
  24120. value: function topAppBarScrollHandler_() {
  24121. var currentScrollPosition = Math.max(this.adapter_.getViewportScrollY(), 0);
  24122. var diff = currentScrollPosition - this.lastScrollPosition_;
  24123. this.lastScrollPosition_ = currentScrollPosition;
  24124. // If the window is being resized the lastScrollPosition_ needs to be updated but the
  24125. // current scroll of the top app bar should stay in the same position.
  24126. if (!this.isCurrentlyBeingResized_) {
  24127. this.currentAppBarOffsetTop_ -= diff;
  24128. if (this.currentAppBarOffsetTop_ > 0) {
  24129. this.currentAppBarOffsetTop_ = 0;
  24130. } else if (Math.abs(this.currentAppBarOffsetTop_) > this.topAppBarHeight_) {
  24131. this.currentAppBarOffsetTop_ = -this.topAppBarHeight_;
  24132. }
  24133. this.moveTopAppBar_();
  24134. }
  24135. }
  24136. /**
  24137. * Top app bar resize handler that throttle/debounce functions that execute updates.
  24138. * @private
  24139. */
  24140. }, {
  24141. key: 'topAppBarResizeHandler_',
  24142. value: function topAppBarResizeHandler_() {
  24143. var _this2 = this;
  24144. // Throttle resize events 10 p/s
  24145. if (!this.resizeThrottleId_) {
  24146. this.resizeThrottleId_ = setTimeout(function () {
  24147. _this2.resizeThrottleId_ = INITIAL_VALUE;
  24148. _this2.throttledResizeHandler_();
  24149. }, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].DEBOUNCE_THROTTLE_RESIZE_TIME_MS);
  24150. }
  24151. this.isCurrentlyBeingResized_ = true;
  24152. if (this.resizeDebounceId_) {
  24153. clearTimeout(this.resizeDebounceId_);
  24154. }
  24155. this.resizeDebounceId_ = setTimeout(function () {
  24156. _this2.topAppBarScrollHandler_();
  24157. _this2.isCurrentlyBeingResized_ = false;
  24158. _this2.resizeDebounceId_ = INITIAL_VALUE;
  24159. }, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].DEBOUNCE_THROTTLE_RESIZE_TIME_MS);
  24160. }
  24161. /**
  24162. * Throttled function that updates the top app bar scrolled values if the
  24163. * top app bar height changes.
  24164. * @private
  24165. */
  24166. }, {
  24167. key: 'throttledResizeHandler_',
  24168. value: function throttledResizeHandler_() {
  24169. var currentHeight = this.adapter_.getTopAppBarHeight();
  24170. if (this.topAppBarHeight_ !== currentHeight) {
  24171. this.wasDocked_ = false;
  24172. // Since the top app bar has a different height depending on the screen width, this
  24173. // will ensure that the top app bar remains in the correct location if
  24174. // completely hidden and a resize makes the top app bar a different height.
  24175. this.currentAppBarOffsetTop_ -= this.topAppBarHeight_ - currentHeight;
  24176. this.topAppBarHeight_ = currentHeight;
  24177. }
  24178. this.topAppBarScrollHandler_();
  24179. }
  24180. }]);
  24181. return MDCTopAppBarFoundation;
  24182. }(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]);
  24183. /* harmony default export */ __webpack_exports__["a"] = (MDCTopAppBarFoundation);
  24184. /***/ })
  24185. /******/ ]);
  24186. });
  24187. //# sourceMappingURL=material-components-web.js.map