material-components-web.js 1.0 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038
  1. /*!
  2. Material Components for the Web
  3. Copyright (c) 2018 Google Inc.
  4. License: MIT
  5. */
  6. (function webpackUniversalModuleDefinition(root, factory) {
  7. if(typeof exports === 'object' && typeof module === 'object')
  8. module.exports = factory();
  9. else if(typeof define === 'function' && define.amd)
  10. define([], factory);
  11. else if(typeof exports === 'object')
  12. exports["mdc"] = factory();
  13. else
  14. root["mdc"] = factory();
  15. })(this, function() {
  16. return /******/ (function(modules) { // webpackBootstrap
  17. /******/ // The module cache
  18. /******/ var installedModules = {};
  19. /******/
  20. /******/ // The require function
  21. /******/ function __webpack_require__(moduleId) {
  22. /******/
  23. /******/ // Check if module is in cache
  24. /******/ if(installedModules[moduleId]) {
  25. /******/ return installedModules[moduleId].exports;
  26. /******/ }
  27. /******/ // Create a new module (and put it into the cache)
  28. /******/ var module = installedModules[moduleId] = {
  29. /******/ i: moduleId,
  30. /******/ l: false,
  31. /******/ exports: {}
  32. /******/ };
  33. /******/
  34. /******/ // Execute the module function
  35. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  36. /******/
  37. /******/ // Flag the module as loaded
  38. /******/ module.l = true;
  39. /******/
  40. /******/ // Return the exports of the module
  41. /******/ return module.exports;
  42. /******/ }
  43. /******/
  44. /******/
  45. /******/ // expose the modules object (__webpack_modules__)
  46. /******/ __webpack_require__.m = modules;
  47. /******/
  48. /******/ // expose the module cache
  49. /******/ __webpack_require__.c = installedModules;
  50. /******/
  51. /******/ // define getter function for harmony exports
  52. /******/ __webpack_require__.d = function(exports, name, getter) {
  53. /******/ if(!__webpack_require__.o(exports, name)) {
  54. /******/ Object.defineProperty(exports, name, {
  55. /******/ configurable: false,
  56. /******/ enumerable: true,
  57. /******/ get: getter
  58. /******/ });
  59. /******/ }
  60. /******/ };
  61. /******/
  62. /******/ // getDefaultExport function for compatibility with non-harmony modules
  63. /******/ __webpack_require__.n = function(module) {
  64. /******/ var getter = module && module.__esModule ?
  65. /******/ function getDefault() { return module['default']; } :
  66. /******/ function getModuleExports() { return module; };
  67. /******/ __webpack_require__.d(getter, 'a', getter);
  68. /******/ return getter;
  69. /******/ };
  70. /******/
  71. /******/ // Object.prototype.hasOwnProperty.call
  72. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  73. /******/
  74. /******/ // __webpack_public_path__
  75. /******/ __webpack_require__.p = "";
  76. /******/
  77. /******/ // Load entry module and return exports
  78. /******/ return __webpack_require__(__webpack_require__.s = 63);
  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__(29);
  327. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(66);
  328. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util__ = __webpack_require__(6);
  329. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCRippleFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  330. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "util", function() { return __WEBPACK_IMPORTED_MODULE_3__util__; });
  331. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  332. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  333. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  334. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  335. /**
  336. * @license
  337. * Copyright 2016 Google Inc.
  338. *
  339. * Permission is hereby granted, free of charge, to any person obtaining a copy
  340. * of this software and associated documentation files (the "Software"), to deal
  341. * in the Software without restriction, including without limitation the rights
  342. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  343. * copies of the Software, and to permit persons to whom the Software is
  344. * furnished to do so, subject to the following conditions:
  345. *
  346. * The above copyright notice and this permission notice shall be included in
  347. * all copies or substantial portions of the Software.
  348. *
  349. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  350. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  351. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  352. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  353. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  354. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  355. * THE SOFTWARE.
  356. */
  357. /**
  358. * @extends MDCComponent<!MDCRippleFoundation>
  359. */
  360. var MDCRipple = function (_MDCComponent) {
  361. _inherits(MDCRipple, _MDCComponent);
  362. /** @param {...?} args */
  363. function MDCRipple() {
  364. var _ref;
  365. _classCallCheck(this, MDCRipple);
  366. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  367. args[_key] = arguments[_key];
  368. }
  369. /** @type {boolean} */
  370. var _this = _possibleConstructorReturn(this, (_ref = MDCRipple.__proto__ || Object.getPrototypeOf(MDCRipple)).call.apply(_ref, [this].concat(args)));
  371. _this.disabled = false;
  372. /** @private {boolean} */
  373. _this.unbounded_;
  374. return _this;
  375. }
  376. /**
  377. * @param {!Element} root
  378. * @param {{isUnbounded: (boolean|undefined)}=} options
  379. * @return {!MDCRipple}
  380. */
  381. _createClass(MDCRipple, [{
  382. key: 'setUnbounded_',
  383. /**
  384. * Closure Compiler throws an access control error when directly accessing a
  385. * protected or private property inside a getter/setter, like unbounded above.
  386. * By accessing the protected property inside a method, we solve that problem.
  387. * That's why this function exists.
  388. * @private
  389. */
  390. value: function setUnbounded_() {
  391. this.foundation_.setUnbounded(this.unbounded_);
  392. }
  393. }, {
  394. key: 'activate',
  395. value: function activate() {
  396. this.foundation_.activate();
  397. }
  398. }, {
  399. key: 'deactivate',
  400. value: function deactivate() {
  401. this.foundation_.deactivate();
  402. }
  403. }, {
  404. key: 'layout',
  405. value: function layout() {
  406. this.foundation_.layout();
  407. }
  408. /**
  409. * @return {!MDCRippleFoundation}
  410. * @override
  411. */
  412. }, {
  413. key: 'getDefaultFoundation',
  414. value: function getDefaultFoundation() {
  415. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */](MDCRipple.createAdapter(this));
  416. }
  417. /** @override */
  418. }, {
  419. key: 'initialSyncWithDOM',
  420. value: function initialSyncWithDOM() {
  421. this.unbounded = 'mdcRippleIsUnbounded' in this.root_.dataset;
  422. }
  423. }, {
  424. key: 'unbounded',
  425. /** @return {boolean} */
  426. get: function get() {
  427. return this.unbounded_;
  428. }
  429. /** @param {boolean} unbounded */
  430. ,
  431. set: function set(unbounded) {
  432. this.unbounded_ = Boolean(unbounded);
  433. this.setUnbounded_();
  434. }
  435. }], [{
  436. key: 'attachTo',
  437. value: function attachTo(root) {
  438. var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  439. _ref2$isUnbounded = _ref2.isUnbounded,
  440. isUnbounded = _ref2$isUnbounded === undefined ? undefined : _ref2$isUnbounded;
  441. var ripple = new MDCRipple(root);
  442. // Only override unbounded behavior if option is explicitly specified
  443. if (isUnbounded !== undefined) {
  444. ripple.unbounded = /** @type {boolean} */isUnbounded;
  445. }
  446. return ripple;
  447. }
  448. /**
  449. * @param {!RippleCapableSurface} instance
  450. * @return {!MDCRippleAdapter}
  451. */
  452. }, {
  453. key: 'createAdapter',
  454. value: function createAdapter(instance) {
  455. var MATCHES = __WEBPACK_IMPORTED_MODULE_3__util__["getMatchesProperty"](HTMLElement.prototype);
  456. return {
  457. browserSupportsCssVars: function browserSupportsCssVars() {
  458. return __WEBPACK_IMPORTED_MODULE_3__util__["supportsCssVariables"](window);
  459. },
  460. isUnbounded: function isUnbounded() {
  461. return instance.unbounded;
  462. },
  463. isSurfaceActive: function isSurfaceActive() {
  464. return instance.root_[MATCHES](':active');
  465. },
  466. isSurfaceDisabled: function isSurfaceDisabled() {
  467. return instance.disabled;
  468. },
  469. addClass: function addClass(className) {
  470. return instance.root_.classList.add(className);
  471. },
  472. removeClass: function removeClass(className) {
  473. return instance.root_.classList.remove(className);
  474. },
  475. containsEventTarget: function containsEventTarget(target) {
  476. return instance.root_.contains(target);
  477. },
  478. registerInteractionHandler: function registerInteractionHandler(evtType, handler) {
  479. return instance.root_.addEventListener(evtType, handler, __WEBPACK_IMPORTED_MODULE_3__util__["applyPassive"]());
  480. },
  481. deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) {
  482. return instance.root_.removeEventListener(evtType, handler, __WEBPACK_IMPORTED_MODULE_3__util__["applyPassive"]());
  483. },
  484. registerDocumentInteractionHandler: function registerDocumentInteractionHandler(evtType, handler) {
  485. return document.documentElement.addEventListener(evtType, handler, __WEBPACK_IMPORTED_MODULE_3__util__["applyPassive"]());
  486. },
  487. deregisterDocumentInteractionHandler: function deregisterDocumentInteractionHandler(evtType, handler) {
  488. return document.documentElement.removeEventListener(evtType, handler, __WEBPACK_IMPORTED_MODULE_3__util__["applyPassive"]());
  489. },
  490. registerResizeHandler: function registerResizeHandler(handler) {
  491. return window.addEventListener('resize', handler);
  492. },
  493. deregisterResizeHandler: function deregisterResizeHandler(handler) {
  494. return window.removeEventListener('resize', handler);
  495. },
  496. updateCssVariable: function updateCssVariable(varName, value) {
  497. return instance.root_.style.setProperty(varName, value);
  498. },
  499. computeBoundingRect: function computeBoundingRect() {
  500. return instance.root_.getBoundingClientRect();
  501. },
  502. getWindowPageOffset: function getWindowPageOffset() {
  503. return { x: window.pageXOffset, y: window.pageYOffset };
  504. }
  505. };
  506. }
  507. }]);
  508. return MDCRipple;
  509. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  510. /**
  511. * See Material Design spec for more details on when to use ripples.
  512. * https://material.io/guidelines/motion/choreography.html#choreography-creation
  513. * @record
  514. */
  515. var RippleCapableSurface = function RippleCapableSurface() {
  516. _classCallCheck(this, RippleCapableSurface);
  517. };
  518. /** @protected {!Element} */
  519. RippleCapableSurface.prototype.root_;
  520. /**
  521. * Whether or not the ripple bleeds out of the bounds of the element.
  522. * @type {boolean|undefined}
  523. */
  524. RippleCapableSurface.prototype.unbounded;
  525. /**
  526. * Whether or not the ripple is attached to a disabled component.
  527. * @type {boolean|undefined}
  528. */
  529. RippleCapableSurface.prototype.disabled;
  530. /***/ }),
  531. /* 3 */
  532. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  533. "use strict";
  534. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  535. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation__ = __webpack_require__(0);
  536. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__component__ = __webpack_require__(1);
  537. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCFoundation", function() { return __WEBPACK_IMPORTED_MODULE_0__foundation__["a"]; });
  538. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCComponent", function() { return __WEBPACK_IMPORTED_MODULE_1__component__["a"]; });
  539. /**
  540. * @license
  541. * Copyright 2016 Google Inc.
  542. *
  543. * Permission is hereby granted, free of charge, to any person obtaining a copy
  544. * of this software and associated documentation files (the "Software"), to deal
  545. * in the Software without restriction, including without limitation the rights
  546. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  547. * copies of the Software, and to permit persons to whom the Software is
  548. * furnished to do so, subject to the following conditions:
  549. *
  550. * The above copyright notice and this permission notice shall be included in
  551. * all copies or substantial portions of the Software.
  552. *
  553. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  554. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  555. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  556. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  557. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  558. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  559. * THE SOFTWARE.
  560. */
  561. /***/ }),
  562. /* 4 */
  563. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  564. "use strict";
  565. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  566. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSelectionControlState", function() { return MDCSelectionControlState; });
  567. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSelectionControl", function() { return MDCSelectionControl; });
  568. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_ripple_index__ = __webpack_require__(2);
  569. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  570. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  571. /**
  572. * @license
  573. * Copyright 2017 Google Inc.
  574. *
  575. * Permission is hereby granted, free of charge, to any person obtaining a copy
  576. * of this software and associated documentation files (the "Software"), to deal
  577. * in the Software without restriction, including without limitation the rights
  578. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  579. * copies of the Software, and to permit persons to whom the Software is
  580. * furnished to do so, subject to the following conditions:
  581. *
  582. * The above copyright notice and this permission notice shall be included in
  583. * all copies or substantial portions of the Software.
  584. *
  585. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  586. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  587. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  588. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  589. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  590. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  591. * THE SOFTWARE.
  592. */
  593. /* eslint-disable no-unused-vars */
  594. /* eslint-enable no-unused-vars */
  595. /**
  596. * @typedef {{
  597. * checked: boolean,
  598. * indeterminate: boolean,
  599. * disabled: boolean,
  600. * value: ?string
  601. * }}
  602. */
  603. var MDCSelectionControlState = void 0;
  604. /**
  605. * @record
  606. */
  607. var MDCSelectionControl = function () {
  608. function MDCSelectionControl() {
  609. _classCallCheck(this, MDCSelectionControl);
  610. }
  611. _createClass(MDCSelectionControl, [{
  612. key: 'ripple',
  613. /** @return {?MDCRipple} */
  614. get: function get() {}
  615. }]);
  616. return MDCSelectionControl;
  617. }();
  618. /***/ }),
  619. /* 5 */
  620. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  621. "use strict";
  622. /* unused harmony export MDCTabScrollerAnimation */
  623. /* unused harmony export MDCTabScrollerHorizontalEdges */
  624. /* unused harmony export MDCTabScrollerAdapter */
  625. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  626. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  627. /**
  628. * @license
  629. * Copyright 2018 Google Inc.
  630. *
  631. * Permission is hereby granted, free of charge, to any person obtaining a copy
  632. * of this software and associated documentation files (the "Software"), to deal
  633. * in the Software without restriction, including without limitation the rights
  634. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  635. * copies of the Software, and to permit persons to whom the Software is
  636. * furnished to do so, subject to the following conditions:
  637. *
  638. * The above copyright notice and this permission notice shall be included in
  639. * all copies or substantial portions of the Software.
  640. *
  641. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  642. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  643. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  644. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  645. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  646. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  647. * THE SOFTWARE.
  648. */
  649. /* eslint no-unused-vars: [2, {"args": "none"}] */
  650. /**
  651. * MDCTabScrollerAnimation contains the values required for animating from the
  652. * current scroll position to the new scroll position. The "finalScrollPosition"
  653. * value represents the new scroll position while the "scrollDelta" value is the
  654. * corresponding transformation that is applied to the scroll content. Together,
  655. * they create the animation by first updating the scroll value then applying
  656. * the transformation and animating the transition. Both pieces are necessary
  657. * for the scroll animation to work. The values are used as-is by the tab
  658. * scroller animation method, ensuring that all logic for determining scroll
  659. * position or transformation is abstracted away from the animation method.
  660. * @typedef {{finalScrollPosition: number, scrollDelta: number}}
  661. */
  662. var MDCTabScrollerAnimation = void 0;
  663. /**
  664. * MDCTabScrollerHorizontalEdges represents the left and right edges of the
  665. * scroll content. These values vary depending on how scrolling in RTL is
  666. * implemented by the browser. One value is always 0 and one value is always
  667. * the max scrollable value as either a positive or negative integer.
  668. * @typedef {{left: number, right: number}}
  669. */
  670. var MDCTabScrollerHorizontalEdges = void 0;
  671. /**
  672. * Adapter for MDC Tab Scroller.
  673. *
  674. * Defines the shape of the adapter expected by the foundation. Implement this
  675. * adapter to integrate the Tab into your framework. See
  676. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  677. * for more information.
  678. *
  679. * @record
  680. */
  681. var MDCTabScrollerAdapter = function () {
  682. function MDCTabScrollerAdapter() {
  683. _classCallCheck(this, MDCTabScrollerAdapter);
  684. }
  685. _createClass(MDCTabScrollerAdapter, [{
  686. key: "addClass",
  687. /**
  688. * Adds the given className to the root element.
  689. * @param {string} className The className to add
  690. */
  691. value: function addClass(className) {}
  692. /**
  693. * Removes the given className from the root element.
  694. * @param {string} className The className to remove
  695. */
  696. }, {
  697. key: "removeClass",
  698. value: function removeClass(className) {}
  699. /**
  700. * Adds the given className to the scroll area element.
  701. * @param {string} className The className to add
  702. */
  703. }, {
  704. key: "addScrollAreaClass",
  705. value: function addScrollAreaClass(className) {}
  706. /**
  707. * Returns whether the event target matches given className.
  708. * @param {EventTarget} evtTarget The event target
  709. * @param {string} selector The selector to check
  710. * @return {boolean}
  711. */
  712. }, {
  713. key: "eventTargetMatchesSelector",
  714. value: function eventTargetMatchesSelector(evtTarget, selector) {}
  715. /**
  716. * Sets a style property of the area element to the passed value.
  717. * @param {string} propName The style property name to set
  718. * @param {string} value The style property value
  719. */
  720. }, {
  721. key: "setScrollAreaStyleProperty",
  722. value: function setScrollAreaStyleProperty(propName, value) {}
  723. /**
  724. * Sets a style property of the content element to the passed value.
  725. * @param {string} propName The style property name to set
  726. * @param {string} value The style property value
  727. */
  728. }, {
  729. key: "setScrollContentStyleProperty",
  730. value: function setScrollContentStyleProperty(propName, value) {}
  731. /**
  732. * Returns the scroll content element's computed style value of the given css property `propertyName`.
  733. * We achieve this via `getComputedStyle(...).getPropertyValue(propertyName)`.
  734. * @param {string} propertyName
  735. * @return {string}
  736. */
  737. }, {
  738. key: "getScrollContentStyleValue",
  739. value: function getScrollContentStyleValue(propertyName) {}
  740. /**
  741. * Sets the scrollLeft value of the scroll area element to the passed value.
  742. * @param {number} scrollLeft The new scrollLeft value
  743. */
  744. }, {
  745. key: "setScrollAreaScrollLeft",
  746. value: function setScrollAreaScrollLeft(scrollLeft) {}
  747. /**
  748. * Returns the scrollLeft value of the scroll area element.
  749. * @return {number}
  750. */
  751. }, {
  752. key: "getScrollAreaScrollLeft",
  753. value: function getScrollAreaScrollLeft() {}
  754. /**
  755. * Returns the offsetWidth of the scroll content element.
  756. * @return {number}
  757. */
  758. }, {
  759. key: "getScrollContentOffsetWidth",
  760. value: function getScrollContentOffsetWidth() {}
  761. /**
  762. * Returns the offsetWitdth of the scroll area element.
  763. * @return {number}
  764. */
  765. }, {
  766. key: "getScrollAreaOffsetWidth",
  767. value: function getScrollAreaOffsetWidth() {}
  768. /**
  769. * Returns the bounding client rect of the scroll area element.
  770. * @return {!ClientRect}
  771. */
  772. }, {
  773. key: "computeScrollAreaClientRect",
  774. value: function computeScrollAreaClientRect() {}
  775. /**
  776. * Returns the bounding client rect of the scroll content element.
  777. * @return {!ClientRect}
  778. */
  779. }, {
  780. key: "computeScrollContentClientRect",
  781. value: function computeScrollContentClientRect() {}
  782. /**
  783. * Returns the height of the browser's horizontal scrollbars (in px).
  784. * @return {number}
  785. */
  786. }, {
  787. key: "computeHorizontalScrollbarHeight",
  788. value: function computeHorizontalScrollbarHeight() {}
  789. }]);
  790. return MDCTabScrollerAdapter;
  791. }();
  792. /***/ }),
  793. /* 6 */
  794. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  795. "use strict";
  796. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  797. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "supportsCssVariables", function() { return supportsCssVariables; });
  798. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "applyPassive", function() { return applyPassive; });
  799. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getMatchesProperty", function() { return getMatchesProperty; });
  800. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNormalizedEventCoords", function() { return getNormalizedEventCoords; });
  801. /**
  802. * @license
  803. * Copyright 2016 Google Inc.
  804. *
  805. * Permission is hereby granted, free of charge, to any person obtaining a copy
  806. * of this software and associated documentation files (the "Software"), to deal
  807. * in the Software without restriction, including without limitation the rights
  808. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  809. * copies of the Software, and to permit persons to whom the Software is
  810. * furnished to do so, subject to the following conditions:
  811. *
  812. * The above copyright notice and this permission notice shall be included in
  813. * all copies or substantial portions of the Software.
  814. *
  815. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  816. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  817. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  818. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  819. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  820. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  821. * THE SOFTWARE.
  822. */
  823. /**
  824. * Stores result from supportsCssVariables to avoid redundant processing to detect CSS custom variable support.
  825. * @private {boolean|undefined}
  826. */
  827. var supportsCssVariables_ = void 0;
  828. /**
  829. * Stores result from applyPassive to avoid redundant processing to detect passive event listener support.
  830. * @private {boolean|undefined}
  831. */
  832. var supportsPassive_ = void 0;
  833. /**
  834. * @param {!Window} windowObj
  835. * @return {boolean}
  836. */
  837. function detectEdgePseudoVarBug(windowObj) {
  838. // Detect versions of Edge with buggy var() support
  839. // See: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/11495448/
  840. var document = windowObj.document;
  841. var node = document.createElement('div');
  842. node.className = 'mdc-ripple-surface--test-edge-var-bug';
  843. document.body.appendChild(node);
  844. // The bug exists if ::before style ends up propagating to the parent element.
  845. // Additionally, getComputedStyle returns null in iframes with display: "none" in Firefox,
  846. // but Firefox is known to support CSS custom properties correctly.
  847. // See: https://bugzilla.mozilla.org/show_bug.cgi?id=548397
  848. var computedStyle = windowObj.getComputedStyle(node);
  849. var hasPseudoVarBug = computedStyle !== null && computedStyle.borderTopStyle === 'solid';
  850. node.remove();
  851. return hasPseudoVarBug;
  852. }
  853. /**
  854. * @param {!Window} windowObj
  855. * @param {boolean=} forceRefresh
  856. * @return {boolean|undefined}
  857. */
  858. function supportsCssVariables(windowObj) {
  859. var forceRefresh = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  860. var supportsCssVariables = supportsCssVariables_;
  861. if (typeof supportsCssVariables_ === 'boolean' && !forceRefresh) {
  862. return supportsCssVariables;
  863. }
  864. var supportsFunctionPresent = windowObj.CSS && typeof windowObj.CSS.supports === 'function';
  865. if (!supportsFunctionPresent) {
  866. return;
  867. }
  868. var explicitlySupportsCssVars = windowObj.CSS.supports('--css-vars', 'yes');
  869. // See: https://bugs.webkit.org/show_bug.cgi?id=154669
  870. // See: README section on Safari
  871. var weAreFeatureDetectingSafari10plus = windowObj.CSS.supports('(--css-vars: yes)') && windowObj.CSS.supports('color', '#00000000');
  872. if (explicitlySupportsCssVars || weAreFeatureDetectingSafari10plus) {
  873. supportsCssVariables = !detectEdgePseudoVarBug(windowObj);
  874. } else {
  875. supportsCssVariables = false;
  876. }
  877. if (!forceRefresh) {
  878. supportsCssVariables_ = supportsCssVariables;
  879. }
  880. return supportsCssVariables;
  881. }
  882. //
  883. /**
  884. * Determine whether the current browser supports passive event listeners, and if so, use them.
  885. * @param {!Window=} globalObj
  886. * @param {boolean=} forceRefresh
  887. * @return {boolean|!EventListenerOptions}
  888. */
  889. function applyPassive() {
  890. var globalObj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window;
  891. var forceRefresh = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  892. if (supportsPassive_ === undefined || forceRefresh) {
  893. var isSupported = false;
  894. try {
  895. globalObj.document.addEventListener('test', null, { get passive() {
  896. isSupported = true;
  897. return isSupported;
  898. } });
  899. } catch (e) {}
  900. supportsPassive_ = isSupported;
  901. }
  902. return supportsPassive_ ? /** @type {!EventListenerOptions} */{ passive: true } : false;
  903. }
  904. /**
  905. * @param {!Object} HTMLElementPrototype
  906. * @return {string}
  907. */
  908. function getMatchesProperty(HTMLElementPrototype) {
  909. /**
  910. * Order is important because we return the first existing method we find.
  911. * Do not change the order of the items in the below array.
  912. */
  913. var matchesMethods = ['matches', 'webkitMatchesSelector', 'msMatchesSelector'];
  914. var method = 'matches';
  915. for (var i = 0; i < matchesMethods.length; i++) {
  916. var matchesMethod = matchesMethods[i];
  917. if (matchesMethod in HTMLElementPrototype) {
  918. method = matchesMethod;
  919. break;
  920. }
  921. }
  922. return method;
  923. }
  924. /**
  925. * @param {!Event} ev
  926. * @param {{x: number, y: number}} pageOffset
  927. * @param {!ClientRect} clientRect
  928. * @return {{x: number, y: number}}
  929. */
  930. function getNormalizedEventCoords(ev, pageOffset, clientRect) {
  931. var x = pageOffset.x,
  932. y = pageOffset.y;
  933. var documentX = x + clientRect.left;
  934. var documentY = y + clientRect.top;
  935. var normalizedX = void 0;
  936. var normalizedY = void 0;
  937. // Determine touch point relative to the ripple container.
  938. if (ev.type === 'touchstart') {
  939. ev = /** @type {!TouchEvent} */ev;
  940. normalizedX = ev.changedTouches[0].pageX - documentX;
  941. normalizedY = ev.changedTouches[0].pageY - documentY;
  942. } else {
  943. ev = /** @type {!MouseEvent} */ev;
  944. normalizedX = ev.pageX - documentX;
  945. normalizedY = ev.pageY - documentY;
  946. }
  947. return { x: normalizedX, y: normalizedY };
  948. }
  949. /***/ }),
  950. /* 7 */
  951. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  952. "use strict";
  953. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  954. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  955. /**
  956. * @license
  957. * Copyright 2018 Google Inc.
  958. *
  959. * Permission is hereby granted, free of charge, to any person obtaining a copy
  960. * of this software and associated documentation files (the "Software"), to deal
  961. * in the Software without restriction, including without limitation the rights
  962. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  963. * copies of the Software, and to permit persons to whom the Software is
  964. * furnished to do so, subject to the following conditions:
  965. *
  966. * The above copyright notice and this permission notice shall be included in
  967. * all copies or substantial portions of the Software.
  968. *
  969. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  970. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  971. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  972. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  973. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  974. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  975. * THE SOFTWARE.
  976. */
  977. /* eslint no-unused-vars: [2, {"args": "none"}] */
  978. /**
  979. * Adapter for MDC Top App Bar
  980. *
  981. * Defines the shape of the adapter expected by the foundation. Implement this
  982. * adapter to integrate the Top App Bar into your framework. See
  983. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  984. * for more information.
  985. *
  986. * @record
  987. */
  988. var MDCTopAppBarAdapter = function () {
  989. function MDCTopAppBarAdapter() {
  990. _classCallCheck(this, MDCTopAppBarAdapter);
  991. }
  992. _createClass(MDCTopAppBarAdapter, [{
  993. key: "addClass",
  994. /**
  995. * Adds a class to the root Element.
  996. * @param {string} className
  997. */
  998. value: function addClass(className) {}
  999. /**
  1000. * Removes a class from the root Element.
  1001. * @param {string} className
  1002. */
  1003. }, {
  1004. key: "removeClass",
  1005. value: function removeClass(className) {}
  1006. /**
  1007. * Returns true if the root Element contains the given class.
  1008. * @param {string} className
  1009. * @return {boolean}
  1010. */
  1011. }, {
  1012. key: "hasClass",
  1013. value: function hasClass(className) {}
  1014. /**
  1015. * Sets the specified inline style property on the root Element to the given value.
  1016. * @param {string} property
  1017. * @param {string} value
  1018. */
  1019. }, {
  1020. key: "setStyle",
  1021. value: function setStyle(property, value) {}
  1022. /**
  1023. * Gets the height of the top app bar.
  1024. * @return {number}
  1025. */
  1026. }, {
  1027. key: "getTopAppBarHeight",
  1028. value: function getTopAppBarHeight() {}
  1029. /**
  1030. * Registers an event handler on the navigation icon element for a given event.
  1031. * @param {string} type
  1032. * @param {function(!Event): undefined} handler
  1033. */
  1034. }, {
  1035. key: "registerNavigationIconInteractionHandler",
  1036. value: function registerNavigationIconInteractionHandler(type, handler) {}
  1037. /**
  1038. * Deregisters an event handler on the navigation icon element for a given event.
  1039. * @param {string} type
  1040. * @param {function(!Event): undefined} handler
  1041. */
  1042. }, {
  1043. key: "deregisterNavigationIconInteractionHandler",
  1044. value: function deregisterNavigationIconInteractionHandler(type, handler) {}
  1045. /**
  1046. * Emits an event when the navigation icon is clicked.
  1047. */
  1048. }, {
  1049. key: "notifyNavigationIconClicked",
  1050. value: function notifyNavigationIconClicked() {}
  1051. /** @param {function(!Event)} handler */
  1052. }, {
  1053. key: "registerScrollHandler",
  1054. value: function registerScrollHandler(handler) {}
  1055. /** @param {function(!Event)} handler */
  1056. }, {
  1057. key: "deregisterScrollHandler",
  1058. value: function deregisterScrollHandler(handler) {}
  1059. /** @param {function(!Event)} handler */
  1060. }, {
  1061. key: "registerResizeHandler",
  1062. value: function registerResizeHandler(handler) {}
  1063. /** @param {function(!Event)} handler */
  1064. }, {
  1065. key: "deregisterResizeHandler",
  1066. value: function deregisterResizeHandler(handler) {}
  1067. /** @return {number} */
  1068. }, {
  1069. key: "getViewportScrollY",
  1070. value: function getViewportScrollY() {}
  1071. /** @return {number} */
  1072. }, {
  1073. key: "getTotalActionItems",
  1074. value: function getTotalActionItems() {}
  1075. }]);
  1076. return MDCTopAppBarAdapter;
  1077. }();
  1078. /* unused harmony default export */ var _unused_webpack_default_export = (MDCTopAppBarAdapter);
  1079. /***/ }),
  1080. /* 8 */
  1081. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1082. "use strict";
  1083. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; });
  1084. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  1085. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; });
  1086. /**
  1087. * @license
  1088. * Copyright 2018 Google Inc.
  1089. *
  1090. * Permission is hereby granted, free of charge, to any person obtaining a copy
  1091. * of this software and associated documentation files (the "Software"), to deal
  1092. * in the Software without restriction, including without limitation the rights
  1093. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  1094. * copies of the Software, and to permit persons to whom the Software is
  1095. * furnished to do so, subject to the following conditions:
  1096. *
  1097. * The above copyright notice and this permission notice shall be included in
  1098. * all copies or substantial portions of the Software.
  1099. *
  1100. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  1101. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  1102. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  1103. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  1104. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  1105. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  1106. * THE SOFTWARE.
  1107. */
  1108. /** @enum {string} */
  1109. var cssClasses = {
  1110. FIXED_CLASS: 'mdc-top-app-bar--fixed',
  1111. FIXED_SCROLLED_CLASS: 'mdc-top-app-bar--fixed-scrolled',
  1112. SHORT_CLASS: 'mdc-top-app-bar--short',
  1113. SHORT_HAS_ACTION_ITEM_CLASS: 'mdc-top-app-bar--short-has-action-item',
  1114. SHORT_COLLAPSED_CLASS: 'mdc-top-app-bar--short-collapsed'
  1115. };
  1116. /** @enum {number} */
  1117. var numbers = {
  1118. DEBOUNCE_THROTTLE_RESIZE_TIME_MS: 100,
  1119. MAX_TOP_APP_BAR_HEIGHT: 128
  1120. };
  1121. /** @enum {string} */
  1122. var strings = {
  1123. ACTION_ITEM_SELECTOR: '.mdc-top-app-bar__action-item',
  1124. NAVIGATION_EVENT: 'MDCTopAppBar:nav',
  1125. NAVIGATION_ICON_SELECTOR: '.mdc-top-app-bar__navigation-icon',
  1126. ROOT_SELECTOR: '.mdc-top-app-bar',
  1127. TITLE_SELECTOR: '.mdc-top-app-bar__title'
  1128. };
  1129. /***/ }),
  1130. /* 9 */
  1131. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1132. "use strict";
  1133. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return transformStyleProperties; });
  1134. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getCorrectEventName; });
  1135. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getCorrectPropertyName; });
  1136. /**
  1137. * @license
  1138. * Copyright 2016 Google Inc.
  1139. *
  1140. * Permission is hereby granted, free of charge, to any person obtaining a copy
  1141. * of this software and associated documentation files (the "Software"), to deal
  1142. * in the Software without restriction, including without limitation the rights
  1143. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  1144. * copies of the Software, and to permit persons to whom the Software is
  1145. * furnished to do so, subject to the following conditions:
  1146. *
  1147. * The above copyright notice and this permission notice shall be included in
  1148. * all copies or substantial portions of the Software.
  1149. *
  1150. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  1151. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  1152. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  1153. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  1154. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  1155. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  1156. * THE SOFTWARE.
  1157. */
  1158. /**
  1159. * @typedef {{
  1160. * noPrefix: string,
  1161. * webkitPrefix: string,
  1162. * styleProperty: string
  1163. * }}
  1164. */
  1165. var VendorPropertyMapType = void 0;
  1166. /** @const {Object<string, !VendorPropertyMapType>} */
  1167. var eventTypeMap = {
  1168. 'animationstart': {
  1169. noPrefix: 'animationstart',
  1170. webkitPrefix: 'webkitAnimationStart',
  1171. styleProperty: 'animation'
  1172. },
  1173. 'animationend': {
  1174. noPrefix: 'animationend',
  1175. webkitPrefix: 'webkitAnimationEnd',
  1176. styleProperty: 'animation'
  1177. },
  1178. 'animationiteration': {
  1179. noPrefix: 'animationiteration',
  1180. webkitPrefix: 'webkitAnimationIteration',
  1181. styleProperty: 'animation'
  1182. },
  1183. 'transitionend': {
  1184. noPrefix: 'transitionend',
  1185. webkitPrefix: 'webkitTransitionEnd',
  1186. styleProperty: 'transition'
  1187. }
  1188. };
  1189. /** @const {Object<string, !VendorPropertyMapType>} */
  1190. var cssPropertyMap = {
  1191. 'animation': {
  1192. noPrefix: 'animation',
  1193. webkitPrefix: '-webkit-animation'
  1194. },
  1195. 'transform': {
  1196. noPrefix: 'transform',
  1197. webkitPrefix: '-webkit-transform'
  1198. },
  1199. 'transition': {
  1200. noPrefix: 'transition',
  1201. webkitPrefix: '-webkit-transition'
  1202. }
  1203. };
  1204. /**
  1205. * @param {!Object} windowObj
  1206. * @return {boolean}
  1207. */
  1208. function hasProperShape(windowObj) {
  1209. return windowObj['document'] !== undefined && typeof windowObj['document']['createElement'] === 'function';
  1210. }
  1211. /**
  1212. * @param {string} eventType
  1213. * @return {boolean}
  1214. */
  1215. function eventFoundInMaps(eventType) {
  1216. return eventType in eventTypeMap || eventType in cssPropertyMap;
  1217. }
  1218. /**
  1219. * @param {string} eventType
  1220. * @param {!Object<string, !VendorPropertyMapType>} map
  1221. * @param {!Element} el
  1222. * @return {string}
  1223. */
  1224. function getJavaScriptEventName(eventType, map, el) {
  1225. return map[eventType].styleProperty in el.style ? map[eventType].noPrefix : map[eventType].webkitPrefix;
  1226. }
  1227. /**
  1228. * Helper function to determine browser prefix for CSS3 animation events
  1229. * and property names.
  1230. * @param {!Object} windowObj
  1231. * @param {string} eventType
  1232. * @return {string}
  1233. */
  1234. function getAnimationName(windowObj, eventType) {
  1235. if (!hasProperShape(windowObj) || !eventFoundInMaps(eventType)) {
  1236. return eventType;
  1237. }
  1238. var map = /** @type {!Object<string, !VendorPropertyMapType>} */eventType in eventTypeMap ? eventTypeMap : cssPropertyMap;
  1239. var el = windowObj['document']['createElement']('div');
  1240. var eventName = '';
  1241. if (map === eventTypeMap) {
  1242. eventName = getJavaScriptEventName(eventType, map, el);
  1243. } else {
  1244. eventName = map[eventType].noPrefix in el.style ? map[eventType].noPrefix : map[eventType].webkitPrefix;
  1245. }
  1246. return eventName;
  1247. }
  1248. // Public functions to access getAnimationName() for JavaScript events or CSS
  1249. // property names.
  1250. var transformStyleProperties = ['transform', 'WebkitTransform', 'MozTransform', 'OTransform', 'MSTransform'];
  1251. /**
  1252. * @param {!Object} windowObj
  1253. * @param {string} eventType
  1254. * @return {string}
  1255. */
  1256. function getCorrectEventName(windowObj, eventType) {
  1257. return getAnimationName(windowObj, eventType);
  1258. }
  1259. /**
  1260. * @param {!Object} windowObj
  1261. * @param {string} eventType
  1262. * @return {string}
  1263. */
  1264. function getCorrectPropertyName(windowObj, eventType) {
  1265. return getAnimationName(windowObj, eventType);
  1266. }
  1267. /***/ }),
  1268. /* 10 */
  1269. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1270. "use strict";
  1271. /* unused harmony export MDCTabDimensions */
  1272. /* unused harmony export MDCTabAdapter */
  1273. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  1274. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1275. /**
  1276. * @license
  1277. * Copyright 2018 Google Inc.
  1278. *
  1279. * Permission is hereby granted, free of charge, to any person obtaining a copy
  1280. * of this software and associated documentation files (the "Software"), to deal
  1281. * in the Software without restriction, including without limitation the rights
  1282. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  1283. * copies of the Software, and to permit persons to whom the Software is
  1284. * furnished to do so, subject to the following conditions:
  1285. *
  1286. * The above copyright notice and this permission notice shall be included in
  1287. * all copies or substantial portions of the Software.
  1288. *
  1289. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  1290. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  1291. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  1292. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  1293. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  1294. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  1295. * THE SOFTWARE.
  1296. */
  1297. /* eslint no-unused-vars: [2, {"args": "none"}] */
  1298. /**
  1299. * MDCTabDimensions provides details about the left and right edges of the Tab
  1300. * root element and the Tab content element. These values are used to determine
  1301. * the visual position of the Tab with respect it's parent container.
  1302. * @typedef {{rootLeft: number, rootRight: number, contentLeft: number, contentRight: number}}
  1303. */
  1304. var MDCTabDimensions = void 0;
  1305. /**
  1306. * Adapter for MDC Tab.
  1307. *
  1308. * Defines the shape of the adapter expected by the foundation. Implement this
  1309. * adapter to integrate the Tab into your framework. See
  1310. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  1311. * for more information.
  1312. *
  1313. * @record
  1314. */
  1315. var MDCTabAdapter = function () {
  1316. function MDCTabAdapter() {
  1317. _classCallCheck(this, MDCTabAdapter);
  1318. }
  1319. _createClass(MDCTabAdapter, [{
  1320. key: "addClass",
  1321. /**
  1322. * Adds the given className to the root element.
  1323. * @param {string} className The className to add
  1324. */
  1325. value: function addClass(className) {}
  1326. /**
  1327. * Removes the given className from the root element.
  1328. * @param {string} className The className to remove
  1329. */
  1330. }, {
  1331. key: "removeClass",
  1332. value: function removeClass(className) {}
  1333. /**
  1334. * Returns whether the root element has the given className.
  1335. * @param {string} className The className to remove
  1336. * @return {boolean}
  1337. */
  1338. }, {
  1339. key: "hasClass",
  1340. value: function hasClass(className) {}
  1341. /**
  1342. * Sets the given attrName of the root element to the given value.
  1343. * @param {string} attr The attribute name to set
  1344. * @param {string} value The value so give the attribute
  1345. */
  1346. }, {
  1347. key: "setAttr",
  1348. value: function setAttr(attr, value) {}
  1349. /**
  1350. * Activates the indicator element.
  1351. * @param {!ClientRect=} previousIndicatorClientRect The client rect of the previously activated indicator
  1352. */
  1353. }, {
  1354. key: "activateIndicator",
  1355. value: function activateIndicator(previousIndicatorClientRect) {}
  1356. /** Deactivates the indicator. */
  1357. }, {
  1358. key: "deactivateIndicator",
  1359. value: function deactivateIndicator() {}
  1360. /**
  1361. * Emits the MDCTab:interacted event for use by parent components
  1362. */
  1363. }, {
  1364. key: "notifyInteracted",
  1365. value: function notifyInteracted() {}
  1366. /**
  1367. * Returns the offsetLeft value of the root element.
  1368. * @return {number}
  1369. */
  1370. }, {
  1371. key: "getOffsetLeft",
  1372. value: function getOffsetLeft() {}
  1373. /**
  1374. * Returns the offsetWidth value of the root element.
  1375. * @return {number}
  1376. */
  1377. }, {
  1378. key: "getOffsetWidth",
  1379. value: function getOffsetWidth() {}
  1380. /**
  1381. * Returns the offsetLeft of the content element.
  1382. * @return {number}
  1383. */
  1384. }, {
  1385. key: "getContentOffsetLeft",
  1386. value: function getContentOffsetLeft() {}
  1387. /**
  1388. * Returns the offsetWidth of the content element.
  1389. * @return {number}
  1390. */
  1391. }, {
  1392. key: "getContentOffsetWidth",
  1393. value: function getContentOffsetWidth() {}
  1394. /**
  1395. * Applies focus to the root element
  1396. */
  1397. }, {
  1398. key: "focus",
  1399. value: function focus() {}
  1400. }]);
  1401. return MDCTabAdapter;
  1402. }();
  1403. /***/ }),
  1404. /* 11 */
  1405. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1406. "use strict";
  1407. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__adapter__ = __webpack_require__(5);
  1408. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  1409. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1410. /**
  1411. * @license
  1412. * Copyright 2018 Google Inc.
  1413. *
  1414. * Permission is hereby granted, free of charge, to any person obtaining a copy
  1415. * of this software and associated documentation files (the "Software"), to deal
  1416. * in the Software without restriction, including without limitation the rights
  1417. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  1418. * copies of the Software, and to permit persons to whom the Software is
  1419. * furnished to do so, subject to the following conditions:
  1420. *
  1421. * The above copyright notice and this permission notice shall be included in
  1422. * all copies or substantial portions of the Software.
  1423. *
  1424. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  1425. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  1426. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  1427. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  1428. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  1429. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  1430. * THE SOFTWARE.
  1431. */
  1432. /* eslint no-unused-vars: [2, {"args": "none"}] */
  1433. /* eslint-disable no-unused-vars */
  1434. /* eslint-enable no-unused-vars */
  1435. /**
  1436. * @abstract
  1437. */
  1438. var MDCTabScrollerRTL = function () {
  1439. /** @param {!MDCTabScrollerAdapter} adapter */
  1440. function MDCTabScrollerRTL(adapter) {
  1441. _classCallCheck(this, MDCTabScrollerRTL);
  1442. /** @private */
  1443. this.adapter_ = adapter;
  1444. }
  1445. /**
  1446. * @param {number} translateX The current translateX position
  1447. * @return {number}
  1448. * @abstract
  1449. */
  1450. _createClass(MDCTabScrollerRTL, [{
  1451. key: 'getScrollPositionRTL',
  1452. value: function getScrollPositionRTL(translateX) {}
  1453. /**
  1454. * @param {number} scrollX
  1455. * @return {!MDCTabScrollerAnimation}
  1456. * @abstract
  1457. */
  1458. }, {
  1459. key: 'scrollToRTL',
  1460. value: function scrollToRTL(scrollX) {}
  1461. /**
  1462. * @param {number} scrollX
  1463. * @return {!MDCTabScrollerAnimation}
  1464. * @abstract
  1465. */
  1466. }, {
  1467. key: 'incrementScrollRTL',
  1468. value: function incrementScrollRTL(scrollX) {}
  1469. /**
  1470. * @param {number} scrollX The current scrollX position
  1471. * @param {number} translateX The current translateX position
  1472. * @return {number}
  1473. * @abstract
  1474. */
  1475. }, {
  1476. key: 'getAnimatingScrollPosition',
  1477. value: function getAnimatingScrollPosition(scrollX, translateX) {}
  1478. }]);
  1479. return MDCTabScrollerRTL;
  1480. }();
  1481. /* harmony default export */ __webpack_exports__["a"] = (MDCTabScrollerRTL);
  1482. /***/ }),
  1483. /* 12 */
  1484. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1485. "use strict";
  1486. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__constants__ = __webpack_require__(8);
  1487. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(7);
  1488. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_base_foundation__ = __webpack_require__(0);
  1489. 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; };
  1490. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  1491. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1492. 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; }
  1493. 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; }
  1494. /**
  1495. * @license
  1496. * Copyright 2018 Google Inc.
  1497. *
  1498. * Permission is hereby granted, free of charge, to any person obtaining a copy
  1499. * of this software and associated documentation files (the "Software"), to deal
  1500. * in the Software without restriction, including without limitation the rights
  1501. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  1502. * copies of the Software, and to permit persons to whom the Software is
  1503. * furnished to do so, subject to the following conditions:
  1504. *
  1505. * The above copyright notice and this permission notice shall be included in
  1506. * all copies or substantial portions of the Software.
  1507. *
  1508. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  1509. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  1510. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  1511. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  1512. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  1513. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  1514. * THE SOFTWARE.
  1515. */
  1516. /**
  1517. * @extends {MDCFoundation<!MDCTopAppBarAdapter>}
  1518. */
  1519. var MDCTopAppBarBaseFoundation = function (_MDCFoundation) {
  1520. _inherits(MDCTopAppBarBaseFoundation, _MDCFoundation);
  1521. _createClass(MDCTopAppBarBaseFoundation, null, [{
  1522. key: 'strings',
  1523. /** @return enum {string} */
  1524. get: function get() {
  1525. return __WEBPACK_IMPORTED_MODULE_0__constants__["c" /* strings */];
  1526. }
  1527. /** @return enum {string} */
  1528. }, {
  1529. key: 'cssClasses',
  1530. get: function get() {
  1531. return __WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */];
  1532. }
  1533. /** @return enum {number} */
  1534. }, {
  1535. key: 'numbers',
  1536. get: function get() {
  1537. return __WEBPACK_IMPORTED_MODULE_0__constants__["b" /* numbers */];
  1538. }
  1539. /**
  1540. * {@see MDCTopAppBarAdapter} for typing information on parameters and return
  1541. * types.
  1542. * @return {!MDCTopAppBarAdapter}
  1543. */
  1544. }, {
  1545. key: 'defaultAdapter',
  1546. get: function get() {
  1547. return (/** @type {!MDCTopAppBarAdapter} */{
  1548. hasClass: function hasClass() /* className: string */{},
  1549. addClass: function addClass() /* className: string */{},
  1550. removeClass: function removeClass() /* className: string */{},
  1551. setStyle: function setStyle() /* property: string, value: string */{},
  1552. getTopAppBarHeight: function getTopAppBarHeight() {},
  1553. registerNavigationIconInteractionHandler: function registerNavigationIconInteractionHandler() /* type: string, handler: EventListener */{},
  1554. deregisterNavigationIconInteractionHandler: function deregisterNavigationIconInteractionHandler() /* type: string, handler: EventListener */{},
  1555. notifyNavigationIconClicked: function notifyNavigationIconClicked() {},
  1556. registerScrollHandler: function registerScrollHandler() /* handler: EventListener */{},
  1557. deregisterScrollHandler: function deregisterScrollHandler() /* handler: EventListener */{},
  1558. registerResizeHandler: function registerResizeHandler() /* handler: EventListener */{},
  1559. deregisterResizeHandler: function deregisterResizeHandler() /* handler: EventListener */{},
  1560. getViewportScrollY: function getViewportScrollY() {
  1561. return (/* number */0
  1562. );
  1563. },
  1564. getTotalActionItems: function getTotalActionItems() {
  1565. return (/* number */0
  1566. );
  1567. }
  1568. }
  1569. );
  1570. }
  1571. /**
  1572. * @param {!MDCTopAppBarAdapter} adapter
  1573. */
  1574. }]);
  1575. function MDCTopAppBarBaseFoundation( /** @type {!MDCTopAppBarAdapter} */adapter) {
  1576. _classCallCheck(this, MDCTopAppBarBaseFoundation);
  1577. var _this = _possibleConstructorReturn(this, (MDCTopAppBarBaseFoundation.__proto__ || Object.getPrototypeOf(MDCTopAppBarBaseFoundation)).call(this, _extends(MDCTopAppBarBaseFoundation.defaultAdapter, adapter)));
  1578. _this.navClickHandler_ = function () {
  1579. return _this.adapter_.notifyNavigationIconClicked();
  1580. };
  1581. _this.scrollHandler_ = function () {};
  1582. return _this;
  1583. }
  1584. _createClass(MDCTopAppBarBaseFoundation, [{
  1585. key: 'init',
  1586. value: function init() {
  1587. this.adapter_.registerNavigationIconInteractionHandler('click', this.navClickHandler_);
  1588. }
  1589. }, {
  1590. key: 'destroy',
  1591. value: function destroy() {
  1592. this.adapter_.deregisterNavigationIconInteractionHandler('click', this.navClickHandler_);
  1593. }
  1594. }, {
  1595. key: 'initScrollHandler',
  1596. value: function initScrollHandler() {
  1597. this.adapter_.registerScrollHandler(this.scrollHandler_);
  1598. }
  1599. }, {
  1600. key: 'destroyScrollHandler',
  1601. value: function destroyScrollHandler() {
  1602. this.adapter_.deregisterScrollHandler(this.scrollHandler_);
  1603. }
  1604. }]);
  1605. return MDCTopAppBarBaseFoundation;
  1606. }(__WEBPACK_IMPORTED_MODULE_2__material_base_foundation__["a" /* default */]);
  1607. /* harmony default export */ __webpack_exports__["a"] = (MDCTopAppBarBaseFoundation);
  1608. /***/ }),
  1609. /* 13 */
  1610. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1611. "use strict";
  1612. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  1613. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "closest", function() { return closest; });
  1614. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "matches", function() { return matches; });
  1615. /**
  1616. * @license
  1617. * Copyright 2018 Google Inc.
  1618. *
  1619. * Permission is hereby granted, free of charge, to any person obtaining a copy
  1620. * of this software and associated documentation files (the "Software"), to deal
  1621. * in the Software without restriction, including without limitation the rights
  1622. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  1623. * copies of the Software, and to permit persons to whom the Software is
  1624. * furnished to do so, subject to the following conditions:
  1625. *
  1626. * The above copyright notice and this permission notice shall be included in
  1627. * all copies or substantial portions of the Software.
  1628. *
  1629. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  1630. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  1631. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  1632. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  1633. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  1634. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  1635. * THE SOFTWARE.
  1636. */
  1637. /**
  1638. * @fileoverview A "ponyfill" is a polyfill that doesn't modify the global prototype chain.
  1639. * This makes ponyfills safer than traditional polyfills, especially for libraries like MDC.
  1640. */
  1641. /**
  1642. * @param {!Element} element
  1643. * @param {string} selector
  1644. * @return {?Element}
  1645. */
  1646. function closest(element, selector) {
  1647. if (element.closest) {
  1648. return element.closest(selector);
  1649. }
  1650. var el = element;
  1651. while (el) {
  1652. if (matches(el, selector)) {
  1653. return el;
  1654. }
  1655. el = el.parentElement;
  1656. }
  1657. return null;
  1658. }
  1659. /**
  1660. * @param {!Element} element
  1661. * @param {string} selector
  1662. * @return {boolean}
  1663. */
  1664. function matches(element, selector) {
  1665. var nativeMatches = element.matches || element.webkitMatchesSelector || element.msMatchesSelector;
  1666. return nativeMatches.call(element, selector);
  1667. }
  1668. /***/ }),
  1669. /* 14 */
  1670. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1671. "use strict";
  1672. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  1673. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1674. /**
  1675. * @license
  1676. * Copyright 2018 Google Inc.
  1677. *
  1678. * Permission is hereby granted, free of charge, to any person obtaining a copy
  1679. * of this software and associated documentation files (the "Software"), to deal
  1680. * in the Software without restriction, including without limitation the rights
  1681. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  1682. * copies of the Software, and to permit persons to whom the Software is
  1683. * furnished to do so, subject to the following conditions:
  1684. *
  1685. * The above copyright notice and this permission notice shall be included in
  1686. * all copies or substantial portions of the Software.
  1687. *
  1688. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  1689. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  1690. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  1691. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  1692. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  1693. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  1694. * THE SOFTWARE.
  1695. */
  1696. /* eslint no-unused-vars: [2, {"args": "none"}] */
  1697. /**
  1698. * Adapter for MDC Drawer
  1699. *
  1700. * Defines the shape of the adapter expected by the foundation. Implement this
  1701. * adapter to integrate the Drawer into your framework. See
  1702. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  1703. * for more information.
  1704. *
  1705. * @record
  1706. */
  1707. var MDCDrawerAdapter = function () {
  1708. function MDCDrawerAdapter() {
  1709. _classCallCheck(this, MDCDrawerAdapter);
  1710. }
  1711. _createClass(MDCDrawerAdapter, [{
  1712. key: "addClass",
  1713. /**
  1714. * Adds a class to the root Element.
  1715. * @param {string} className
  1716. */
  1717. value: function addClass(className) {}
  1718. /**
  1719. * Removes a class from the root Element.
  1720. * @param {string} className
  1721. */
  1722. }, {
  1723. key: "removeClass",
  1724. value: function removeClass(className) {}
  1725. /**
  1726. * Returns true if the root Element contains the given class.
  1727. * @param {string} className
  1728. * @return {boolean}
  1729. */
  1730. }, {
  1731. key: "hasClass",
  1732. value: function hasClass(className) {}
  1733. /**
  1734. * @param {!Element} element target element to verify class name
  1735. * @param {string} className class name
  1736. */
  1737. }, {
  1738. key: "elementHasClass",
  1739. value: function elementHasClass(element, className) {}
  1740. /**
  1741. * Saves the focus of currently active element.
  1742. */
  1743. }, {
  1744. key: "saveFocus",
  1745. value: function saveFocus() {}
  1746. /**
  1747. * Restores focus to element previously saved with 'saveFocus'.
  1748. */
  1749. }, {
  1750. key: "restoreFocus",
  1751. value: function restoreFocus() {}
  1752. /**
  1753. * Focuses the active / selected navigation item.
  1754. */
  1755. }, {
  1756. key: "focusActiveNavigationItem",
  1757. value: function focusActiveNavigationItem() {}
  1758. /**
  1759. * Emits a custom event "MDCDrawer:closed" denoting the drawer has closed.
  1760. */
  1761. }, {
  1762. key: "notifyClose",
  1763. value: function notifyClose() {}
  1764. /**
  1765. * Emits a custom event "MDCDrawer:opened" denoting the drawer has opened.
  1766. */
  1767. }, {
  1768. key: "notifyOpen",
  1769. value: function notifyOpen() {}
  1770. /**
  1771. * Traps focus on root element and focuses the active navigation element.
  1772. */
  1773. }, {
  1774. key: "trapFocus",
  1775. value: function trapFocus() {}
  1776. /**
  1777. * Releases focus trap from root element which was set by `trapFocus`
  1778. * and restores focus to where it was prior to calling `trapFocus`.
  1779. */
  1780. }, {
  1781. key: "releaseFocus",
  1782. value: function releaseFocus() {}
  1783. }]);
  1784. return MDCDrawerAdapter;
  1785. }();
  1786. /* unused harmony default export */ var _unused_webpack_default_export = (MDCDrawerAdapter);
  1787. /***/ }),
  1788. /* 15 */
  1789. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1790. "use strict";
  1791. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  1792. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCList", function() { return MDCList; });
  1793. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  1794. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(16);
  1795. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__adapter__ = __webpack_require__(38);
  1796. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_dom_ponyfill__ = __webpack_require__(13);
  1797. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__constants__ = __webpack_require__(39);
  1798. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCListFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__foundation__["a"]; });
  1799. 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; };
  1800. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  1801. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1802. 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; }
  1803. 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; }
  1804. /**
  1805. * @license
  1806. * Copyright 2018 Google Inc.
  1807. *
  1808. * Permission is hereby granted, free of charge, to any person obtaining a copy
  1809. * of this software and associated documentation files (the "Software"), to deal
  1810. * in the Software without restriction, including without limitation the rights
  1811. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  1812. * copies of the Software, and to permit persons to whom the Software is
  1813. * furnished to do so, subject to the following conditions:
  1814. *
  1815. * The above copyright notice and this permission notice shall be included in
  1816. * all copies or substantial portions of the Software.
  1817. *
  1818. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  1819. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  1820. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  1821. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  1822. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  1823. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  1824. * THE SOFTWARE.
  1825. */
  1826. /**
  1827. * @extends MDCComponent<!MDCListFoundation>
  1828. */
  1829. var MDCList = function (_MDCComponent) {
  1830. _inherits(MDCList, _MDCComponent);
  1831. /** @param {...?} args */
  1832. function MDCList() {
  1833. var _ref;
  1834. _classCallCheck(this, MDCList);
  1835. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  1836. args[_key] = arguments[_key];
  1837. }
  1838. /** @private {!Function} */
  1839. var _this = _possibleConstructorReturn(this, (_ref = MDCList.__proto__ || Object.getPrototypeOf(MDCList)).call.apply(_ref, [this].concat(args)));
  1840. _this.handleKeydown_;
  1841. /** @private {!Function} */
  1842. _this.handleClick_;
  1843. /** @private {!Function} */
  1844. _this.focusInEventListener_;
  1845. /** @private {!Function} */
  1846. _this.focusOutEventListener_;
  1847. return _this;
  1848. }
  1849. /**
  1850. * @param {!Element} root
  1851. * @return {!MDCList}
  1852. */
  1853. _createClass(MDCList, [{
  1854. key: 'destroy',
  1855. value: function destroy() {
  1856. this.root_.removeEventListener('keydown', this.handleKeydown_);
  1857. this.root_.removeEventListener('click', this.handleClick_);
  1858. this.root_.removeEventListener('focusin', this.focusInEventListener_);
  1859. this.root_.removeEventListener('focusout', this.focusOutEventListener_);
  1860. }
  1861. }, {
  1862. key: 'initialSyncWithDOM',
  1863. value: function initialSyncWithDOM() {
  1864. this.handleClick_ = this.handleClickEvent_.bind(this);
  1865. this.handleKeydown_ = this.handleKeydownEvent_.bind(this);
  1866. this.focusInEventListener_ = this.handleFocusInEvent_.bind(this);
  1867. this.focusOutEventListener_ = this.handleFocusOutEvent_.bind(this);
  1868. this.root_.addEventListener('keydown', this.handleKeydown_);
  1869. this.root_.addEventListener('focusin', this.focusInEventListener_);
  1870. this.root_.addEventListener('focusout', this.focusOutEventListener_);
  1871. this.root_.addEventListener('click', this.handleClick_);
  1872. this.layout();
  1873. this.initializeListType();
  1874. }
  1875. }, {
  1876. key: 'layout',
  1877. value: function layout() {
  1878. var direction = this.root_.getAttribute(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].ARIA_ORIENTATION);
  1879. this.vertical = direction !== __WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].ARIA_ORIENTATION_HORIZONTAL;
  1880. // List items need to have at least tabindex=-1 to be focusable.
  1881. [].slice.call(this.root_.querySelectorAll('.mdc-list-item:not([tabindex])')).forEach(function (ele) {
  1882. ele.setAttribute('tabindex', -1);
  1883. });
  1884. // Child button/a elements are not tabbable until the list item is focused.
  1885. [].slice.call(this.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].FOCUSABLE_CHILD_ELEMENTS)).forEach(function (ele) {
  1886. return ele.setAttribute('tabindex', -1);
  1887. });
  1888. }
  1889. /**
  1890. * Used to figure out which list item this event is targetting. Or returns -1 if
  1891. * there is no list item
  1892. * @param {Event} evt
  1893. * @private
  1894. */
  1895. }, {
  1896. key: 'getListItemIndex_',
  1897. value: function getListItemIndex_(evt) {
  1898. var eventTarget = /** @type {HTMLElement} */evt.target;
  1899. var index = -1;
  1900. // Find the first ancestor that is a list item or the list.
  1901. 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)) {
  1902. eventTarget = eventTarget.parentElement;
  1903. }
  1904. // Get the index of the element if it is a list item.
  1905. if (eventTarget.classList.contains(__WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */].LIST_ITEM_CLASS)) {
  1906. index = this.listElements.indexOf(eventTarget);
  1907. }
  1908. return index;
  1909. }
  1910. /**
  1911. * Used to figure out which element was clicked before sending the event to the foundation.
  1912. * @param {Event} evt
  1913. * @private
  1914. */
  1915. }, {
  1916. key: 'handleFocusInEvent_',
  1917. value: function handleFocusInEvent_(evt) {
  1918. var index = this.getListItemIndex_(evt);
  1919. this.foundation_.handleFocusIn(evt, index);
  1920. }
  1921. /**
  1922. * Used to figure out which element was clicked before sending the event to the foundation.
  1923. * @param {Event} evt
  1924. * @private
  1925. */
  1926. }, {
  1927. key: 'handleFocusOutEvent_',
  1928. value: function handleFocusOutEvent_(evt) {
  1929. var index = this.getListItemIndex_(evt);
  1930. this.foundation_.handleFocusOut(evt, index);
  1931. }
  1932. /**
  1933. * Used to figure out which element was focused when keydown event occurred before sending the event to the
  1934. * foundation.
  1935. * @param {Event} evt
  1936. * @private
  1937. */
  1938. }, {
  1939. key: 'handleKeydownEvent_',
  1940. value: function handleKeydownEvent_(evt) {
  1941. var index = this.getListItemIndex_(evt);
  1942. if (index >= 0) {
  1943. this.foundation_.handleKeydown(evt, evt.target.classList.contains(__WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */].LIST_ITEM_CLASS), index);
  1944. }
  1945. }
  1946. /**
  1947. * Used to figure out which element was clicked before sending the event to the foundation.
  1948. * @param {Event} evt
  1949. * @private
  1950. */
  1951. }, {
  1952. key: 'handleClickEvent_',
  1953. value: function handleClickEvent_(evt) {
  1954. var index = this.getListItemIndex_(evt);
  1955. // Toggle the checkbox only if it's not the target of the event, or the checkbox will have 2 change events.
  1956. 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);
  1957. this.foundation_.handleClick(index, toggleCheckbox);
  1958. }
  1959. }, {
  1960. key: 'initializeListType',
  1961. value: function initializeListType() {
  1962. // Automatically set single selection if selected/activated classes are present.
  1963. var preselectedElement = this.root_.querySelector('.' + __WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */].LIST_ITEM_ACTIVATED_CLASS + ', .' + __WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */].LIST_ITEM_SELECTED_CLASS);
  1964. if (preselectedElement) {
  1965. if (preselectedElement.classList.contains(__WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */].LIST_ITEM_ACTIVATED_CLASS)) {
  1966. this.foundation_.setUseActivatedClass(true);
  1967. }
  1968. this.singleSelection = true;
  1969. this.selectedIndex = this.listElements.indexOf(preselectedElement);
  1970. }
  1971. }
  1972. /** @param {boolean} value */
  1973. }, {
  1974. key: 'getDefaultFoundation',
  1975. /** @return {!MDCListFoundation} */
  1976. value: function getDefaultFoundation() {
  1977. var _this2 = this;
  1978. return new __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]( /** @type {!MDCListAdapter} */_extends({
  1979. getListItemCount: function getListItemCount() {
  1980. return _this2.listElements.length;
  1981. },
  1982. getFocusedElementIndex: function getFocusedElementIndex() {
  1983. return _this2.listElements.indexOf(document.activeElement);
  1984. },
  1985. setAttributeForElementIndex: function setAttributeForElementIndex(index, attr, value) {
  1986. var element = _this2.listElements[index];
  1987. if (element) {
  1988. element.setAttribute(attr, value);
  1989. }
  1990. },
  1991. removeAttributeForElementIndex: function removeAttributeForElementIndex(index, attr) {
  1992. var element = _this2.listElements[index];
  1993. if (element) {
  1994. element.removeAttribute(attr);
  1995. }
  1996. },
  1997. addClassForElementIndex: function addClassForElementIndex(index, className) {
  1998. var element = _this2.listElements[index];
  1999. if (element) {
  2000. element.classList.add(className);
  2001. }
  2002. },
  2003. removeClassForElementIndex: function removeClassForElementIndex(index, className) {
  2004. var element = _this2.listElements[index];
  2005. if (element) {
  2006. element.classList.remove(className);
  2007. }
  2008. },
  2009. focusItemAtIndex: function focusItemAtIndex(index) {
  2010. var element = _this2.listElements[index];
  2011. if (element) {
  2012. element.focus();
  2013. }
  2014. },
  2015. setTabIndexForListItemChildren: function setTabIndexForListItemChildren(listItemIndex, tabIndexValue) {
  2016. var element = _this2.listElements[listItemIndex];
  2017. var listItemChildren = [].slice.call(element.querySelectorAll(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].CHILD_ELEMENTS_TO_TOGGLE_TABINDEX));
  2018. listItemChildren.forEach(function (ele) {
  2019. return ele.setAttribute('tabindex', tabIndexValue);
  2020. });
  2021. },
  2022. followHref: function followHref(index) {
  2023. var listItem = _this2.listElements[index];
  2024. if (listItem && listItem.href) {
  2025. listItem.click();
  2026. }
  2027. },
  2028. toggleCheckbox: function toggleCheckbox(index) {
  2029. var checkboxOrRadioExists = false;
  2030. var listItem = _this2.listElements[index];
  2031. var elementsToToggle = [].slice.call(listItem.querySelectorAll(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].CHECKBOX_RADIO_SELECTOR));
  2032. elementsToToggle.forEach(function (element) {
  2033. var event = document.createEvent('Event');
  2034. event.initEvent('change', true, true);
  2035. if (!element.checked || element.type !== 'radio') {
  2036. element.checked = !element.checked;
  2037. element.dispatchEvent(event);
  2038. }
  2039. checkboxOrRadioExists = true;
  2040. });
  2041. return checkboxOrRadioExists;
  2042. }
  2043. }));
  2044. }
  2045. }, {
  2046. key: 'vertical',
  2047. set: function set(value) {
  2048. this.foundation_.setVerticalOrientation(value);
  2049. }
  2050. /** @return Array<!Element>*/
  2051. }, {
  2052. key: 'listElements',
  2053. get: function get() {
  2054. return [].slice.call(this.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].ENABLED_ITEMS_SELECTOR));
  2055. }
  2056. /** @param {boolean} value */
  2057. }, {
  2058. key: 'wrapFocus',
  2059. set: function set(value) {
  2060. this.foundation_.setWrapFocus(value);
  2061. }
  2062. /** @param {boolean} isSingleSelectionList */
  2063. }, {
  2064. key: 'singleSelection',
  2065. set: function set(isSingleSelectionList) {
  2066. this.foundation_.setSingleSelection(isSingleSelectionList);
  2067. }
  2068. /** @param {number} index */
  2069. }, {
  2070. key: 'selectedIndex',
  2071. set: function set(index) {
  2072. this.foundation_.setSelectedIndex(index);
  2073. }
  2074. }], [{
  2075. key: 'attachTo',
  2076. value: function attachTo(root) {
  2077. return new MDCList(root);
  2078. }
  2079. }]);
  2080. return MDCList;
  2081. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  2082. /***/ }),
  2083. /* 16 */
  2084. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2085. "use strict";
  2086. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  2087. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(38);
  2088. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(39);
  2089. 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; };
  2090. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  2091. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2092. 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; }
  2093. 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; }
  2094. /**
  2095. * @license
  2096. * Copyright 2018 Google Inc.
  2097. *
  2098. * Permission is hereby granted, free of charge, to any person obtaining a copy
  2099. * of this software and associated documentation files (the "Software"), to deal
  2100. * in the Software without restriction, including without limitation the rights
  2101. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  2102. * copies of the Software, and to permit persons to whom the Software is
  2103. * furnished to do so, subject to the following conditions:
  2104. *
  2105. * The above copyright notice and this permission notice shall be included in
  2106. * all copies or substantial portions of the Software.
  2107. *
  2108. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  2109. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  2110. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  2111. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  2112. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  2113. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  2114. * THE SOFTWARE.
  2115. */
  2116. var ELEMENTS_KEY_ALLOWED_IN = ['input', 'button', 'textarea', 'select'];
  2117. var MDCListFoundation = function (_MDCFoundation) {
  2118. _inherits(MDCListFoundation, _MDCFoundation);
  2119. _createClass(MDCListFoundation, null, [{
  2120. key: 'strings',
  2121. /** @return enum {string} */
  2122. get: function get() {
  2123. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  2124. }
  2125. /** @return enum {string} */
  2126. }, {
  2127. key: 'cssClasses',
  2128. get: function get() {
  2129. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  2130. }
  2131. /**
  2132. * {@see MDCListAdapter} for typing information on parameters and return
  2133. * types.
  2134. * @return {!MDCListAdapter}
  2135. */
  2136. }, {
  2137. key: 'defaultAdapter',
  2138. get: function get() {
  2139. return (/** @type {!MDCListAdapter} */{
  2140. getListItemCount: function getListItemCount() {},
  2141. getFocusedElementIndex: function getFocusedElementIndex() {},
  2142. setAttributeForElementIndex: function setAttributeForElementIndex() {},
  2143. removeAttributeForElementIndex: function removeAttributeForElementIndex() {},
  2144. addClassForElementIndex: function addClassForElementIndex() {},
  2145. removeClassForElementIndex: function removeClassForElementIndex() {},
  2146. focusItemAtIndex: function focusItemAtIndex() {},
  2147. setTabIndexForListItemChildren: function setTabIndexForListItemChildren() {},
  2148. followHref: function followHref() {},
  2149. toggleCheckbox: function toggleCheckbox() {}
  2150. }
  2151. );
  2152. }
  2153. /**
  2154. * @param {!MDCListAdapter=} adapter
  2155. */
  2156. }]);
  2157. function MDCListFoundation(adapter) {
  2158. _classCallCheck(this, MDCListFoundation);
  2159. /** {boolean} */
  2160. var _this = _possibleConstructorReturn(this, (MDCListFoundation.__proto__ || Object.getPrototypeOf(MDCListFoundation)).call(this, _extends(MDCListFoundation.defaultAdapter, adapter)));
  2161. _this.wrapFocus_ = false;
  2162. /** {boolean} */
  2163. _this.isVertical_ = true;
  2164. /** {boolean} */
  2165. _this.isSingleSelectionList_ = false;
  2166. /** {number} */
  2167. _this.selectedIndex_ = -1;
  2168. /** {boolean} */
  2169. _this.useActivatedClass_ = false;
  2170. return _this;
  2171. }
  2172. /**
  2173. * Sets the private wrapFocus_ variable.
  2174. * @param {boolean} value
  2175. */
  2176. _createClass(MDCListFoundation, [{
  2177. key: 'setWrapFocus',
  2178. value: function setWrapFocus(value) {
  2179. this.wrapFocus_ = value;
  2180. }
  2181. /**
  2182. * Sets the isVertical_ private variable.
  2183. * @param {boolean} value
  2184. */
  2185. }, {
  2186. key: 'setVerticalOrientation',
  2187. value: function setVerticalOrientation(value) {
  2188. this.isVertical_ = value;
  2189. }
  2190. /**
  2191. * Sets the isSingleSelectionList_ private variable.
  2192. * @param {boolean} value
  2193. */
  2194. }, {
  2195. key: 'setSingleSelection',
  2196. value: function setSingleSelection(value) {
  2197. this.isSingleSelectionList_ = value;
  2198. }
  2199. /**
  2200. * Sets the useActivatedClass_ private variable.
  2201. * @param {boolean} useActivated
  2202. */
  2203. }, {
  2204. key: 'setUseActivatedClass',
  2205. value: function setUseActivatedClass(useActivated) {
  2206. this.useActivatedClass_ = useActivated;
  2207. }
  2208. /** @param {number} index */
  2209. }, {
  2210. key: 'setSelectedIndex',
  2211. value: function setSelectedIndex(index) {
  2212. if (index === this.selectedIndex_) {
  2213. return;
  2214. }
  2215. var className = this.useActivatedClass_ ? __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LIST_ITEM_ACTIVATED_CLASS : __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LIST_ITEM_SELECTED_CLASS;
  2216. if (this.selectedIndex_ >= 0) {
  2217. this.adapter_.removeAttributeForElementIndex(this.selectedIndex_, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_SELECTED);
  2218. this.adapter_.removeClassForElementIndex(this.selectedIndex_, className);
  2219. this.adapter_.setAttributeForElementIndex(this.selectedIndex_, 'tabindex', -1);
  2220. }
  2221. if (index >= 0 && this.adapter_.getListItemCount() > index) {
  2222. this.selectedIndex_ = index;
  2223. this.adapter_.setAttributeForElementIndex(this.selectedIndex_, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_SELECTED, true);
  2224. this.adapter_.addClassForElementIndex(this.selectedIndex_, className);
  2225. this.adapter_.setAttributeForElementIndex(this.selectedIndex_, 'tabindex', 0);
  2226. if (this.selectedIndex_ !== 0) {
  2227. this.adapter_.setAttributeForElementIndex(0, 'tabindex', -1);
  2228. }
  2229. }
  2230. }
  2231. /**
  2232. * Focus in handler for the list items.
  2233. * @param evt
  2234. * @param {number} listItemIndex
  2235. */
  2236. }, {
  2237. key: 'handleFocusIn',
  2238. value: function handleFocusIn(evt, listItemIndex) {
  2239. if (listItemIndex >= 0) {
  2240. this.adapter_.setTabIndexForListItemChildren(listItemIndex, 0);
  2241. }
  2242. }
  2243. /**
  2244. * Focus out handler for the list items.
  2245. * @param {Event} evt
  2246. * @param {number} listItemIndex
  2247. */
  2248. }, {
  2249. key: 'handleFocusOut',
  2250. value: function handleFocusOut(evt, listItemIndex) {
  2251. if (listItemIndex >= 0) {
  2252. this.adapter_.setTabIndexForListItemChildren(listItemIndex, -1);
  2253. }
  2254. }
  2255. /**
  2256. * Key handler for the list.
  2257. * @param {Event} evt
  2258. * @param {boolean} isRootListItem
  2259. * @param {number} listItemIndex
  2260. */
  2261. }, {
  2262. key: 'handleKeydown',
  2263. value: function handleKeydown(evt, isRootListItem, listItemIndex) {
  2264. var arrowLeft = evt.key === 'ArrowLeft' || evt.keyCode === 37;
  2265. var arrowUp = evt.key === 'ArrowUp' || evt.keyCode === 38;
  2266. var arrowRight = evt.key === 'ArrowRight' || evt.keyCode === 39;
  2267. var arrowDown = evt.key === 'ArrowDown' || evt.keyCode === 40;
  2268. var isHome = evt.key === 'Home' || evt.keyCode === 36;
  2269. var isEnd = evt.key === 'End' || evt.keyCode === 35;
  2270. var isEnter = evt.key === 'Enter' || evt.keyCode === 13;
  2271. var isSpace = evt.key === 'Space' || evt.keyCode === 32;
  2272. var currentIndex = this.adapter_.getFocusedElementIndex();
  2273. if (currentIndex === -1) {
  2274. currentIndex = listItemIndex;
  2275. if (currentIndex < 0) {
  2276. // If this event doesn't have a mdc-list-item ancestor from the
  2277. // current list (not from a sublist), return early.
  2278. return;
  2279. }
  2280. }
  2281. if (this.isVertical_ && arrowDown || !this.isVertical_ && arrowRight) {
  2282. this.preventDefaultEvent_(evt);
  2283. this.focusNextElement(currentIndex);
  2284. } else if (this.isVertical_ && arrowUp || !this.isVertical_ && arrowLeft) {
  2285. this.preventDefaultEvent_(evt);
  2286. this.focusPrevElement(currentIndex);
  2287. } else if (isHome) {
  2288. this.preventDefaultEvent_(evt);
  2289. this.focusFirstElement();
  2290. } else if (isEnd) {
  2291. this.preventDefaultEvent_(evt);
  2292. this.focusLastElement();
  2293. } else if (isEnter || isSpace) {
  2294. if (isRootListItem) {
  2295. if (this.isSingleSelectionList_) {
  2296. // Check if the space key was pressed on the list item or a child element.
  2297. this.setSelectedIndex(currentIndex);
  2298. this.preventDefaultEvent_(evt);
  2299. }
  2300. // Explicitly activate links, since we're preventing default on Enter, and Space doesn't activate them.
  2301. this.adapter_.followHref(currentIndex);
  2302. }
  2303. var checkboxFound = this.adapter_.toggleCheckbox(listItemIndex);
  2304. if (checkboxFound) {
  2305. this.preventDefaultEvent_(evt);
  2306. }
  2307. }
  2308. }
  2309. /**
  2310. * Click handler for the list.
  2311. * @param {number} index
  2312. * @param {boolean} toggleCheckbox
  2313. */
  2314. }, {
  2315. key: 'handleClick',
  2316. value: function handleClick(index, toggleCheckbox) {
  2317. if (index === -1) return;
  2318. if (toggleCheckbox) {
  2319. this.adapter_.toggleCheckbox(index);
  2320. }
  2321. if (this.isSingleSelectionList_) {
  2322. this.setSelectedIndex(index);
  2323. }
  2324. }
  2325. /**
  2326. * Ensures that preventDefault is only called if the containing element doesn't
  2327. * consume the event, and it will cause an unintended scroll.
  2328. * @param {Event} evt
  2329. * @private
  2330. */
  2331. }, {
  2332. key: 'preventDefaultEvent_',
  2333. value: function preventDefaultEvent_(evt) {
  2334. var tagName = ('' + evt.target.tagName).toLowerCase();
  2335. if (ELEMENTS_KEY_ALLOWED_IN.indexOf(tagName) === -1) {
  2336. evt.preventDefault();
  2337. }
  2338. }
  2339. /**
  2340. * Focuses the next element on the list.
  2341. * @param {number} index
  2342. */
  2343. }, {
  2344. key: 'focusNextElement',
  2345. value: function focusNextElement(index) {
  2346. var count = this.adapter_.getListItemCount();
  2347. var nextIndex = index + 1;
  2348. if (nextIndex >= count) {
  2349. if (this.wrapFocus_) {
  2350. nextIndex = 0;
  2351. } else {
  2352. // Return early because last item is already focused.
  2353. return;
  2354. }
  2355. }
  2356. this.adapter_.focusItemAtIndex(nextIndex);
  2357. }
  2358. /**
  2359. * Focuses the previous element on the list.
  2360. * @param {number} index
  2361. */
  2362. }, {
  2363. key: 'focusPrevElement',
  2364. value: function focusPrevElement(index) {
  2365. var prevIndex = index - 1;
  2366. if (prevIndex < 0) {
  2367. if (this.wrapFocus_) {
  2368. prevIndex = this.adapter_.getListItemCount() - 1;
  2369. } else {
  2370. // Return early because first item is already focused.
  2371. return;
  2372. }
  2373. }
  2374. this.adapter_.focusItemAtIndex(prevIndex);
  2375. }
  2376. }, {
  2377. key: 'focusFirstElement',
  2378. value: function focusFirstElement() {
  2379. if (this.adapter_.getListItemCount() > 0) {
  2380. this.adapter_.focusItemAtIndex(0);
  2381. }
  2382. }
  2383. }, {
  2384. key: 'focusLastElement',
  2385. value: function focusLastElement() {
  2386. var lastIndex = this.adapter_.getListItemCount() - 1;
  2387. if (lastIndex >= 0) {
  2388. this.adapter_.focusItemAtIndex(lastIndex);
  2389. }
  2390. }
  2391. }]);
  2392. return MDCListFoundation;
  2393. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  2394. /* harmony default export */ __webpack_exports__["a"] = (MDCListFoundation);
  2395. /***/ }),
  2396. /* 17 */
  2397. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2398. "use strict";
  2399. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  2400. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCFloatingLabel", function() { return MDCFloatingLabel; });
  2401. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  2402. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(41);
  2403. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(87);
  2404. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCFloatingLabelFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  2405. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  2406. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2407. 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; }
  2408. 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; }
  2409. /**
  2410. * @license
  2411. * Copyright 2016 Google Inc.
  2412. *
  2413. * Permission is hereby granted, free of charge, to any person obtaining a copy
  2414. * of this software and associated documentation files (the "Software"), to deal
  2415. * in the Software without restriction, including without limitation the rights
  2416. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  2417. * copies of the Software, and to permit persons to whom the Software is
  2418. * furnished to do so, subject to the following conditions:
  2419. *
  2420. * The above copyright notice and this permission notice shall be included in
  2421. * all copies or substantial portions of the Software.
  2422. *
  2423. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  2424. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  2425. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  2426. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  2427. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  2428. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  2429. * THE SOFTWARE.
  2430. */
  2431. /**
  2432. * @extends {MDCComponent<!MDCFloatingLabelFoundation>}
  2433. * @final
  2434. */
  2435. var MDCFloatingLabel = function (_MDCComponent) {
  2436. _inherits(MDCFloatingLabel, _MDCComponent);
  2437. function MDCFloatingLabel() {
  2438. _classCallCheck(this, MDCFloatingLabel);
  2439. return _possibleConstructorReturn(this, (MDCFloatingLabel.__proto__ || Object.getPrototypeOf(MDCFloatingLabel)).apply(this, arguments));
  2440. }
  2441. _createClass(MDCFloatingLabel, [{
  2442. key: 'shake',
  2443. /**
  2444. * Styles the label to produce the label shake for errors.
  2445. * @param {boolean} shouldShake styles the label to shake by adding shake class
  2446. * if true, otherwise will stop shaking by removing shake class.
  2447. */
  2448. value: function shake(shouldShake) {
  2449. this.foundation_.shake(shouldShake);
  2450. }
  2451. /**
  2452. * Styles label to float/dock.
  2453. * @param {boolean} shouldFloat styles the label to float by adding float class
  2454. * if true, otherwise docks the label by removing the float class.
  2455. */
  2456. }, {
  2457. key: 'float',
  2458. value: function float(shouldFloat) {
  2459. this.foundation_.float(shouldFloat);
  2460. }
  2461. /**
  2462. * @return {number}
  2463. */
  2464. }, {
  2465. key: 'getWidth',
  2466. value: function getWidth() {
  2467. return this.foundation_.getWidth();
  2468. }
  2469. /**
  2470. * @return {!MDCFloatingLabelFoundation}
  2471. */
  2472. }, {
  2473. key: 'getDefaultFoundation',
  2474. value: function getDefaultFoundation() {
  2475. var _this2 = this;
  2476. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]({
  2477. addClass: function addClass(className) {
  2478. return _this2.root_.classList.add(className);
  2479. },
  2480. removeClass: function removeClass(className) {
  2481. return _this2.root_.classList.remove(className);
  2482. },
  2483. getWidth: function getWidth() {
  2484. return _this2.root_.offsetWidth;
  2485. },
  2486. registerInteractionHandler: function registerInteractionHandler(evtType, handler) {
  2487. return _this2.root_.addEventListener(evtType, handler);
  2488. },
  2489. deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) {
  2490. return _this2.root_.removeEventListener(evtType, handler);
  2491. }
  2492. });
  2493. }
  2494. }], [{
  2495. key: 'attachTo',
  2496. /**
  2497. * @param {!Element} root
  2498. * @return {!MDCFloatingLabel}
  2499. */
  2500. value: function attachTo(root) {
  2501. return new MDCFloatingLabel(root);
  2502. }
  2503. }]);
  2504. return MDCFloatingLabel;
  2505. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  2506. /***/ }),
  2507. /* 18 */
  2508. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2509. "use strict";
  2510. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  2511. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCLineRipple", function() { return MDCLineRipple; });
  2512. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  2513. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(42);
  2514. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(107);
  2515. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCLineRippleFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  2516. 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; };
  2517. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  2518. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2519. 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; }
  2520. 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; }
  2521. /**
  2522. * @license
  2523. * Copyright 2018 Google Inc.
  2524. *
  2525. * Permission is hereby granted, free of charge, to any person obtaining a copy
  2526. * of this software and associated documentation files (the "Software"), to deal
  2527. * in the Software without restriction, including without limitation the rights
  2528. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  2529. * copies of the Software, and to permit persons to whom the Software is
  2530. * furnished to do so, subject to the following conditions:
  2531. *
  2532. * The above copyright notice and this permission notice shall be included in
  2533. * all copies or substantial portions of the Software.
  2534. *
  2535. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  2536. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  2537. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  2538. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  2539. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  2540. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  2541. * THE SOFTWARE.
  2542. */
  2543. /**
  2544. * @extends {MDCComponent<!MDCLineRippleFoundation>}
  2545. * @final
  2546. */
  2547. var MDCLineRipple = function (_MDCComponent) {
  2548. _inherits(MDCLineRipple, _MDCComponent);
  2549. function MDCLineRipple() {
  2550. _classCallCheck(this, MDCLineRipple);
  2551. return _possibleConstructorReturn(this, (MDCLineRipple.__proto__ || Object.getPrototypeOf(MDCLineRipple)).apply(this, arguments));
  2552. }
  2553. _createClass(MDCLineRipple, [{
  2554. key: 'activate',
  2555. /**
  2556. * Activates the line ripple
  2557. */
  2558. value: function activate() {
  2559. this.foundation_.activate();
  2560. }
  2561. /**
  2562. * Deactivates the line ripple
  2563. */
  2564. }, {
  2565. key: 'deactivate',
  2566. value: function deactivate() {
  2567. this.foundation_.deactivate();
  2568. }
  2569. /**
  2570. * Sets the transform origin given a user's click location. The `rippleCenter` is the
  2571. * x-coordinate of the middle of the ripple.
  2572. * @param {number} xCoordinate
  2573. */
  2574. }, {
  2575. key: 'setRippleCenter',
  2576. value: function setRippleCenter(xCoordinate) {
  2577. this.foundation_.setRippleCenter(xCoordinate);
  2578. }
  2579. /**
  2580. * @return {!MDCLineRippleFoundation}
  2581. */
  2582. }, {
  2583. key: 'getDefaultFoundation',
  2584. value: function getDefaultFoundation() {
  2585. var _this2 = this;
  2586. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]( /** @type {!MDCLineRippleAdapter} */_extends({
  2587. addClass: function addClass(className) {
  2588. return _this2.root_.classList.add(className);
  2589. },
  2590. removeClass: function removeClass(className) {
  2591. return _this2.root_.classList.remove(className);
  2592. },
  2593. hasClass: function hasClass(className) {
  2594. return _this2.root_.classList.contains(className);
  2595. },
  2596. setStyle: function setStyle(propertyName, value) {
  2597. return _this2.root_.style[propertyName] = value;
  2598. },
  2599. registerEventHandler: function registerEventHandler(evtType, handler) {
  2600. return _this2.root_.addEventListener(evtType, handler);
  2601. },
  2602. deregisterEventHandler: function deregisterEventHandler(evtType, handler) {
  2603. return _this2.root_.removeEventListener(evtType, handler);
  2604. }
  2605. }));
  2606. }
  2607. }], [{
  2608. key: 'attachTo',
  2609. /**
  2610. * @param {!Element} root
  2611. * @return {!MDCLineRipple}
  2612. */
  2613. value: function attachTo(root) {
  2614. return new MDCLineRipple(root);
  2615. }
  2616. }]);
  2617. return MDCLineRipple;
  2618. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  2619. /***/ }),
  2620. /* 19 */
  2621. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2622. "use strict";
  2623. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  2624. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  2625. /**
  2626. * @license
  2627. * Copyright 2018 Google Inc.
  2628. *
  2629. * Permission is hereby granted, free of charge, to any person obtaining a copy
  2630. * of this software and associated documentation files (the "Software"), to deal
  2631. * in the Software without restriction, including without limitation the rights
  2632. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  2633. * copies of the Software, and to permit persons to whom the Software is
  2634. * furnished to do so, subject to the following conditions:
  2635. *
  2636. * The above copyright notice and this permission notice shall be included in
  2637. * all copies or substantial portions of the Software.
  2638. *
  2639. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  2640. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  2641. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  2642. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  2643. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  2644. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  2645. * THE SOFTWARE.
  2646. */
  2647. /** @enum {string} */
  2648. var cssClasses = {
  2649. ROOT: 'mdc-menu',
  2650. MENU_SELECTED_LIST_ITEM: 'mdc-menu-item--selected',
  2651. MENU_SELECTION_GROUP: 'mdc-menu__selection-group'
  2652. };
  2653. /** @enum {string} */
  2654. var strings = {
  2655. SELECTED_EVENT: 'MDCMenu:selected',
  2656. ARIA_SELECTED_ATTR: 'aria-selected',
  2657. LIST_SELECTOR: '.mdc-list',
  2658. CHECKBOX_SELECTOR: 'input[type="checkbox"]'
  2659. };
  2660. /***/ }),
  2661. /* 20 */
  2662. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2663. "use strict";
  2664. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return MDCMenuSurfaceFoundation; });
  2665. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AnchorMargin; });
  2666. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  2667. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(44);
  2668. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(21);
  2669. 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; };
  2670. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  2671. 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; }
  2672. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2673. 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; }
  2674. 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; }
  2675. /**
  2676. * @license
  2677. * Copyright 2018 Google Inc.
  2678. *
  2679. * Permission is hereby granted, free of charge, to any person obtaining a copy
  2680. * of this software and associated documentation files (the "Software"), to deal
  2681. * in the Software without restriction, including without limitation the rights
  2682. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  2683. * copies of the Software, and to permit persons to whom the Software is
  2684. * furnished to do so, subject to the following conditions:
  2685. *
  2686. * The above copyright notice and this permission notice shall be included in
  2687. * all copies or substantial portions of the Software.
  2688. *
  2689. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  2690. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  2691. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  2692. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  2693. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  2694. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  2695. * THE SOFTWARE.
  2696. */
  2697. /**
  2698. * @typedef {{
  2699. * top: number,
  2700. * right: number,
  2701. * bottom: number,
  2702. * left: number
  2703. * }}
  2704. */
  2705. var AnchorMargin = void 0;
  2706. /* eslint-disable no-unused-vars */
  2707. /**
  2708. * @typedef {{
  2709. * viewport: { width: number, height: number },
  2710. * viewportDistance: {top: number, right: number, bottom: number, left: number},
  2711. * anchorHeight: number,
  2712. * anchorWidth: number,
  2713. * surfaceHeight: number,
  2714. * surfaceWidth: number,
  2715. * bodyDimensions,
  2716. * windowScroll,
  2717. * }}
  2718. */
  2719. var AutoLayoutMeasurements = void 0;
  2720. /* eslint-enable no-unused-vars */
  2721. /**
  2722. * @extends {MDCFoundation<!MDCMenuSurfaceAdapter>}
  2723. */
  2724. var MDCMenuSurfaceFoundation = function (_MDCFoundation) {
  2725. _inherits(MDCMenuSurfaceFoundation, _MDCFoundation);
  2726. _createClass(MDCMenuSurfaceFoundation, null, [{
  2727. key: 'cssClasses',
  2728. /** @return enum{cssClasses} */
  2729. get: function get() {
  2730. return __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* cssClasses */];
  2731. }
  2732. /** @return enum{string} */
  2733. }, {
  2734. key: 'strings',
  2735. get: function get() {
  2736. return __WEBPACK_IMPORTED_MODULE_2__constants__["e" /* strings */];
  2737. }
  2738. /** @return enum {number} */
  2739. }, {
  2740. key: 'numbers',
  2741. get: function get() {
  2742. return __WEBPACK_IMPORTED_MODULE_2__constants__["d" /* numbers */];
  2743. }
  2744. /** @return enum{number} */
  2745. }, {
  2746. key: 'Corner',
  2747. get: function get() {
  2748. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* Corner */];
  2749. }
  2750. /**
  2751. * {@see MDCMenuSurfaceAdapter} for typing information on parameters and return
  2752. * types.
  2753. * @return {!MDCMenuSurfaceAdapter}
  2754. */
  2755. }, {
  2756. key: 'defaultAdapter',
  2757. get: function get() {
  2758. return (/** @type {!MDCMenuSurfaceAdapter} */{
  2759. addClass: function addClass() {},
  2760. removeClass: function removeClass() {},
  2761. hasClass: function hasClass() {
  2762. return false;
  2763. },
  2764. hasAnchor: function hasAnchor() {
  2765. return false;
  2766. },
  2767. notifyClose: function notifyClose() {},
  2768. notifyOpen: function notifyOpen() {},
  2769. isElementInContainer: function isElementInContainer() {
  2770. return false;
  2771. },
  2772. isRtl: function isRtl() {
  2773. return false;
  2774. },
  2775. setTransformOrigin: function setTransformOrigin() {},
  2776. isFocused: function isFocused() {
  2777. return false;
  2778. },
  2779. saveFocus: function saveFocus() {},
  2780. restoreFocus: function restoreFocus() {},
  2781. isFirstElementFocused: function isFirstElementFocused() {},
  2782. isLastElementFocused: function isLastElementFocused() {},
  2783. focusFirstElement: function focusFirstElement() {},
  2784. focusLastElement: function focusLastElement() {},
  2785. getInnerDimensions: function getInnerDimensions() {
  2786. return {};
  2787. },
  2788. getAnchorDimensions: function getAnchorDimensions() {
  2789. return {};
  2790. },
  2791. getWindowDimensions: function getWindowDimensions() {
  2792. return {};
  2793. },
  2794. getBodyDimensions: function getBodyDimensions() {
  2795. return {};
  2796. },
  2797. getWindowScroll: function getWindowScroll() {
  2798. return {};
  2799. },
  2800. setPosition: function setPosition() {},
  2801. setMaxHeight: function setMaxHeight() {}
  2802. }
  2803. );
  2804. }
  2805. /** @param {!MDCMenuSurfaceAdapter} adapter */
  2806. }]);
  2807. function MDCMenuSurfaceFoundation(adapter) {
  2808. _classCallCheck(this, MDCMenuSurfaceFoundation);
  2809. /** @private {boolean} */
  2810. var _this = _possibleConstructorReturn(this, (MDCMenuSurfaceFoundation.__proto__ || Object.getPrototypeOf(MDCMenuSurfaceFoundation)).call(this, _extends(MDCMenuSurfaceFoundation.defaultAdapter, adapter)));
  2811. _this.isOpen_ = false;
  2812. /** @private {number} */
  2813. _this.openAnimationEndTimerId_ = 0;
  2814. /** @private {number} */
  2815. _this.closeAnimationEndTimerId_ = 0;
  2816. /** @private {number} */
  2817. _this.animationRequestId_ = 0;
  2818. /** @private {!{ width: number, height: number }} */
  2819. _this.dimensions_;
  2820. /** @private {!Corner} */
  2821. _this.anchorCorner_ = __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* Corner */].TOP_START;
  2822. /** @private {!AnchorMargin} */
  2823. _this.anchorMargin_ = { top: 0, right: 0, bottom: 0, left: 0 };
  2824. /** @private {?AutoLayoutMeasurements} */
  2825. _this.measures_ = null;
  2826. /** @private {boolean} */
  2827. _this.quickOpen_ = false;
  2828. /** @private {boolean} */
  2829. _this.hoistedElement_ = false;
  2830. /** @private {boolean} */
  2831. _this.isFixedPosition_ = false;
  2832. /** @private {!{x: number, y: number}} */
  2833. _this.position_ = { x: 0, y: 0 };
  2834. return _this;
  2835. }
  2836. _createClass(MDCMenuSurfaceFoundation, [{
  2837. key: 'init',
  2838. value: function init() {
  2839. var _MDCMenuSurfaceFounda = MDCMenuSurfaceFoundation.cssClasses,
  2840. ROOT = _MDCMenuSurfaceFounda.ROOT,
  2841. OPEN = _MDCMenuSurfaceFounda.OPEN;
  2842. if (!this.adapter_.hasClass(ROOT)) {
  2843. throw new Error(ROOT + ' class required in root element.');
  2844. }
  2845. if (this.adapter_.hasClass(OPEN)) {
  2846. this.isOpen_ = true;
  2847. }
  2848. }
  2849. }, {
  2850. key: 'destroy',
  2851. value: function destroy() {
  2852. clearTimeout(this.openAnimationEndTimerId_);
  2853. clearTimeout(this.closeAnimationEndTimerId_);
  2854. // Cancel any currently running animations.
  2855. cancelAnimationFrame(this.animationRequestId_);
  2856. }
  2857. /**
  2858. * @param {!Corner} corner Default anchor corner alignment of top-left menu surface corner.
  2859. */
  2860. }, {
  2861. key: 'setAnchorCorner',
  2862. value: function setAnchorCorner(corner) {
  2863. this.anchorCorner_ = corner;
  2864. }
  2865. /**
  2866. * @param {!AnchorMargin} margin set of margin values from anchor.
  2867. */
  2868. }, {
  2869. key: 'setAnchorMargin',
  2870. value: function setAnchorMargin(margin) {
  2871. this.anchorMargin_.top = typeof margin.top === 'number' ? margin.top : 0;
  2872. this.anchorMargin_.right = typeof margin.right === 'number' ? margin.right : 0;
  2873. this.anchorMargin_.bottom = typeof margin.bottom === 'number' ? margin.bottom : 0;
  2874. this.anchorMargin_.left = typeof margin.left === 'number' ? margin.left : 0;
  2875. }
  2876. /**
  2877. * Used to indicate if the menu-surface is hoisted to the body.
  2878. * @param {boolean} isHoisted
  2879. */
  2880. }, {
  2881. key: 'setIsHoisted',
  2882. value: function setIsHoisted(isHoisted) {
  2883. this.hoistedElement_ = isHoisted;
  2884. }
  2885. /**
  2886. * Used to set the menu-surface calculations based on a fixed position menu.
  2887. * @param {boolean} isFixedPosition
  2888. */
  2889. }, {
  2890. key: 'setFixedPosition',
  2891. value: function setFixedPosition(isFixedPosition) {
  2892. this.isFixedPosition_ = isFixedPosition;
  2893. }
  2894. /**
  2895. * Sets the menu-surface position on the page.
  2896. * @param {number} x
  2897. * @param {number} y
  2898. */
  2899. }, {
  2900. key: 'setAbsolutePosition',
  2901. value: function setAbsolutePosition(x, y) {
  2902. this.position_.x = this.typeCheckisFinite_(x) ? x : 0;
  2903. this.position_.y = this.typeCheckisFinite_(y) ? y : 0;
  2904. }
  2905. /** @param {boolean} quickOpen */
  2906. }, {
  2907. key: 'setQuickOpen',
  2908. value: function setQuickOpen(quickOpen) {
  2909. this.quickOpen_ = quickOpen;
  2910. }
  2911. /**
  2912. * Handle clicks and close if not within menu-surface element.
  2913. * @param {!Event} evt
  2914. */
  2915. }, {
  2916. key: 'handleBodyClick',
  2917. value: function handleBodyClick(evt) {
  2918. var el = evt.target;
  2919. if (this.adapter_.isElementInContainer(el)) {
  2920. return;
  2921. }
  2922. this.close();
  2923. }
  2924. }, {
  2925. key: 'handleKeydown',
  2926. /**
  2927. * Handle keys that close the surface.
  2928. * @param {!Event} evt
  2929. */
  2930. value: function handleKeydown(evt) {
  2931. var keyCode = evt.keyCode,
  2932. key = evt.key,
  2933. shiftKey = evt.shiftKey;
  2934. var isEscape = key === 'Escape' || keyCode === 27;
  2935. var isTab = key === 'Tab' || keyCode === 9;
  2936. if (isEscape) {
  2937. this.close();
  2938. } else if (isTab) {
  2939. if (this.adapter_.isLastElementFocused() && !shiftKey) {
  2940. this.adapter_.focusFirstElement();
  2941. evt.preventDefault();
  2942. } else if (this.adapter_.isFirstElementFocused() && shiftKey) {
  2943. this.adapter_.focusLastElement();
  2944. evt.preventDefault();
  2945. }
  2946. }
  2947. }
  2948. /**
  2949. * @return {!AutoLayoutMeasurements} Measurements used to position menu surface popup.
  2950. */
  2951. }, {
  2952. key: 'getAutoLayoutMeasurements_',
  2953. value: function getAutoLayoutMeasurements_() {
  2954. var anchorRect = this.adapter_.getAnchorDimensions();
  2955. var viewport = this.adapter_.getWindowDimensions();
  2956. var bodyDimensions = this.adapter_.getBodyDimensions();
  2957. var windowScroll = this.adapter_.getWindowScroll();
  2958. if (!anchorRect) {
  2959. anchorRect = /** @type {ClientRect} */{
  2960. x: this.position_.x,
  2961. y: this.position_.y,
  2962. top: this.position_.y,
  2963. bottom: this.position_.y,
  2964. left: this.position_.x,
  2965. right: this.position_.x,
  2966. height: 0,
  2967. width: 0
  2968. };
  2969. }
  2970. return {
  2971. viewport: viewport,
  2972. bodyDimensions: bodyDimensions,
  2973. windowScroll: windowScroll,
  2974. viewportDistance: {
  2975. top: anchorRect.top,
  2976. right: viewport.width - anchorRect.right,
  2977. left: anchorRect.left,
  2978. bottom: viewport.height - anchorRect.bottom
  2979. },
  2980. anchorHeight: anchorRect.height,
  2981. anchorWidth: anchorRect.width,
  2982. surfaceHeight: this.dimensions_.height,
  2983. surfaceWidth: this.dimensions_.width
  2984. };
  2985. }
  2986. /**
  2987. * Computes the corner of the anchor from which to animate and position the menu surface.
  2988. * @return {!Corner}
  2989. * @private
  2990. */
  2991. }, {
  2992. key: 'getOriginCorner_',
  2993. value: function getOriginCorner_() {
  2994. // Defaults: open from the top left.
  2995. var corner = __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* Corner */].TOP_LEFT;
  2996. var _measures_ = this.measures_,
  2997. viewportDistance = _measures_.viewportDistance,
  2998. anchorHeight = _measures_.anchorHeight,
  2999. anchorWidth = _measures_.anchorWidth,
  3000. surfaceHeight = _measures_.surfaceHeight,
  3001. surfaceWidth = _measures_.surfaceWidth;
  3002. var isBottomAligned = Boolean(this.anchorCorner_ & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].BOTTOM);
  3003. var availableTop = isBottomAligned ? viewportDistance.top + anchorHeight + this.anchorMargin_.bottom : viewportDistance.top + this.anchorMargin_.top;
  3004. var availableBottom = isBottomAligned ? viewportDistance.bottom - this.anchorMargin_.bottom : viewportDistance.bottom + anchorHeight - this.anchorMargin_.top;
  3005. var topOverflow = surfaceHeight - availableTop;
  3006. var bottomOverflow = surfaceHeight - availableBottom;
  3007. if (bottomOverflow > 0 && topOverflow < bottomOverflow) {
  3008. corner |= __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].BOTTOM;
  3009. }
  3010. var isRtl = this.adapter_.isRtl();
  3011. var isFlipRtl = Boolean(this.anchorCorner_ & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].FLIP_RTL);
  3012. var avoidHorizontalOverlap = Boolean(this.anchorCorner_ & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].RIGHT);
  3013. var isAlignedRight = avoidHorizontalOverlap && !isRtl || !avoidHorizontalOverlap && isFlipRtl && isRtl;
  3014. var availableLeft = isAlignedRight ? viewportDistance.left + anchorWidth + this.anchorMargin_.right : viewportDistance.left + this.anchorMargin_.left;
  3015. var availableRight = isAlignedRight ? viewportDistance.right - this.anchorMargin_.right : viewportDistance.right + anchorWidth - this.anchorMargin_.left;
  3016. var leftOverflow = surfaceWidth - availableLeft;
  3017. var rightOverflow = surfaceWidth - availableRight;
  3018. if (leftOverflow < 0 && isAlignedRight && isRtl || avoidHorizontalOverlap && !isAlignedRight && leftOverflow < 0 || rightOverflow > 0 && leftOverflow < rightOverflow) {
  3019. corner |= __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].RIGHT;
  3020. }
  3021. return (/** @type {Corner} */corner
  3022. );
  3023. }
  3024. /**
  3025. * @param {!Corner} corner Origin corner of the menu surface.
  3026. * @return {number} Horizontal offset of menu surface origin corner from corresponding anchor corner.
  3027. * @private
  3028. */
  3029. }, {
  3030. key: 'getHorizontalOriginOffset_',
  3031. value: function getHorizontalOriginOffset_(corner) {
  3032. var anchorWidth = this.measures_.anchorWidth;
  3033. // isRightAligned corresponds to using the 'right' property on the surface.
  3034. var isRightAligned = Boolean(corner & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].RIGHT);
  3035. var avoidHorizontalOverlap = Boolean(this.anchorCorner_ & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].RIGHT);
  3036. if (isRightAligned) {
  3037. var rightOffset = avoidHorizontalOverlap ? anchorWidth - this.anchorMargin_.left : this.anchorMargin_.right;
  3038. // For hoisted or fixed elements, adjust the offset by the difference between viewport width and body width so
  3039. // when we calculate the right value (`adjustPositionForHoistedElement_`) based on the element position,
  3040. // the right property is correct.
  3041. if (this.hoistedElement_ || this.isFixedPosition_) {
  3042. return rightOffset - (this.measures_.viewport.width - this.measures_.bodyDimensions.width);
  3043. }
  3044. return rightOffset;
  3045. }
  3046. return avoidHorizontalOverlap ? anchorWidth - this.anchorMargin_.right : this.anchorMargin_.left;
  3047. }
  3048. /**
  3049. * @param {!Corner} corner Origin corner of the menu surface.
  3050. * @return {number} Vertical offset of menu surface origin corner from corresponding anchor corner.
  3051. * @private
  3052. */
  3053. }, {
  3054. key: 'getVerticalOriginOffset_',
  3055. value: function getVerticalOriginOffset_(corner) {
  3056. var anchorHeight = this.measures_.anchorHeight;
  3057. var isBottomAligned = Boolean(corner & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].BOTTOM);
  3058. var avoidVerticalOverlap = Boolean(this.anchorCorner_ & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].BOTTOM);
  3059. var y = 0;
  3060. if (isBottomAligned) {
  3061. y = avoidVerticalOverlap ? anchorHeight - this.anchorMargin_.top : -this.anchorMargin_.bottom;
  3062. } else {
  3063. y = avoidVerticalOverlap ? anchorHeight + this.anchorMargin_.bottom : this.anchorMargin_.top;
  3064. }
  3065. return y;
  3066. }
  3067. /**
  3068. * @param {!Corner} corner Origin corner of the menu surface.
  3069. * @return {number} Maximum height of the menu surface, based on available space. 0 indicates should not be set.
  3070. * @private
  3071. */
  3072. }, {
  3073. key: 'getMenuSurfaceMaxHeight_',
  3074. value: function getMenuSurfaceMaxHeight_(corner) {
  3075. var maxHeight = 0;
  3076. var viewportDistance = this.measures_.viewportDistance;
  3077. var isBottomAligned = Boolean(corner & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].BOTTOM);
  3078. var MARGIN_TO_EDGE = MDCMenuSurfaceFoundation.numbers.MARGIN_TO_EDGE;
  3079. // When maximum height is not specified, it is handled from css.
  3080. if (isBottomAligned) {
  3081. maxHeight = viewportDistance.top + this.anchorMargin_.top - MARGIN_TO_EDGE;
  3082. if (!(this.anchorCorner_ & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].BOTTOM)) {
  3083. maxHeight += this.measures_.anchorHeight;
  3084. }
  3085. } else {
  3086. maxHeight = viewportDistance.bottom - this.anchorMargin_.bottom + this.measures_.anchorHeight - MARGIN_TO_EDGE;
  3087. if (this.anchorCorner_ & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].BOTTOM) {
  3088. maxHeight -= this.measures_.anchorHeight;
  3089. }
  3090. }
  3091. return maxHeight;
  3092. }
  3093. /** @private */
  3094. }, {
  3095. key: 'autoPosition_',
  3096. value: function autoPosition_() {
  3097. var _position;
  3098. // Compute measurements for autoposition methods reuse.
  3099. this.measures_ = this.getAutoLayoutMeasurements_();
  3100. var corner = this.getOriginCorner_();
  3101. var maxMenuSurfaceHeight = this.getMenuSurfaceMaxHeight_(corner);
  3102. var verticalAlignment = corner & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].BOTTOM ? 'bottom' : 'top';
  3103. var horizontalAlignment = corner & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].RIGHT ? 'right' : 'left';
  3104. var horizontalOffset = this.getHorizontalOriginOffset_(corner);
  3105. var verticalOffset = this.getVerticalOriginOffset_(corner);
  3106. var position = (_position = {}, _defineProperty(_position, horizontalAlignment, horizontalOffset ? horizontalOffset : '0'), _defineProperty(_position, verticalAlignment, verticalOffset ? verticalOffset : '0'), _position);
  3107. var _measures_2 = this.measures_,
  3108. anchorWidth = _measures_2.anchorWidth,
  3109. surfaceWidth = _measures_2.surfaceWidth;
  3110. // Center align when anchor width is comparable or greater than menu surface, otherwise keep corner.
  3111. if (anchorWidth / surfaceWidth > __WEBPACK_IMPORTED_MODULE_2__constants__["d" /* numbers */].ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO) {
  3112. horizontalAlignment = 'center';
  3113. }
  3114. // If the menu-surface has been hoisted to the body, it's no longer relative to the anchor element
  3115. if (this.hoistedElement_ || this.isFixedPosition_) {
  3116. position = this.adjustPositionForHoistedElement_(position);
  3117. }
  3118. for (var prop in position) {
  3119. if (position.hasOwnProperty(prop) && position[prop] !== '0') {
  3120. position[prop] = parseInt(position[prop], 10) + 'px';
  3121. }
  3122. }
  3123. this.adapter_.setTransformOrigin(horizontalAlignment + ' ' + verticalAlignment);
  3124. this.adapter_.setPosition(position);
  3125. this.adapter_.setMaxHeight(maxMenuSurfaceHeight ? maxMenuSurfaceHeight + 'px' : '');
  3126. // Clear measures after positioning is complete.
  3127. this.measures_ = null;
  3128. }
  3129. /**
  3130. * Calculates the offsets for positioning the menu-surface when the menu-surface has been
  3131. * hoisted to the body.
  3132. * @param {!{
  3133. * top: (string|undefined),
  3134. * right: (string|undefined),
  3135. * bottom: (string|undefined),
  3136. * left: (string|undefined)
  3137. * }} position
  3138. * @return {!{
  3139. * top: (string|undefined),
  3140. * right: (string|undefined),
  3141. * bottom: (string|undefined),
  3142. * left: (string|undefined)
  3143. * }} position
  3144. * @private
  3145. */
  3146. }, {
  3147. key: 'adjustPositionForHoistedElement_',
  3148. value: function adjustPositionForHoistedElement_(position) {
  3149. var _measures_3 = this.measures_,
  3150. windowScroll = _measures_3.windowScroll,
  3151. viewportDistance = _measures_3.viewportDistance;
  3152. for (var prop in position) {
  3153. if (position.hasOwnProperty(prop)) {
  3154. // Hoisted surfaces need to have the anchor elements location on the page added to the
  3155. // position properties for proper alignment on the body.
  3156. if (viewportDistance.hasOwnProperty(prop)) {
  3157. position[prop] = parseInt(position[prop], 10) + viewportDistance[prop];
  3158. }
  3159. // Surfaces that are absolutely positioned need to have additional calculations for scroll
  3160. // and bottom positioning.
  3161. if (!this.isFixedPosition_) {
  3162. if (prop === 'top') {
  3163. position[prop] = parseInt(position[prop], 10) + windowScroll.y;
  3164. } else if (prop === 'bottom') {
  3165. position[prop] = parseInt(position[prop], 10) - windowScroll.y;
  3166. } else if (prop === 'left') {
  3167. position[prop] = parseInt(position[prop], 10) + windowScroll.x;
  3168. } else if (prop === 'right') {
  3169. position[prop] = parseInt(position[prop], 10) - windowScroll.x;
  3170. }
  3171. }
  3172. }
  3173. }
  3174. return position;
  3175. }
  3176. /**
  3177. * Open the menu surface.
  3178. */
  3179. }, {
  3180. key: 'open',
  3181. value: function open() {
  3182. var _this2 = this;
  3183. this.adapter_.saveFocus();
  3184. if (!this.quickOpen_) {
  3185. this.adapter_.addClass(MDCMenuSurfaceFoundation.cssClasses.ANIMATING_OPEN);
  3186. }
  3187. this.animationRequestId_ = requestAnimationFrame(function () {
  3188. _this2.adapter_.addClass(MDCMenuSurfaceFoundation.cssClasses.OPEN);
  3189. _this2.dimensions_ = _this2.adapter_.getInnerDimensions();
  3190. _this2.autoPosition_();
  3191. if (_this2.quickOpen_) {
  3192. _this2.adapter_.notifyOpen();
  3193. } else {
  3194. _this2.openAnimationEndTimerId_ = setTimeout(function () {
  3195. _this2.openAnimationEndTimerId_ = 0;
  3196. _this2.adapter_.removeClass(MDCMenuSurfaceFoundation.cssClasses.ANIMATING_OPEN);
  3197. _this2.adapter_.notifyOpen();
  3198. }, __WEBPACK_IMPORTED_MODULE_2__constants__["d" /* numbers */].TRANSITION_OPEN_DURATION);
  3199. }
  3200. });
  3201. this.isOpen_ = true;
  3202. }
  3203. /**
  3204. * Closes the menu surface.
  3205. */
  3206. }, {
  3207. key: 'close',
  3208. value: function close() {
  3209. var _this3 = this;
  3210. if (!this.quickOpen_) {
  3211. this.adapter_.addClass(MDCMenuSurfaceFoundation.cssClasses.ANIMATING_CLOSED);
  3212. }
  3213. requestAnimationFrame(function () {
  3214. _this3.adapter_.removeClass(MDCMenuSurfaceFoundation.cssClasses.OPEN);
  3215. if (_this3.quickOpen_) {
  3216. _this3.adapter_.notifyClose();
  3217. } else {
  3218. _this3.closeAnimationEndTimerId_ = setTimeout(function () {
  3219. _this3.closeAnimationEndTimerId_ = 0;
  3220. _this3.adapter_.removeClass(MDCMenuSurfaceFoundation.cssClasses.ANIMATING_CLOSED);
  3221. _this3.adapter_.notifyClose();
  3222. }, __WEBPACK_IMPORTED_MODULE_2__constants__["d" /* numbers */].TRANSITION_CLOSE_DURATION);
  3223. }
  3224. });
  3225. this.isOpen_ = false;
  3226. this.maybeRestoreFocus_();
  3227. }
  3228. /**
  3229. * The last focused element when the menu surface was opened should regain focus, if the user is
  3230. * focused on or within the menu surface when it is closed.
  3231. * @private
  3232. */
  3233. }, {
  3234. key: 'maybeRestoreFocus_',
  3235. value: function maybeRestoreFocus_() {
  3236. if (this.adapter_.isFocused() || this.adapter_.isElementInContainer(document.activeElement)) {
  3237. this.adapter_.restoreFocus();
  3238. }
  3239. }
  3240. /** @return {boolean} */
  3241. }, {
  3242. key: 'isOpen',
  3243. value: function isOpen() {
  3244. return this.isOpen_;
  3245. }
  3246. /**
  3247. * isFinite that doesn't force conversion to number type.
  3248. * Equivalent to Number.isFinite in ES2015, but is not included in IE11.
  3249. * @param {number} num
  3250. * @return {boolean}
  3251. * @private
  3252. */
  3253. }, {
  3254. key: 'typeCheckisFinite_',
  3255. value: function typeCheckisFinite_(num) {
  3256. return typeof num === 'number' && isFinite(num);
  3257. }
  3258. }]);
  3259. return MDCMenuSurfaceFoundation;
  3260. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  3261. /***/ }),
  3262. /* 21 */
  3263. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3264. "use strict";
  3265. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return cssClasses; });
  3266. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return strings; });
  3267. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return numbers; });
  3268. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return CornerBit; });
  3269. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Corner; });
  3270. /**
  3271. * @license
  3272. * Copyright 2018 Google Inc.
  3273. *
  3274. * Permission is hereby granted, free of charge, to any person obtaining a copy
  3275. * of this software and associated documentation files (the "Software"), to deal
  3276. * in the Software without restriction, including without limitation the rights
  3277. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  3278. * copies of the Software, and to permit persons to whom the Software is
  3279. * furnished to do so, subject to the following conditions:
  3280. *
  3281. * The above copyright notice and this permission notice shall be included in
  3282. * all copies or substantial portions of the Software.
  3283. *
  3284. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  3285. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  3286. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  3287. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  3288. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  3289. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  3290. * THE SOFTWARE.
  3291. */
  3292. /** @enum {string} */
  3293. var cssClasses = {
  3294. ANCHOR: 'mdc-menu-surface--anchor',
  3295. ANIMATING_CLOSED: 'mdc-menu-surface--animating-closed',
  3296. ANIMATING_OPEN: 'mdc-menu-surface--animating-open',
  3297. FIXED: 'mdc-menu-surface--fixed',
  3298. OPEN: 'mdc-menu-surface--open',
  3299. ROOT: 'mdc-menu-surface'
  3300. };
  3301. /** @enum {string} */
  3302. var strings = {
  3303. CLOSED_EVENT: 'MDCMenuSurface:closed',
  3304. OPENED_EVENT: 'MDCMenuSurface:opened',
  3305. 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"])'
  3306. };
  3307. /** @enum {number} */
  3308. var numbers = {
  3309. // Total duration of menu-surface open animation.
  3310. TRANSITION_OPEN_DURATION: 120,
  3311. // Total duration of menu-surface close animation.
  3312. TRANSITION_CLOSE_DURATION: 75,
  3313. // Margin left to the edge of the viewport when menu-surface is at maximum possible height.
  3314. MARGIN_TO_EDGE: 32,
  3315. // Ratio of anchor width to menu-surface width for switching from corner positioning to center positioning.
  3316. ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO: 0.67
  3317. };
  3318. /**
  3319. * Enum for bits in the {@see Corner) bitmap.
  3320. * @enum {number}
  3321. */
  3322. var CornerBit = {
  3323. BOTTOM: 1,
  3324. CENTER: 2,
  3325. RIGHT: 4,
  3326. FLIP_RTL: 8
  3327. };
  3328. /**
  3329. * Enum for representing an element corner for positioning the menu-surface.
  3330. *
  3331. * The START constants map to LEFT if element directionality is left
  3332. * to right and RIGHT if the directionality is right to left.
  3333. * Likewise END maps to RIGHT or LEFT depending on the directionality.
  3334. *
  3335. * @enum {number}
  3336. */
  3337. var Corner = {
  3338. TOP_LEFT: 0,
  3339. TOP_RIGHT: CornerBit.RIGHT,
  3340. BOTTOM_LEFT: CornerBit.BOTTOM,
  3341. BOTTOM_RIGHT: CornerBit.BOTTOM | CornerBit.RIGHT,
  3342. TOP_START: CornerBit.FLIP_RTL,
  3343. TOP_END: CornerBit.FLIP_RTL | CornerBit.RIGHT,
  3344. BOTTOM_START: CornerBit.BOTTOM | CornerBit.FLIP_RTL,
  3345. BOTTOM_END: CornerBit.BOTTOM | CornerBit.RIGHT | CornerBit.FLIP_RTL
  3346. };
  3347. /***/ }),
  3348. /* 22 */
  3349. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3350. "use strict";
  3351. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  3352. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCNotchedOutline", function() { return MDCNotchedOutline; });
  3353. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  3354. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(46);
  3355. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(112);
  3356. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__constants__ = __webpack_require__(47);
  3357. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCNotchedOutlineFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  3358. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  3359. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3360. 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; }
  3361. 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; }
  3362. /**
  3363. * @license
  3364. * Copyright 2017 Google Inc.
  3365. *
  3366. * Permission is hereby granted, free of charge, to any person obtaining a copy
  3367. * of this software and associated documentation files (the "Software"), to deal
  3368. * in the Software without restriction, including without limitation the rights
  3369. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  3370. * copies of the Software, and to permit persons to whom the Software is
  3371. * furnished to do so, subject to the following conditions:
  3372. *
  3373. * The above copyright notice and this permission notice shall be included in
  3374. * all copies or substantial portions of the Software.
  3375. *
  3376. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  3377. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  3378. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  3379. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  3380. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  3381. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  3382. * THE SOFTWARE.
  3383. */
  3384. /**
  3385. * @extends {MDCComponent<!MDCNotchedOutlineFoundation>}
  3386. * @final
  3387. */
  3388. var MDCNotchedOutline = function (_MDCComponent) {
  3389. _inherits(MDCNotchedOutline, _MDCComponent);
  3390. function MDCNotchedOutline() {
  3391. _classCallCheck(this, MDCNotchedOutline);
  3392. return _possibleConstructorReturn(this, (MDCNotchedOutline.__proto__ || Object.getPrototypeOf(MDCNotchedOutline)).apply(this, arguments));
  3393. }
  3394. _createClass(MDCNotchedOutline, [{
  3395. key: 'notch',
  3396. /**
  3397. * Updates outline selectors and SVG path to open notch.
  3398. * @param {number} notchWidth The notch width in the outline.
  3399. * @param {boolean=} isRtl Determines if outline is rtl. If rtl is true, notch
  3400. * will be right justified in outline path, otherwise left justified.
  3401. */
  3402. value: function notch(notchWidth, isRtl) {
  3403. this.foundation_.notch(notchWidth, isRtl);
  3404. }
  3405. /**
  3406. * Updates the outline selectors to close notch and return it to idle state.
  3407. */
  3408. }, {
  3409. key: 'closeNotch',
  3410. value: function closeNotch() {
  3411. this.foundation_.closeNotch();
  3412. }
  3413. /**
  3414. * @return {!MDCNotchedOutlineFoundation}
  3415. */
  3416. }, {
  3417. key: 'getDefaultFoundation',
  3418. value: function getDefaultFoundation() {
  3419. var _this2 = this;
  3420. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]({
  3421. getWidth: function getWidth() {
  3422. return _this2.root_.offsetWidth;
  3423. },
  3424. getHeight: function getHeight() {
  3425. return _this2.root_.offsetHeight;
  3426. },
  3427. addClass: function addClass(className) {
  3428. return _this2.root_.classList.add(className);
  3429. },
  3430. removeClass: function removeClass(className) {
  3431. return _this2.root_.classList.remove(className);
  3432. },
  3433. setOutlinePathAttr: function setOutlinePathAttr(value) {
  3434. var path = _this2.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].PATH_SELECTOR);
  3435. path.setAttribute('d', value);
  3436. },
  3437. getIdleOutlineStyleValue: function getIdleOutlineStyleValue(propertyName) {
  3438. var idleOutlineElement = _this2.root_.parentNode.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].IDLE_OUTLINE_SELECTOR);
  3439. return window.getComputedStyle(idleOutlineElement).getPropertyValue(propertyName);
  3440. }
  3441. });
  3442. }
  3443. }], [{
  3444. key: 'attachTo',
  3445. /**
  3446. * @param {!Element} root
  3447. * @return {!MDCNotchedOutline}
  3448. */
  3449. value: function attachTo(root) {
  3450. return new MDCNotchedOutline(root);
  3451. }
  3452. }]);
  3453. return MDCNotchedOutline;
  3454. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  3455. /***/ }),
  3456. /* 23 */
  3457. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3458. "use strict";
  3459. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCSelectIcon; });
  3460. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  3461. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(49);
  3462. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(119);
  3463. /* unused harmony reexport MDCSelectIconFoundation */
  3464. 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; };
  3465. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  3466. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3467. 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; }
  3468. 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; }
  3469. /**
  3470. * @license
  3471. * Copyright 2018 Google Inc.
  3472. *
  3473. * Permission is hereby granted, free of charge, to any person obtaining a copy
  3474. * of this software and associated documentation files (the "Software"), to deal
  3475. * in the Software without restriction, including without limitation the rights
  3476. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  3477. * copies of the Software, and to permit persons to whom the Software is
  3478. * furnished to do so, subject to the following conditions:
  3479. *
  3480. * The above copyright notice and this permission notice shall be included in
  3481. * all copies or substantial portions of the Software.
  3482. *
  3483. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  3484. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  3485. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  3486. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  3487. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  3488. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  3489. * THE SOFTWARE.
  3490. */
  3491. /**
  3492. * @extends {MDCComponent<!MDCSelectIconFoundation>}
  3493. * @final
  3494. */
  3495. var MDCSelectIcon = function (_MDCComponent) {
  3496. _inherits(MDCSelectIcon, _MDCComponent);
  3497. function MDCSelectIcon() {
  3498. _classCallCheck(this, MDCSelectIcon);
  3499. return _possibleConstructorReturn(this, (MDCSelectIcon.__proto__ || Object.getPrototypeOf(MDCSelectIcon)).apply(this, arguments));
  3500. }
  3501. _createClass(MDCSelectIcon, [{
  3502. key: 'getDefaultFoundation',
  3503. /**
  3504. * @return {!MDCSelectIconFoundation}
  3505. */
  3506. value: function getDefaultFoundation() {
  3507. var _this2 = this;
  3508. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]( /** @type {!MDCSelectIconAdapter} */_extends({
  3509. getAttr: function getAttr(attr) {
  3510. return _this2.root_.getAttribute(attr);
  3511. },
  3512. setAttr: function setAttr(attr, value) {
  3513. return _this2.root_.setAttribute(attr, value);
  3514. },
  3515. removeAttr: function removeAttr(attr) {
  3516. return _this2.root_.removeAttribute(attr);
  3517. },
  3518. setContent: function setContent(content) {
  3519. _this2.root_.textContent = content;
  3520. },
  3521. registerInteractionHandler: function registerInteractionHandler(evtType, handler) {
  3522. return _this2.root_.addEventListener(evtType, handler);
  3523. },
  3524. deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) {
  3525. return _this2.root_.removeEventListener(evtType, handler);
  3526. },
  3527. notifyIconAction: function notifyIconAction() {
  3528. return _this2.emit(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.ICON_EVENT, {} /* evtData */, true /* shouldBubble */);
  3529. }
  3530. }));
  3531. }
  3532. }, {
  3533. key: 'foundation',
  3534. /**
  3535. * @return {!MDCSelectIconFoundation}
  3536. */
  3537. get: function get() {
  3538. return this.foundation_;
  3539. }
  3540. }], [{
  3541. key: 'attachTo',
  3542. /**
  3543. * @param {!Element} root
  3544. * @return {!MDCSelectIcon}
  3545. */
  3546. value: function attachTo(root) {
  3547. return new MDCSelectIcon(root);
  3548. }
  3549. }]);
  3550. return MDCSelectIcon;
  3551. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  3552. /***/ }),
  3553. /* 24 */
  3554. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3555. "use strict";
  3556. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCSelectHelperText; });
  3557. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  3558. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(50);
  3559. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(121);
  3560. /* unused harmony reexport MDCSelectHelperTextFoundation */
  3561. 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; };
  3562. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  3563. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3564. 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; }
  3565. 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; }
  3566. /**
  3567. * @license
  3568. * Copyright 2018 Google Inc.
  3569. *
  3570. * Permission is hereby granted, free of charge, to any person obtaining a copy
  3571. * of this software and associated documentation files (the "Software"), to deal
  3572. * in the Software without restriction, including without limitation the rights
  3573. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  3574. * copies of the Software, and to permit persons to whom the Software is
  3575. * furnished to do so, subject to the following conditions:
  3576. *
  3577. * The above copyright notice and this permission notice shall be included in
  3578. * all copies or substantial portions of the Software.
  3579. *
  3580. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  3581. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  3582. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  3583. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  3584. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  3585. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  3586. * THE SOFTWARE.
  3587. */
  3588. /**
  3589. * @extends {MDCComponent<!MDCSelectHelperTextFoundation>}
  3590. * @final
  3591. */
  3592. var MDCSelectHelperText = function (_MDCComponent) {
  3593. _inherits(MDCSelectHelperText, _MDCComponent);
  3594. function MDCSelectHelperText() {
  3595. _classCallCheck(this, MDCSelectHelperText);
  3596. return _possibleConstructorReturn(this, (MDCSelectHelperText.__proto__ || Object.getPrototypeOf(MDCSelectHelperText)).apply(this, arguments));
  3597. }
  3598. _createClass(MDCSelectHelperText, [{
  3599. key: 'getDefaultFoundation',
  3600. /**
  3601. * @return {!MDCSelectHelperTextFoundation}
  3602. */
  3603. value: function getDefaultFoundation() {
  3604. var _this2 = this;
  3605. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]( /** @type {!MDCSelectHelperTextAdapter} */_extends({
  3606. addClass: function addClass(className) {
  3607. return _this2.root_.classList.add(className);
  3608. },
  3609. removeClass: function removeClass(className) {
  3610. return _this2.root_.classList.remove(className);
  3611. },
  3612. hasClass: function hasClass(className) {
  3613. return _this2.root_.classList.contains(className);
  3614. },
  3615. setAttr: function setAttr(attr, value) {
  3616. return _this2.root_.setAttribute(attr, value);
  3617. },
  3618. removeAttr: function removeAttr(attr) {
  3619. return _this2.root_.removeAttribute(attr);
  3620. },
  3621. setContent: function setContent(content) {
  3622. _this2.root_.textContent = content;
  3623. }
  3624. }));
  3625. }
  3626. }, {
  3627. key: 'foundation',
  3628. /**
  3629. * @return {!MDCSelectHelperTextFoundation}
  3630. */
  3631. get: function get() {
  3632. return this.foundation_;
  3633. }
  3634. }], [{
  3635. key: 'attachTo',
  3636. /**
  3637. * @param {!Element} root
  3638. * @return {!MDCSelectHelperText}
  3639. */
  3640. value: function attachTo(root) {
  3641. return new MDCSelectHelperText(root);
  3642. }
  3643. }]);
  3644. return MDCSelectHelperText;
  3645. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  3646. /***/ }),
  3647. /* 25 */
  3648. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3649. "use strict";
  3650. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  3651. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTab", function() { return MDCTab; });
  3652. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  3653. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__ = __webpack_require__(2);
  3654. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_tab_indicator_index__ = __webpack_require__(54);
  3655. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__adapter__ = __webpack_require__(10);
  3656. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation__ = __webpack_require__(135);
  3657. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTabFoundation", function() { return __WEBPACK_IMPORTED_MODULE_4__foundation__["a"]; });
  3658. 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; };
  3659. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  3660. 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); } };
  3661. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3662. 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; }
  3663. 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; }
  3664. /**
  3665. * @license
  3666. * Copyright 2018 Google Inc.
  3667. *
  3668. * Permission is hereby granted, free of charge, to any person obtaining a copy
  3669. * of this software and associated documentation files (the "Software"), to deal
  3670. * in the Software without restriction, including without limitation the rights
  3671. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  3672. * copies of the Software, and to permit persons to whom the Software is
  3673. * furnished to do so, subject to the following conditions:
  3674. *
  3675. * The above copyright notice and this permission notice shall be included in
  3676. * all copies or substantial portions of the Software.
  3677. *
  3678. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  3679. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  3680. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  3681. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  3682. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  3683. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  3684. * THE SOFTWARE.
  3685. */
  3686. /* eslint-disable no-unused-vars */
  3687. /* eslint-enable no-unused-vars */
  3688. /**
  3689. * @extends {MDCComponent<!MDCTabFoundation>}
  3690. * @final
  3691. */
  3692. var MDCTab = function (_MDCComponent) {
  3693. _inherits(MDCTab, _MDCComponent);
  3694. /**
  3695. * @param {...?} args
  3696. */
  3697. function MDCTab() {
  3698. var _ref;
  3699. _classCallCheck(this, MDCTab);
  3700. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  3701. args[_key] = arguments[_key];
  3702. }
  3703. /** @private {?MDCRipple} */
  3704. var _this = _possibleConstructorReturn(this, (_ref = MDCTab.__proto__ || Object.getPrototypeOf(MDCTab)).call.apply(_ref, [this].concat(args)));
  3705. _this.ripple_;
  3706. /** @private {?MDCTabIndicator} */
  3707. _this.tabIndicator_;
  3708. /** @private {?Element} */
  3709. _this.content_;
  3710. /** @private {?Function} */
  3711. _this.handleClick_;
  3712. return _this;
  3713. }
  3714. /**
  3715. * @param {!Element} root
  3716. * @return {!MDCTab}
  3717. */
  3718. _createClass(MDCTab, [{
  3719. key: 'initialize',
  3720. value: function initialize() {
  3721. var rippleFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (el, foundation) {
  3722. return new __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRipple"](el, foundation);
  3723. };
  3724. var tabIndicatorFactory = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (el) {
  3725. return new __WEBPACK_IMPORTED_MODULE_2__material_tab_indicator_index__["MDCTabIndicator"](el);
  3726. };
  3727. var rippleSurface = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* default */].strings.RIPPLE_SELECTOR);
  3728. var rippleAdapter = _extends(__WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRipple"].createAdapter( /** @type {!RippleCapableSurface} */this), {
  3729. addClass: function addClass(className) {
  3730. return rippleSurface.classList.add(className);
  3731. },
  3732. removeClass: function removeClass(className) {
  3733. return rippleSurface.classList.remove(className);
  3734. },
  3735. updateCssVariable: function updateCssVariable(varName, value) {
  3736. return rippleSurface.style.setProperty(varName, value);
  3737. }
  3738. });
  3739. var rippleFoundation = new __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRippleFoundation"](rippleAdapter);
  3740. this.ripple_ = rippleFactory(this.root_, rippleFoundation);
  3741. var tabIndicatorElement = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* default */].strings.TAB_INDICATOR_SELECTOR);
  3742. this.tabIndicator_ = tabIndicatorFactory(tabIndicatorElement);
  3743. this.content_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* default */].strings.CONTENT_SELECTOR);
  3744. }
  3745. }, {
  3746. key: 'initialSyncWithDOM',
  3747. value: function initialSyncWithDOM() {
  3748. this.handleClick_ = this.foundation_.handleClick.bind(this.foundation_);
  3749. this.listen('click', this.handleClick_);
  3750. }
  3751. }, {
  3752. key: 'destroy',
  3753. value: function destroy() {
  3754. this.unlisten('click', /** @type {!Function} */this.handleClick_);
  3755. this.ripple_.destroy();
  3756. _get(MDCTab.prototype.__proto__ || Object.getPrototypeOf(MDCTab.prototype), 'destroy', this).call(this);
  3757. }
  3758. /**
  3759. * @return {!MDCTabFoundation}
  3760. */
  3761. }, {
  3762. key: 'getDefaultFoundation',
  3763. value: function getDefaultFoundation() {
  3764. var _this2 = this;
  3765. return new __WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* default */](
  3766. /** @type {!MDCTabAdapter} */{
  3767. setAttr: function setAttr(attr, value) {
  3768. return _this2.root_.setAttribute(attr, value);
  3769. },
  3770. addClass: function addClass(className) {
  3771. return _this2.root_.classList.add(className);
  3772. },
  3773. removeClass: function removeClass(className) {
  3774. return _this2.root_.classList.remove(className);
  3775. },
  3776. hasClass: function hasClass(className) {
  3777. return _this2.root_.classList.contains(className);
  3778. },
  3779. activateIndicator: function activateIndicator(previousIndicatorClientRect) {
  3780. return _this2.tabIndicator_.activate(previousIndicatorClientRect);
  3781. },
  3782. deactivateIndicator: function deactivateIndicator() {
  3783. return _this2.tabIndicator_.deactivate();
  3784. },
  3785. notifyInteracted: function notifyInteracted() {
  3786. return _this2.emit(__WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* default */].strings.INTERACTED_EVENT, { tab: _this2 }, true /* bubble */);
  3787. },
  3788. getOffsetLeft: function getOffsetLeft() {
  3789. return _this2.root_.offsetLeft;
  3790. },
  3791. getOffsetWidth: function getOffsetWidth() {
  3792. return _this2.root_.offsetWidth;
  3793. },
  3794. getContentOffsetLeft: function getContentOffsetLeft() {
  3795. return _this2.content_.offsetLeft;
  3796. },
  3797. getContentOffsetWidth: function getContentOffsetWidth() {
  3798. return _this2.content_.offsetWidth;
  3799. },
  3800. focus: function focus() {
  3801. return _this2.root_.focus();
  3802. }
  3803. });
  3804. }
  3805. /**
  3806. * Getter for the active state of the tab
  3807. * @return {boolean}
  3808. */
  3809. }, {
  3810. key: 'activate',
  3811. /**
  3812. * Activates the tab
  3813. * @param {!ClientRect=} computeIndicatorClientRect
  3814. */
  3815. value: function activate(computeIndicatorClientRect) {
  3816. this.foundation_.activate(computeIndicatorClientRect);
  3817. }
  3818. /**
  3819. * Deactivates the tab
  3820. */
  3821. }, {
  3822. key: 'deactivate',
  3823. value: function deactivate() {
  3824. this.foundation_.deactivate();
  3825. }
  3826. /**
  3827. * Returns the indicator's client rect
  3828. * @return {!ClientRect}
  3829. */
  3830. }, {
  3831. key: 'computeIndicatorClientRect',
  3832. value: function computeIndicatorClientRect() {
  3833. return this.tabIndicator_.computeContentClientRect();
  3834. }
  3835. /**
  3836. * @return {!MDCTabDimensions}
  3837. */
  3838. }, {
  3839. key: 'computeDimensions',
  3840. value: function computeDimensions() {
  3841. return this.foundation_.computeDimensions();
  3842. }
  3843. /**
  3844. * Focuses the tab
  3845. */
  3846. }, {
  3847. key: 'focus',
  3848. value: function focus() {
  3849. this.root_.focus();
  3850. }
  3851. }, {
  3852. key: 'active',
  3853. get: function get() {
  3854. return this.foundation_.isActive();
  3855. }
  3856. }, {
  3857. key: 'focusOnActivate',
  3858. set: function set(focusOnActivate) {
  3859. this.foundation_.setFocusOnActivate(focusOnActivate);
  3860. }
  3861. }], [{
  3862. key: 'attachTo',
  3863. value: function attachTo(root) {
  3864. return new MDCTab(root);
  3865. }
  3866. }]);
  3867. return MDCTab;
  3868. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  3869. /***/ }),
  3870. /* 26 */
  3871. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3872. "use strict";
  3873. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  3874. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(55);
  3875. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(132);
  3876. 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; };
  3877. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  3878. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3879. 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; }
  3880. 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; }
  3881. /**
  3882. * @license
  3883. * Copyright 2018 Google Inc.
  3884. *
  3885. * Permission is hereby granted, free of charge, to any person obtaining a copy
  3886. * of this software and associated documentation files (the "Software"), to deal
  3887. * in the Software without restriction, including without limitation the rights
  3888. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  3889. * copies of the Software, and to permit persons to whom the Software is
  3890. * furnished to do so, subject to the following conditions:
  3891. *
  3892. * The above copyright notice and this permission notice shall be included in
  3893. * all copies or substantial portions of the Software.
  3894. *
  3895. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  3896. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  3897. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  3898. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  3899. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  3900. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  3901. * THE SOFTWARE.
  3902. */
  3903. /**
  3904. * @extends {MDCFoundation<!MDCTabIndicatorAdapter>}
  3905. * @abstract
  3906. */
  3907. var MDCTabIndicatorFoundation = function (_MDCFoundation) {
  3908. _inherits(MDCTabIndicatorFoundation, _MDCFoundation);
  3909. _createClass(MDCTabIndicatorFoundation, null, [{
  3910. key: 'cssClasses',
  3911. /** @return enum {string} */
  3912. get: function get() {
  3913. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  3914. }
  3915. /** @return enum {string} */
  3916. }, {
  3917. key: 'strings',
  3918. get: function get() {
  3919. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  3920. }
  3921. /**
  3922. * @see MDCTabIndicatorAdapter for typing information
  3923. * @return {!MDCTabIndicatorAdapter}
  3924. */
  3925. }, {
  3926. key: 'defaultAdapter',
  3927. get: function get() {
  3928. return (/** @type {!MDCTabIndicatorAdapter} */{
  3929. addClass: function addClass() {},
  3930. removeClass: function removeClass() {},
  3931. computeContentClientRect: function computeContentClientRect() {},
  3932. setContentStyleProperty: function setContentStyleProperty() {}
  3933. }
  3934. );
  3935. }
  3936. /** @param {!MDCTabIndicatorAdapter} adapter */
  3937. }]);
  3938. function MDCTabIndicatorFoundation(adapter) {
  3939. _classCallCheck(this, MDCTabIndicatorFoundation);
  3940. return _possibleConstructorReturn(this, (MDCTabIndicatorFoundation.__proto__ || Object.getPrototypeOf(MDCTabIndicatorFoundation)).call(this, _extends(MDCTabIndicatorFoundation.defaultAdapter, adapter)));
  3941. }
  3942. /** @return {!ClientRect} */
  3943. _createClass(MDCTabIndicatorFoundation, [{
  3944. key: 'computeContentClientRect',
  3945. value: function computeContentClientRect() {
  3946. return this.adapter_.computeContentClientRect();
  3947. }
  3948. /**
  3949. * Activates the indicator
  3950. * @param {!ClientRect=} previousIndicatorClientRect
  3951. * @abstract
  3952. */
  3953. }, {
  3954. key: 'activate',
  3955. value: function activate(previousIndicatorClientRect) {} // eslint-disable-line no-unused-vars
  3956. /** @abstract */
  3957. }, {
  3958. key: 'deactivate',
  3959. value: function deactivate() {}
  3960. }]);
  3961. return MDCTabIndicatorFoundation;
  3962. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  3963. /* harmony default export */ __webpack_exports__["a"] = (MDCTabIndicatorFoundation);
  3964. /***/ }),
  3965. /* 27 */
  3966. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3967. "use strict";
  3968. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  3969. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(61);
  3970. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(146);
  3971. 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; };
  3972. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  3973. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3974. 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; }
  3975. 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; }
  3976. /**
  3977. * @license
  3978. * Copyright 2017 Google Inc.
  3979. *
  3980. * Permission is hereby granted, free of charge, to any person obtaining a copy
  3981. * of this software and associated documentation files (the "Software"), to deal
  3982. * in the Software without restriction, including without limitation the rights
  3983. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  3984. * copies of the Software, and to permit persons to whom the Software is
  3985. * furnished to do so, subject to the following conditions:
  3986. *
  3987. * The above copyright notice and this permission notice shall be included in
  3988. * all copies or substantial portions of the Software.
  3989. *
  3990. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  3991. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  3992. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  3993. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  3994. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  3995. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  3996. * THE SOFTWARE.
  3997. */
  3998. /**
  3999. * @extends {MDCFoundation<!MDCTextFieldHelperTextAdapter>}
  4000. * @final
  4001. */
  4002. var MDCTextFieldHelperTextFoundation = function (_MDCFoundation) {
  4003. _inherits(MDCTextFieldHelperTextFoundation, _MDCFoundation);
  4004. _createClass(MDCTextFieldHelperTextFoundation, null, [{
  4005. key: 'cssClasses',
  4006. /** @return enum {string} */
  4007. get: function get() {
  4008. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  4009. }
  4010. /** @return enum {string} */
  4011. }, {
  4012. key: 'strings',
  4013. get: function get() {
  4014. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  4015. }
  4016. /**
  4017. * {@see MDCTextFieldHelperTextAdapter} for typing information on parameters and return
  4018. * types.
  4019. * @return {!MDCTextFieldHelperTextAdapter}
  4020. */
  4021. }, {
  4022. key: 'defaultAdapter',
  4023. get: function get() {
  4024. return (/** @type {!MDCTextFieldHelperTextAdapter} */{
  4025. addClass: function addClass() {},
  4026. removeClass: function removeClass() {},
  4027. hasClass: function hasClass() {},
  4028. setAttr: function setAttr() {},
  4029. removeAttr: function removeAttr() {},
  4030. setContent: function setContent() {}
  4031. }
  4032. );
  4033. }
  4034. /**
  4035. * @param {!MDCTextFieldHelperTextAdapter} adapter
  4036. */
  4037. }]);
  4038. function MDCTextFieldHelperTextFoundation(adapter) {
  4039. _classCallCheck(this, MDCTextFieldHelperTextFoundation);
  4040. return _possibleConstructorReturn(this, (MDCTextFieldHelperTextFoundation.__proto__ || Object.getPrototypeOf(MDCTextFieldHelperTextFoundation)).call(this, _extends(MDCTextFieldHelperTextFoundation.defaultAdapter, adapter)));
  4041. }
  4042. /**
  4043. * Sets the content of the helper text field.
  4044. * @param {string} content
  4045. */
  4046. _createClass(MDCTextFieldHelperTextFoundation, [{
  4047. key: 'setContent',
  4048. value: function setContent(content) {
  4049. this.adapter_.setContent(content);
  4050. }
  4051. /** @param {boolean} isPersistent Sets the persistency of the helper text. */
  4052. }, {
  4053. key: 'setPersistent',
  4054. value: function setPersistent(isPersistent) {
  4055. if (isPersistent) {
  4056. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_PERSISTENT);
  4057. } else {
  4058. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_PERSISTENT);
  4059. }
  4060. }
  4061. /**
  4062. * @param {boolean} isValidation True to make the helper text act as an
  4063. * error validation message.
  4064. */
  4065. }, {
  4066. key: 'setValidation',
  4067. value: function setValidation(isValidation) {
  4068. if (isValidation) {
  4069. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_VALIDATION_MSG);
  4070. } else {
  4071. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_VALIDATION_MSG);
  4072. }
  4073. }
  4074. /** Makes the helper text visible to the screen reader. */
  4075. }, {
  4076. key: 'showToScreenReader',
  4077. value: function showToScreenReader() {
  4078. this.adapter_.removeAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_HIDDEN);
  4079. }
  4080. /**
  4081. * Sets the validity of the helper text based on the input validity.
  4082. * @param {boolean} inputIsValid
  4083. */
  4084. }, {
  4085. key: 'setValidity',
  4086. value: function setValidity(inputIsValid) {
  4087. var helperTextIsPersistent = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_PERSISTENT);
  4088. var helperTextIsValidationMsg = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_VALIDATION_MSG);
  4089. var validationMsgNeedsDisplay = helperTextIsValidationMsg && !inputIsValid;
  4090. if (validationMsgNeedsDisplay) {
  4091. this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ROLE, 'alert');
  4092. } else {
  4093. this.adapter_.removeAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ROLE);
  4094. }
  4095. if (!helperTextIsPersistent && !validationMsgNeedsDisplay) {
  4096. this.hide_();
  4097. }
  4098. }
  4099. /**
  4100. * Hides the help text from screen readers.
  4101. * @private
  4102. */
  4103. }, {
  4104. key: 'hide_',
  4105. value: function hide_() {
  4106. this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_HIDDEN, 'true');
  4107. }
  4108. }]);
  4109. return MDCTextFieldHelperTextFoundation;
  4110. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  4111. /* harmony default export */ __webpack_exports__["a"] = (MDCTextFieldHelperTextFoundation);
  4112. /***/ }),
  4113. /* 28 */
  4114. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4115. "use strict";
  4116. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  4117. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(62);
  4118. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(147);
  4119. 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; };
  4120. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  4121. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4122. 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; }
  4123. 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; }
  4124. /**
  4125. * @license
  4126. * Copyright 2017 Google Inc.
  4127. *
  4128. * Permission is hereby granted, free of charge, to any person obtaining a copy
  4129. * of this software and associated documentation files (the "Software"), to deal
  4130. * in the Software without restriction, including without limitation the rights
  4131. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  4132. * copies of the Software, and to permit persons to whom the Software is
  4133. * furnished to do so, subject to the following conditions:
  4134. *
  4135. * The above copyright notice and this permission notice shall be included in
  4136. * all copies or substantial portions of the Software.
  4137. *
  4138. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  4139. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  4140. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  4141. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  4142. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  4143. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  4144. * THE SOFTWARE.
  4145. */
  4146. /**
  4147. * @extends {MDCFoundation<!MDCTextFieldIconAdapter>}
  4148. * @final
  4149. */
  4150. var MDCTextFieldIconFoundation = function (_MDCFoundation) {
  4151. _inherits(MDCTextFieldIconFoundation, _MDCFoundation);
  4152. _createClass(MDCTextFieldIconFoundation, null, [{
  4153. key: 'strings',
  4154. /** @return enum {string} */
  4155. get: function get() {
  4156. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* strings */];
  4157. }
  4158. /**
  4159. * {@see MDCTextFieldIconAdapter} for typing information on parameters and return
  4160. * types.
  4161. * @return {!MDCTextFieldIconAdapter}
  4162. */
  4163. }, {
  4164. key: 'defaultAdapter',
  4165. get: function get() {
  4166. return (/** @type {!MDCTextFieldIconAdapter} */{
  4167. getAttr: function getAttr() {},
  4168. setAttr: function setAttr() {},
  4169. removeAttr: function removeAttr() {},
  4170. setContent: function setContent() {},
  4171. registerInteractionHandler: function registerInteractionHandler() {},
  4172. deregisterInteractionHandler: function deregisterInteractionHandler() {},
  4173. notifyIconAction: function notifyIconAction() {}
  4174. }
  4175. );
  4176. }
  4177. /**
  4178. * @param {!MDCTextFieldIconAdapter} adapter
  4179. */
  4180. }]);
  4181. function MDCTextFieldIconFoundation(adapter) {
  4182. _classCallCheck(this, MDCTextFieldIconFoundation);
  4183. /** @private {string?} */
  4184. var _this = _possibleConstructorReturn(this, (MDCTextFieldIconFoundation.__proto__ || Object.getPrototypeOf(MDCTextFieldIconFoundation)).call(this, _extends(MDCTextFieldIconFoundation.defaultAdapter, adapter)));
  4185. _this.savedTabIndex_ = null;
  4186. /** @private {function(!Event): undefined} */
  4187. _this.interactionHandler_ = function (evt) {
  4188. return _this.handleInteraction(evt);
  4189. };
  4190. return _this;
  4191. }
  4192. _createClass(MDCTextFieldIconFoundation, [{
  4193. key: 'init',
  4194. value: function init() {
  4195. var _this2 = this;
  4196. this.savedTabIndex_ = this.adapter_.getAttr('tabindex');
  4197. ['click', 'keydown'].forEach(function (evtType) {
  4198. _this2.adapter_.registerInteractionHandler(evtType, _this2.interactionHandler_);
  4199. });
  4200. }
  4201. }, {
  4202. key: 'destroy',
  4203. value: function destroy() {
  4204. var _this3 = this;
  4205. ['click', 'keydown'].forEach(function (evtType) {
  4206. _this3.adapter_.deregisterInteractionHandler(evtType, _this3.interactionHandler_);
  4207. });
  4208. }
  4209. /** @param {boolean} disabled */
  4210. }, {
  4211. key: 'setDisabled',
  4212. value: function setDisabled(disabled) {
  4213. if (!this.savedTabIndex_) {
  4214. return;
  4215. }
  4216. if (disabled) {
  4217. this.adapter_.setAttr('tabindex', '-1');
  4218. this.adapter_.removeAttr('role');
  4219. } else {
  4220. this.adapter_.setAttr('tabindex', this.savedTabIndex_);
  4221. this.adapter_.setAttr('role', __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* strings */].ICON_ROLE);
  4222. }
  4223. }
  4224. /** @param {string} label */
  4225. }, {
  4226. key: 'setAriaLabel',
  4227. value: function setAriaLabel(label) {
  4228. this.adapter_.setAttr('aria-label', label);
  4229. }
  4230. /** @param {string} content */
  4231. }, {
  4232. key: 'setContent',
  4233. value: function setContent(content) {
  4234. this.adapter_.setContent(content);
  4235. }
  4236. /**
  4237. * Handles an interaction event
  4238. * @param {!Event} evt
  4239. */
  4240. }, {
  4241. key: 'handleInteraction',
  4242. value: function handleInteraction(evt) {
  4243. if (evt.type === 'click' || evt.key === 'Enter' || evt.keyCode === 13) {
  4244. this.adapter_.notifyIconAction();
  4245. }
  4246. }
  4247. }]);
  4248. return MDCTextFieldIconFoundation;
  4249. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  4250. /* harmony default export */ __webpack_exports__["a"] = (MDCTextFieldIconFoundation);
  4251. /***/ }),
  4252. /* 29 */
  4253. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4254. "use strict";
  4255. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  4256. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4257. /**
  4258. * @license
  4259. * Copyright 2016 Google Inc.
  4260. *
  4261. * Permission is hereby granted, free of charge, to any person obtaining a copy
  4262. * of this software and associated documentation files (the "Software"), to deal
  4263. * in the Software without restriction, including without limitation the rights
  4264. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  4265. * copies of the Software, and to permit persons to whom the Software is
  4266. * furnished to do so, subject to the following conditions:
  4267. *
  4268. * The above copyright notice and this permission notice shall be included in
  4269. * all copies or substantial portions of the Software.
  4270. *
  4271. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  4272. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  4273. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  4274. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  4275. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  4276. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  4277. * THE SOFTWARE.
  4278. */
  4279. /* eslint no-unused-vars: [2, {"args": "none"}] */
  4280. /**
  4281. * Adapter for MDC Ripple. Provides an interface for managing
  4282. * - classes
  4283. * - dom
  4284. * - CSS variables
  4285. * - position
  4286. * - dimensions
  4287. * - scroll position
  4288. * - event handlers
  4289. * - unbounded, active and disabled states
  4290. *
  4291. * Additionally, provides type information for the adapter to the Closure
  4292. * compiler.
  4293. *
  4294. * Implement this adapter for your framework of choice to delegate updates to
  4295. * the component in your framework of choice. See architecture documentation
  4296. * for more details.
  4297. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  4298. *
  4299. * @record
  4300. */
  4301. var MDCRippleAdapter = function () {
  4302. function MDCRippleAdapter() {
  4303. _classCallCheck(this, MDCRippleAdapter);
  4304. }
  4305. _createClass(MDCRippleAdapter, [{
  4306. key: "browserSupportsCssVars",
  4307. /** @return {boolean} */
  4308. value: function browserSupportsCssVars() {}
  4309. /** @return {boolean} */
  4310. }, {
  4311. key: "isUnbounded",
  4312. value: function isUnbounded() {}
  4313. /** @return {boolean} */
  4314. }, {
  4315. key: "isSurfaceActive",
  4316. value: function isSurfaceActive() {}
  4317. /** @return {boolean} */
  4318. }, {
  4319. key: "isSurfaceDisabled",
  4320. value: function isSurfaceDisabled() {}
  4321. /** @param {string} className */
  4322. }, {
  4323. key: "addClass",
  4324. value: function addClass(className) {}
  4325. /** @param {string} className */
  4326. }, {
  4327. key: "removeClass",
  4328. value: function removeClass(className) {}
  4329. /** @param {!EventTarget} target */
  4330. }, {
  4331. key: "containsEventTarget",
  4332. value: function containsEventTarget(target) {}
  4333. /**
  4334. * @param {string} evtType
  4335. * @param {!Function} handler
  4336. */
  4337. }, {
  4338. key: "registerInteractionHandler",
  4339. value: function registerInteractionHandler(evtType, handler) {}
  4340. /**
  4341. * @param {string} evtType
  4342. * @param {!Function} handler
  4343. */
  4344. }, {
  4345. key: "deregisterInteractionHandler",
  4346. value: function deregisterInteractionHandler(evtType, handler) {}
  4347. /**
  4348. * @param {string} evtType
  4349. * @param {!Function} handler
  4350. */
  4351. }, {
  4352. key: "registerDocumentInteractionHandler",
  4353. value: function registerDocumentInteractionHandler(evtType, handler) {}
  4354. /**
  4355. * @param {string} evtType
  4356. * @param {!Function} handler
  4357. */
  4358. }, {
  4359. key: "deregisterDocumentInteractionHandler",
  4360. value: function deregisterDocumentInteractionHandler(evtType, handler) {}
  4361. /**
  4362. * @param {!Function} handler
  4363. */
  4364. }, {
  4365. key: "registerResizeHandler",
  4366. value: function registerResizeHandler(handler) {}
  4367. /**
  4368. * @param {!Function} handler
  4369. */
  4370. }, {
  4371. key: "deregisterResizeHandler",
  4372. value: function deregisterResizeHandler(handler) {}
  4373. /**
  4374. * @param {string} varName
  4375. * @param {?number|string} value
  4376. */
  4377. }, {
  4378. key: "updateCssVariable",
  4379. value: function updateCssVariable(varName, value) {}
  4380. /** @return {!ClientRect} */
  4381. }, {
  4382. key: "computeBoundingRect",
  4383. value: function computeBoundingRect() {}
  4384. /** @return {{x: number, y: number}} */
  4385. }, {
  4386. key: "getWindowPageOffset",
  4387. value: function getWindowPageOffset() {}
  4388. }]);
  4389. return MDCRippleAdapter;
  4390. }();
  4391. /* unused harmony default export */ var _unused_webpack_default_export = (MDCRippleAdapter);
  4392. /***/ }),
  4393. /* 30 */
  4394. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4395. "use strict";
  4396. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCChip; });
  4397. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  4398. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__ = __webpack_require__(2);
  4399. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__adapter__ = __webpack_require__(31);
  4400. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation__ = __webpack_require__(32);
  4401. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__constants__ = __webpack_require__(33);
  4402. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_3__foundation__["a"]; });
  4403. 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; };
  4404. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  4405. 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); } };
  4406. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4407. 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; }
  4408. 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; }
  4409. /**
  4410. * @license
  4411. * Copyright 2016 Google Inc.
  4412. *
  4413. * Permission is hereby granted, free of charge, to any person obtaining a copy
  4414. * of this software and associated documentation files (the "Software"), to deal
  4415. * in the Software without restriction, including without limitation the rights
  4416. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  4417. * copies of the Software, and to permit persons to whom the Software is
  4418. * furnished to do so, subject to the following conditions:
  4419. *
  4420. * The above copyright notice and this permission notice shall be included in
  4421. * all copies or substantial portions of the Software.
  4422. *
  4423. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  4424. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  4425. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  4426. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  4427. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  4428. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  4429. * THE SOFTWARE.
  4430. */
  4431. var INTERACTION_EVENTS = ['click', 'keydown'];
  4432. /**
  4433. * @extends {MDCComponent<!MDCChipFoundation>}
  4434. * @final
  4435. */
  4436. var MDCChip = function (_MDCComponent) {
  4437. _inherits(MDCChip, _MDCComponent);
  4438. /**
  4439. * @param {...?} args
  4440. */
  4441. function MDCChip() {
  4442. var _ref;
  4443. _classCallCheck(this, MDCChip);
  4444. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  4445. args[_key] = arguments[_key];
  4446. }
  4447. /** @type {string} */
  4448. var _this = _possibleConstructorReturn(this, (_ref = MDCChip.__proto__ || Object.getPrototypeOf(MDCChip)).call.apply(_ref, [this].concat(args)));
  4449. _this.id;
  4450. /** @private {?Element} */
  4451. _this.leadingIcon_;
  4452. /** @private {?Element} */
  4453. _this.trailingIcon_;
  4454. /** @private {!MDCRipple} */
  4455. _this.ripple_;
  4456. /** @private {?function(?Event): undefined} */
  4457. _this.handleInteraction_;
  4458. /** @private {?function(!Event): undefined} */
  4459. _this.handleTransitionEnd_;
  4460. /** @private {function(!Event): undefined} */
  4461. _this.handleTrailingIconInteraction_;
  4462. return _this;
  4463. }
  4464. /**
  4465. * @param {!Element} root
  4466. * @return {!MDCChip}
  4467. */
  4468. _createClass(MDCChip, [{
  4469. key: 'initialize',
  4470. value: function initialize() {
  4471. var _this2 = this;
  4472. var rippleFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (el, foundation) {
  4473. return new __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRipple"](el, foundation);
  4474. };
  4475. this.id = this.root_.id;
  4476. this.leadingIcon_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].LEADING_ICON_SELECTOR);
  4477. this.trailingIcon_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].TRAILING_ICON_SELECTOR);
  4478. // Adjust ripple size for chips with animated growing width. This applies when filter chips without
  4479. // a leading icon are selected, and a leading checkmark will cause the chip width to expand.
  4480. var checkmarkEl = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].CHECKMARK_SELECTOR);
  4481. if (checkmarkEl && !this.leadingIcon_) {
  4482. var adapter = _extends(__WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRipple"].createAdapter(this), {
  4483. computeBoundingRect: function computeBoundingRect() {
  4484. var height = _this2.root_.getBoundingClientRect().height;
  4485. // The checkmark's width is initially set to 0, so use the checkmark's height as a proxy since the
  4486. // checkmark should always be square.
  4487. var width = _this2.root_.getBoundingClientRect().width + checkmarkEl.getBoundingClientRect().height;
  4488. return { height: height, width: width };
  4489. }
  4490. });
  4491. this.ripple_ = rippleFactory(this.root_, new __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRippleFoundation"](adapter));
  4492. } else {
  4493. this.ripple_ = rippleFactory(this.root_);
  4494. }
  4495. }
  4496. }, {
  4497. key: 'initialSyncWithDOM',
  4498. value: function initialSyncWithDOM() {
  4499. var _this3 = this;
  4500. this.handleInteraction_ = function (evt) {
  4501. return _this3.foundation_.handleInteraction(evt);
  4502. };
  4503. this.handleTransitionEnd_ = function (evt) {
  4504. return _this3.foundation_.handleTransitionEnd(evt);
  4505. };
  4506. this.handleTrailingIconInteraction_ = function (evt) {
  4507. return _this3.foundation_.handleTrailingIconInteraction(evt);
  4508. };
  4509. INTERACTION_EVENTS.forEach(function (evtType) {
  4510. _this3.root_.addEventListener(evtType, _this3.handleInteraction_);
  4511. });
  4512. this.root_.addEventListener('transitionend', this.handleTransitionEnd_);
  4513. if (this.trailingIcon_) {
  4514. INTERACTION_EVENTS.forEach(function (evtType) {
  4515. _this3.trailingIcon_.addEventListener(evtType, _this3.handleTrailingIconInteraction_);
  4516. });
  4517. }
  4518. }
  4519. }, {
  4520. key: 'destroy',
  4521. value: function destroy() {
  4522. var _this4 = this;
  4523. this.ripple_.destroy();
  4524. INTERACTION_EVENTS.forEach(function (evtType) {
  4525. _this4.root_.removeEventListener(evtType, _this4.handleInteraction_);
  4526. });
  4527. this.root_.removeEventListener('transitionend', this.handleTransitionEnd_);
  4528. if (this.trailingIcon_) {
  4529. INTERACTION_EVENTS.forEach(function (evtType) {
  4530. _this4.trailingIcon_.removeEventListener(evtType, _this4.handleTrailingIconInteraction_);
  4531. });
  4532. }
  4533. _get(MDCChip.prototype.__proto__ || Object.getPrototypeOf(MDCChip.prototype), 'destroy', this).call(this);
  4534. }
  4535. /**
  4536. * Returns whether the chip is selected.
  4537. * @return {boolean}
  4538. */
  4539. }, {
  4540. key: 'beginExit',
  4541. /**
  4542. * Begins the exit animation which leads to removal of the chip.
  4543. */
  4544. value: function beginExit() {
  4545. this.foundation_.beginExit();
  4546. }
  4547. /**
  4548. * @return {!MDCChipFoundation}
  4549. */
  4550. }, {
  4551. key: 'getDefaultFoundation',
  4552. value: function getDefaultFoundation() {
  4553. var _this5 = this;
  4554. return new __WEBPACK_IMPORTED_MODULE_3__foundation__["a" /* MDCChipFoundation */]( /** @type {!MDCChipAdapter} */_extends({
  4555. addClass: function addClass(className) {
  4556. return _this5.root_.classList.add(className);
  4557. },
  4558. removeClass: function removeClass(className) {
  4559. return _this5.root_.classList.remove(className);
  4560. },
  4561. hasClass: function hasClass(className) {
  4562. return _this5.root_.classList.contains(className);
  4563. },
  4564. addClassToLeadingIcon: function addClassToLeadingIcon(className) {
  4565. if (_this5.leadingIcon_) {
  4566. _this5.leadingIcon_.classList.add(className);
  4567. }
  4568. },
  4569. removeClassFromLeadingIcon: function removeClassFromLeadingIcon(className) {
  4570. if (_this5.leadingIcon_) {
  4571. _this5.leadingIcon_.classList.remove(className);
  4572. }
  4573. },
  4574. eventTargetHasClass: function eventTargetHasClass(target, className) {
  4575. return target.classList.contains(className);
  4576. },
  4577. notifyInteraction: function notifyInteraction() {
  4578. return _this5.emit(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].INTERACTION_EVENT, { chipId: _this5.id }, true /* shouldBubble */);
  4579. },
  4580. notifySelection: function notifySelection(selected) {
  4581. return _this5.emit(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].SELECTION_EVENT, { chipId: _this5.id, selected: selected }, true /* shouldBubble */);
  4582. },
  4583. notifyTrailingIconInteraction: function notifyTrailingIconInteraction() {
  4584. return _this5.emit(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].TRAILING_ICON_INTERACTION_EVENT, { chipId: _this5.id }, true /* shouldBubble */);
  4585. },
  4586. notifyRemoval: function notifyRemoval() {
  4587. return _this5.emit(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].REMOVAL_EVENT, { chipId: _this5.id, root: _this5.root_ }, true /* shouldBubble */);
  4588. },
  4589. getComputedStyleValue: function getComputedStyleValue(propertyName) {
  4590. return window.getComputedStyle(_this5.root_).getPropertyValue(propertyName);
  4591. },
  4592. setStyleProperty: function setStyleProperty(propertyName, value) {
  4593. return _this5.root_.style.setProperty(propertyName, value);
  4594. }
  4595. }));
  4596. }
  4597. /** @return {!MDCRipple} */
  4598. }, {
  4599. key: 'selected',
  4600. get: function get() {
  4601. return this.foundation_.isSelected();
  4602. }
  4603. /**
  4604. * Sets selected state on the chip.
  4605. * @param {boolean} selected
  4606. */
  4607. ,
  4608. set: function set(selected) {
  4609. this.foundation_.setSelected(selected);
  4610. }
  4611. /**
  4612. * Returns whether a trailing icon click should trigger exit/removal of the chip.
  4613. * @return {boolean}
  4614. */
  4615. }, {
  4616. key: 'shouldRemoveOnTrailingIconClick',
  4617. get: function get() {
  4618. return this.foundation_.getShouldRemoveOnTrailingIconClick();
  4619. }
  4620. /**
  4621. * Sets whether a trailing icon click should trigger exit/removal of the chip.
  4622. * @param {boolean} shouldRemove
  4623. */
  4624. ,
  4625. set: function set(shouldRemove) {
  4626. this.foundation_.setShouldRemoveOnTrailingIconClick(shouldRemove);
  4627. }
  4628. }, {
  4629. key: 'ripple',
  4630. get: function get() {
  4631. return this.ripple_;
  4632. }
  4633. }], [{
  4634. key: 'attachTo',
  4635. value: function attachTo(root) {
  4636. return new MDCChip(root);
  4637. }
  4638. }]);
  4639. return MDCChip;
  4640. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  4641. /***/ }),
  4642. /* 31 */
  4643. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4644. "use strict";
  4645. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  4646. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4647. /**
  4648. * @license
  4649. * Copyright 2017 Google Inc.
  4650. *
  4651. * Permission is hereby granted, free of charge, to any person obtaining a copy
  4652. * of this software and associated documentation files (the "Software"), to deal
  4653. * in the Software without restriction, including without limitation the rights
  4654. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  4655. * copies of the Software, and to permit persons to whom the Software is
  4656. * furnished to do so, subject to the following conditions:
  4657. *
  4658. * The above copyright notice and this permission notice shall be included in
  4659. * all copies or substantial portions of the Software.
  4660. *
  4661. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  4662. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  4663. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  4664. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  4665. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  4666. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  4667. * THE SOFTWARE.
  4668. */
  4669. /* eslint no-unused-vars: [2, {"args": "none"}] */
  4670. /**
  4671. * Adapter for MDC Chip.
  4672. *
  4673. * Defines the shape of the adapter expected by the foundation. Implement this
  4674. * adapter to integrate the Chip into your framework. See
  4675. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  4676. * for more information.
  4677. *
  4678. * @record
  4679. */
  4680. var MDCChipAdapter = function () {
  4681. function MDCChipAdapter() {
  4682. _classCallCheck(this, MDCChipAdapter);
  4683. }
  4684. _createClass(MDCChipAdapter, [{
  4685. key: "addClass",
  4686. /**
  4687. * Adds a class to the root element.
  4688. * @param {string} className
  4689. */
  4690. value: function addClass(className) {}
  4691. /**
  4692. * Removes a class from the root element.
  4693. * @param {string} className
  4694. */
  4695. }, {
  4696. key: "removeClass",
  4697. value: function removeClass(className) {}
  4698. /**
  4699. * Returns true if the root element contains the given class.
  4700. * @param {string} className
  4701. * @return {boolean}
  4702. */
  4703. }, {
  4704. key: "hasClass",
  4705. value: function hasClass(className) {}
  4706. /**
  4707. * Adds a class to the leading icon element.
  4708. * @param {string} className
  4709. */
  4710. }, {
  4711. key: "addClassToLeadingIcon",
  4712. value: function addClassToLeadingIcon(className) {}
  4713. /**
  4714. * Removes a class from the leading icon element.
  4715. * @param {string} className
  4716. */
  4717. }, {
  4718. key: "removeClassFromLeadingIcon",
  4719. value: function removeClassFromLeadingIcon(className) {}
  4720. /**
  4721. * Returns true if target has className, false otherwise.
  4722. * @param {!EventTarget} target
  4723. * @param {string} className
  4724. * @return {boolean}
  4725. */
  4726. }, {
  4727. key: "eventTargetHasClass",
  4728. value: function eventTargetHasClass(target, className) {}
  4729. /**
  4730. * Emits a custom "MDCChip:interaction" event denoting the chip has been
  4731. * interacted with (typically on click or keydown).
  4732. */
  4733. }, {
  4734. key: "notifyInteraction",
  4735. value: function notifyInteraction() {}
  4736. /**
  4737. * Emits a custom "MDCChip:selection" event denoting the chip has been selected or deselected.
  4738. * @param {boolean} selected
  4739. */
  4740. }, {
  4741. key: "notifySelection",
  4742. value: function notifySelection(selected) {}
  4743. /**
  4744. * Emits a custom "MDCChip:trailingIconInteraction" event denoting the trailing icon has been
  4745. * interacted with (typically on click or keydown).
  4746. */
  4747. }, {
  4748. key: "notifyTrailingIconInteraction",
  4749. value: function notifyTrailingIconInteraction() {}
  4750. /**
  4751. * Emits a custom event "MDCChip:removal" denoting the chip will be removed.
  4752. */
  4753. }, {
  4754. key: "notifyRemoval",
  4755. value: function notifyRemoval() {}
  4756. /**
  4757. * Returns the computed property value of the given style property on the root element.
  4758. * @param {string} propertyName
  4759. * @return {string}
  4760. */
  4761. }, {
  4762. key: "getComputedStyleValue",
  4763. value: function getComputedStyleValue(propertyName) {}
  4764. /**
  4765. * Sets the property value of the given style property on the root element.
  4766. * @param {string} propertyName
  4767. * @param {string} value
  4768. */
  4769. }, {
  4770. key: "setStyleProperty",
  4771. value: function setStyleProperty(propertyName, value) {}
  4772. }]);
  4773. return MDCChipAdapter;
  4774. }();
  4775. /* unused harmony default export */ var _unused_webpack_default_export = (MDCChipAdapter);
  4776. /***/ }),
  4777. /* 32 */
  4778. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4779. "use strict";
  4780. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCChipFoundation; });
  4781. /* unused harmony export MDCChipInteractionEventType */
  4782. /* unused harmony export MDCChipSelectionEventType */
  4783. /* unused harmony export MDCChipRemovalEventType */
  4784. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  4785. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(31);
  4786. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(33);
  4787. 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; };
  4788. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  4789. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4790. 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; }
  4791. 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; }
  4792. /**
  4793. * @license
  4794. * Copyright 2016 Google Inc.
  4795. *
  4796. * Permission is hereby granted, free of charge, to any person obtaining a copy
  4797. * of this software and associated documentation files (the "Software"), to deal
  4798. * in the Software without restriction, including without limitation the rights
  4799. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  4800. * copies of the Software, and to permit persons to whom the Software is
  4801. * furnished to do so, subject to the following conditions:
  4802. *
  4803. * The above copyright notice and this permission notice shall be included in
  4804. * all copies or substantial portions of the Software.
  4805. *
  4806. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  4807. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  4808. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  4809. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  4810. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  4811. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  4812. * THE SOFTWARE.
  4813. */
  4814. /**
  4815. * @extends {MDCFoundation<!MDCChipAdapter>}
  4816. * @final
  4817. */
  4818. var MDCChipFoundation = function (_MDCFoundation) {
  4819. _inherits(MDCChipFoundation, _MDCFoundation);
  4820. _createClass(MDCChipFoundation, null, [{
  4821. key: 'strings',
  4822. /** @return enum {string} */
  4823. get: function get() {
  4824. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  4825. }
  4826. /** @return enum {string} */
  4827. }, {
  4828. key: 'cssClasses',
  4829. get: function get() {
  4830. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  4831. }
  4832. /**
  4833. * {@see MDCChipAdapter} for typing information on parameters and return
  4834. * types.
  4835. * @return {!MDCChipAdapter}
  4836. */
  4837. }, {
  4838. key: 'defaultAdapter',
  4839. get: function get() {
  4840. return (/** @type {!MDCChipAdapter} */{
  4841. addClass: function addClass() {},
  4842. removeClass: function removeClass() {},
  4843. hasClass: function hasClass() {},
  4844. addClassToLeadingIcon: function addClassToLeadingIcon() {},
  4845. removeClassFromLeadingIcon: function removeClassFromLeadingIcon() {},
  4846. eventTargetHasClass: function eventTargetHasClass() {},
  4847. notifyInteraction: function notifyInteraction() {},
  4848. notifySelection: function notifySelection() {},
  4849. notifyTrailingIconInteraction: function notifyTrailingIconInteraction() {},
  4850. notifyRemoval: function notifyRemoval() {},
  4851. getComputedStyleValue: function getComputedStyleValue() {},
  4852. setStyleProperty: function setStyleProperty() {}
  4853. }
  4854. );
  4855. }
  4856. /**
  4857. * @param {!MDCChipAdapter} adapter
  4858. */
  4859. }]);
  4860. function MDCChipFoundation(adapter) {
  4861. _classCallCheck(this, MDCChipFoundation);
  4862. /**
  4863. * Whether a trailing icon click should immediately trigger exit/removal of the chip.
  4864. * @private {boolean}
  4865. * */
  4866. var _this = _possibleConstructorReturn(this, (MDCChipFoundation.__proto__ || Object.getPrototypeOf(MDCChipFoundation)).call(this, _extends(MDCChipFoundation.defaultAdapter, adapter)));
  4867. _this.shouldRemoveOnTrailingIconClick_ = true;
  4868. return _this;
  4869. }
  4870. /**
  4871. * @return {boolean}
  4872. */
  4873. _createClass(MDCChipFoundation, [{
  4874. key: 'isSelected',
  4875. value: function isSelected() {
  4876. return this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SELECTED);
  4877. }
  4878. /**
  4879. * @param {boolean} selected
  4880. */
  4881. }, {
  4882. key: 'setSelected',
  4883. value: function setSelected(selected) {
  4884. if (selected) {
  4885. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SELECTED);
  4886. } else {
  4887. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SELECTED);
  4888. }
  4889. this.adapter_.notifySelection(selected);
  4890. }
  4891. /**
  4892. * @return {boolean}
  4893. */
  4894. }, {
  4895. key: 'getShouldRemoveOnTrailingIconClick',
  4896. value: function getShouldRemoveOnTrailingIconClick() {
  4897. return this.shouldRemoveOnTrailingIconClick_;
  4898. }
  4899. /**
  4900. * @param {boolean} shouldRemove
  4901. */
  4902. }, {
  4903. key: 'setShouldRemoveOnTrailingIconClick',
  4904. value: function setShouldRemoveOnTrailingIconClick(shouldRemove) {
  4905. this.shouldRemoveOnTrailingIconClick_ = shouldRemove;
  4906. }
  4907. /**
  4908. * Begins the exit animation which leads to removal of the chip.
  4909. */
  4910. }, {
  4911. key: 'beginExit',
  4912. value: function beginExit() {
  4913. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CHIP_EXIT);
  4914. }
  4915. /**
  4916. * Handles an interaction event on the root element.
  4917. * @param {!Event} evt
  4918. */
  4919. }, {
  4920. key: 'handleInteraction',
  4921. value: function handleInteraction(evt) {
  4922. if (evt.type === 'click' || evt.key === 'Enter' || evt.keyCode === 13) {
  4923. this.adapter_.notifyInteraction();
  4924. }
  4925. }
  4926. /**
  4927. * Handles a transition end event on the root element.
  4928. * @param {!Event} evt
  4929. */
  4930. }, {
  4931. key: 'handleTransitionEnd',
  4932. value: function handleTransitionEnd(evt) {
  4933. var _this2 = this;
  4934. // Handle transition end event on the chip when it is about to be removed.
  4935. if (this.adapter_.eventTargetHasClass( /** @type {!EventTarget} */evt.target, __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CHIP_EXIT)) {
  4936. if (evt.propertyName === 'width') {
  4937. this.adapter_.notifyRemoval();
  4938. } else if (evt.propertyName === 'opacity') {
  4939. // See: https://css-tricks.com/using-css-transitions-auto-dimensions/#article-header-id-5
  4940. var chipWidth = this.adapter_.getComputedStyleValue('width');
  4941. // On the next frame (once we get the computed width), explicitly set the chip's width
  4942. // to its current pixel width, so we aren't transitioning out of 'auto'.
  4943. requestAnimationFrame(function () {
  4944. _this2.adapter_.setStyleProperty('width', chipWidth);
  4945. // To mitigate jitter, start transitioning padding and margin before width.
  4946. _this2.adapter_.setStyleProperty('padding', '0');
  4947. _this2.adapter_.setStyleProperty('margin', '0');
  4948. // On the next frame (once width is explicitly set), transition width to 0.
  4949. requestAnimationFrame(function () {
  4950. _this2.adapter_.setStyleProperty('width', '0');
  4951. });
  4952. });
  4953. }
  4954. return;
  4955. }
  4956. // Handle a transition end event on the leading icon or checkmark, since the transition end event bubbles.
  4957. if (evt.propertyName !== 'opacity') {
  4958. return;
  4959. }
  4960. 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)) {
  4961. this.adapter_.addClassToLeadingIcon(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HIDDEN_LEADING_ICON);
  4962. } 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)) {
  4963. this.adapter_.removeClassFromLeadingIcon(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HIDDEN_LEADING_ICON);
  4964. }
  4965. }
  4966. /**
  4967. * Handles an interaction event on the trailing icon element. This is used to
  4968. * prevent the ripple from activating on interaction with the trailing icon.
  4969. * @param {!Event} evt
  4970. */
  4971. }, {
  4972. key: 'handleTrailingIconInteraction',
  4973. value: function handleTrailingIconInteraction(evt) {
  4974. evt.stopPropagation();
  4975. if (evt.type === 'click' || evt.key === 'Enter' || evt.keyCode === 13) {
  4976. this.adapter_.notifyTrailingIconInteraction();
  4977. if (this.shouldRemoveOnTrailingIconClick_) {
  4978. this.beginExit();
  4979. }
  4980. }
  4981. }
  4982. }]);
  4983. return MDCChipFoundation;
  4984. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  4985. /**
  4986. * @typedef {{
  4987. * detail: {
  4988. * chipId: string,
  4989. * },
  4990. * bubbles: boolean,
  4991. * }}
  4992. */
  4993. var MDCChipInteractionEventType = void 0;
  4994. /**
  4995. * @typedef {{
  4996. * detail: {
  4997. * chipId: string,
  4998. * selected: boolean,
  4999. * },
  5000. * bubbles: boolean,
  5001. * }}
  5002. */
  5003. var MDCChipSelectionEventType = void 0;
  5004. /**
  5005. * @typedef {{
  5006. * detail: {
  5007. * chipId: string,
  5008. * root: Element,
  5009. * },
  5010. * bubbles: boolean,
  5011. * }}
  5012. */
  5013. var MDCChipRemovalEventType = void 0;
  5014. /***/ }),
  5015. /* 33 */
  5016. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5017. "use strict";
  5018. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  5019. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  5020. /**
  5021. * @license
  5022. * Copyright 2016 Google Inc.
  5023. *
  5024. * Permission is hereby granted, free of charge, to any person obtaining a copy
  5025. * of this software and associated documentation files (the "Software"), to deal
  5026. * in the Software without restriction, including without limitation the rights
  5027. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  5028. * copies of the Software, and to permit persons to whom the Software is
  5029. * furnished to do so, subject to the following conditions:
  5030. *
  5031. * The above copyright notice and this permission notice shall be included in
  5032. * all copies or substantial portions of the Software.
  5033. *
  5034. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  5035. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  5036. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  5037. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  5038. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  5039. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  5040. * THE SOFTWARE.
  5041. */
  5042. /** @enum {string} */
  5043. var strings = {
  5044. ENTRY_ANIMATION_NAME: 'mdc-chip-entry',
  5045. INTERACTION_EVENT: 'MDCChip:interaction',
  5046. SELECTION_EVENT: 'MDCChip:selection',
  5047. TRAILING_ICON_INTERACTION_EVENT: 'MDCChip:trailingIconInteraction',
  5048. REMOVAL_EVENT: 'MDCChip:removal',
  5049. CHECKMARK_SELECTOR: '.mdc-chip__checkmark',
  5050. LEADING_ICON_SELECTOR: '.mdc-chip__icon--leading',
  5051. TRAILING_ICON_SELECTOR: '.mdc-chip__icon--trailing'
  5052. };
  5053. /** @enum {string} */
  5054. var cssClasses = {
  5055. CHECKMARK: 'mdc-chip__checkmark',
  5056. CHIP_EXIT: 'mdc-chip--exit',
  5057. HIDDEN_LEADING_ICON: 'mdc-chip__icon--leading-hidden',
  5058. LEADING_ICON: 'mdc-chip__icon--leading',
  5059. TRAILING_ICON: 'mdc-chip__icon--trailing',
  5060. SELECTED: 'mdc-chip--selected'
  5061. };
  5062. /***/ }),
  5063. /* 34 */
  5064. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5065. "use strict";
  5066. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  5067. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5068. /**
  5069. * @license
  5070. * Copyright 2017 Google Inc.
  5071. *
  5072. * Permission is hereby granted, free of charge, to any person obtaining a copy
  5073. * of this software and associated documentation files (the "Software"), to deal
  5074. * in the Software without restriction, including without limitation the rights
  5075. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  5076. * copies of the Software, and to permit persons to whom the Software is
  5077. * furnished to do so, subject to the following conditions:
  5078. *
  5079. * The above copyright notice and this permission notice shall be included in
  5080. * all copies or substantial portions of the Software.
  5081. *
  5082. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  5083. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  5084. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  5085. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  5086. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  5087. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  5088. * THE SOFTWARE.
  5089. */
  5090. /* eslint no-unused-vars: [2, {"args": "none"}] */
  5091. /**
  5092. * Adapter for MDC Chip Set.
  5093. *
  5094. * Defines the shape of the adapter expected by the foundation. Implement this
  5095. * adapter to integrate the Chip Set into your framework. See
  5096. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  5097. * for more information.
  5098. *
  5099. * @record
  5100. */
  5101. var MDCChipSetAdapter = function () {
  5102. function MDCChipSetAdapter() {
  5103. _classCallCheck(this, MDCChipSetAdapter);
  5104. }
  5105. _createClass(MDCChipSetAdapter, [{
  5106. key: "hasClass",
  5107. /**
  5108. * Returns true if the root element contains the given class name.
  5109. * @param {string} className
  5110. * @return {boolean}
  5111. */
  5112. value: function hasClass(className) {}
  5113. /**
  5114. * Removes the chip with the given id from the chip set.
  5115. * @param {string} chipId
  5116. */
  5117. }, {
  5118. key: "removeChip",
  5119. value: function removeChip(chipId) {}
  5120. /**
  5121. * Sets the selected state of the chip with the given id.
  5122. * @param {string} chipId
  5123. * @param {boolean} selected
  5124. */
  5125. }, {
  5126. key: "setSelected",
  5127. value: function setSelected(chipId, selected) {}
  5128. }]);
  5129. return MDCChipSetAdapter;
  5130. }();
  5131. /* unused harmony default export */ var _unused_webpack_default_export = (MDCChipSetAdapter);
  5132. /***/ }),
  5133. /* 35 */
  5134. /***/ (function(module, exports, __webpack_require__) {
  5135. var tabbable = __webpack_require__(80);
  5136. var listeningFocusTrap = null;
  5137. function focusTrap(element, userOptions) {
  5138. var tabbableNodes = [];
  5139. var nodeFocusedBeforeActivation = null;
  5140. var active = false;
  5141. var paused = false;
  5142. var container = (typeof element === 'string')
  5143. ? document.querySelector(element)
  5144. : element;
  5145. var config = userOptions || {};
  5146. config.returnFocusOnDeactivate = (userOptions && userOptions.returnFocusOnDeactivate !== undefined)
  5147. ? userOptions.returnFocusOnDeactivate
  5148. : true;
  5149. config.escapeDeactivates = (userOptions && userOptions.escapeDeactivates !== undefined)
  5150. ? userOptions.escapeDeactivates
  5151. : true;
  5152. var trap = {
  5153. activate: activate,
  5154. deactivate: deactivate,
  5155. pause: pause,
  5156. unpause: unpause,
  5157. };
  5158. return trap;
  5159. function activate(activateOptions) {
  5160. if (active) return;
  5161. var defaultedActivateOptions = {
  5162. onActivate: (activateOptions && activateOptions.onActivate !== undefined)
  5163. ? activateOptions.onActivate
  5164. : config.onActivate,
  5165. };
  5166. active = true;
  5167. paused = false;
  5168. nodeFocusedBeforeActivation = document.activeElement;
  5169. if (defaultedActivateOptions.onActivate) {
  5170. defaultedActivateOptions.onActivate();
  5171. }
  5172. addListeners();
  5173. return trap;
  5174. }
  5175. function deactivate(deactivateOptions) {
  5176. if (!active) return;
  5177. var defaultedDeactivateOptions = {
  5178. returnFocus: (deactivateOptions && deactivateOptions.returnFocus !== undefined)
  5179. ? deactivateOptions.returnFocus
  5180. : config.returnFocusOnDeactivate,
  5181. onDeactivate: (deactivateOptions && deactivateOptions.onDeactivate !== undefined)
  5182. ? deactivateOptions.onDeactivate
  5183. : config.onDeactivate,
  5184. };
  5185. removeListeners();
  5186. if (defaultedDeactivateOptions.onDeactivate) {
  5187. defaultedDeactivateOptions.onDeactivate();
  5188. }
  5189. if (defaultedDeactivateOptions.returnFocus) {
  5190. setTimeout(function () {
  5191. tryFocus(nodeFocusedBeforeActivation);
  5192. }, 0);
  5193. }
  5194. active = false;
  5195. paused = false;
  5196. return this;
  5197. }
  5198. function pause() {
  5199. if (paused || !active) return;
  5200. paused = true;
  5201. removeListeners();
  5202. }
  5203. function unpause() {
  5204. if (!paused || !active) return;
  5205. paused = false;
  5206. addListeners();
  5207. }
  5208. function addListeners() {
  5209. if (!active) return;
  5210. // There can be only one listening focus trap at a time
  5211. if (listeningFocusTrap) {
  5212. listeningFocusTrap.pause();
  5213. }
  5214. listeningFocusTrap = trap;
  5215. updateTabbableNodes();
  5216. tryFocus(firstFocusNode());
  5217. document.addEventListener('focus', checkFocus, true);
  5218. document.addEventListener('click', checkClick, true);
  5219. document.addEventListener('mousedown', checkPointerDown, true);
  5220. document.addEventListener('touchstart', checkPointerDown, true);
  5221. document.addEventListener('keydown', checkKey, true);
  5222. return trap;
  5223. }
  5224. function removeListeners() {
  5225. if (!active || listeningFocusTrap !== trap) return;
  5226. document.removeEventListener('focus', checkFocus, true);
  5227. document.removeEventListener('click', checkClick, true);
  5228. document.removeEventListener('mousedown', checkPointerDown, true);
  5229. document.removeEventListener('touchstart', checkPointerDown, true);
  5230. document.removeEventListener('keydown', checkKey, true);
  5231. listeningFocusTrap = null;
  5232. return trap;
  5233. }
  5234. function getNodeForOption(optionName) {
  5235. var optionValue = config[optionName];
  5236. var node = optionValue;
  5237. if (!optionValue) {
  5238. return null;
  5239. }
  5240. if (typeof optionValue === 'string') {
  5241. node = document.querySelector(optionValue);
  5242. if (!node) {
  5243. throw new Error('`' + optionName + '` refers to no known node');
  5244. }
  5245. }
  5246. if (typeof optionValue === 'function') {
  5247. node = optionValue();
  5248. if (!node) {
  5249. throw new Error('`' + optionName + '` did not return a node');
  5250. }
  5251. }
  5252. return node;
  5253. }
  5254. function firstFocusNode() {
  5255. var node;
  5256. if (getNodeForOption('initialFocus') !== null) {
  5257. node = getNodeForOption('initialFocus');
  5258. } else if (container.contains(document.activeElement)) {
  5259. node = document.activeElement;
  5260. } else {
  5261. node = tabbableNodes[0] || getNodeForOption('fallbackFocus');
  5262. }
  5263. if (!node) {
  5264. throw new Error('You can\'t have a focus-trap without at least one focusable element');
  5265. }
  5266. return node;
  5267. }
  5268. // This needs to be done on mousedown and touchstart instead of click
  5269. // so that it precedes the focus event
  5270. function checkPointerDown(e) {
  5271. if (config.clickOutsideDeactivates && !container.contains(e.target)) {
  5272. deactivate({ returnFocus: false });
  5273. }
  5274. }
  5275. function checkClick(e) {
  5276. if (config.clickOutsideDeactivates) return;
  5277. if (container.contains(e.target)) return;
  5278. e.preventDefault();
  5279. e.stopImmediatePropagation();
  5280. }
  5281. function checkFocus(e) {
  5282. if (container.contains(e.target)) return;
  5283. e.preventDefault();
  5284. e.stopImmediatePropagation();
  5285. // Checking for a blur method here resolves a Firefox issue (#15)
  5286. if (typeof e.target.blur === 'function') e.target.blur();
  5287. }
  5288. function checkKey(e) {
  5289. if (e.key === 'Tab' || e.keyCode === 9) {
  5290. handleTab(e);
  5291. }
  5292. if (config.escapeDeactivates !== false && isEscapeEvent(e)) {
  5293. deactivate();
  5294. }
  5295. }
  5296. function handleTab(e) {
  5297. e.preventDefault();
  5298. updateTabbableNodes();
  5299. var currentFocusIndex = tabbableNodes.indexOf(e.target);
  5300. var lastTabbableNode = tabbableNodes[tabbableNodes.length - 1];
  5301. var firstTabbableNode = tabbableNodes[0];
  5302. if (e.shiftKey) {
  5303. if (e.target === firstTabbableNode || tabbableNodes.indexOf(e.target) === -1) {
  5304. return tryFocus(lastTabbableNode);
  5305. }
  5306. return tryFocus(tabbableNodes[currentFocusIndex - 1]);
  5307. }
  5308. if (e.target === lastTabbableNode) return tryFocus(firstTabbableNode);
  5309. tryFocus(tabbableNodes[currentFocusIndex + 1]);
  5310. }
  5311. function updateTabbableNodes() {
  5312. tabbableNodes = tabbable(container);
  5313. }
  5314. }
  5315. function isEscapeEvent(e) {
  5316. return e.key === 'Escape' || e.key === 'Esc' || e.keyCode === 27;
  5317. }
  5318. function tryFocus(node) {
  5319. if (!node || !node.focus) return;
  5320. node.focus();
  5321. if (node.tagName.toLowerCase() === 'input') {
  5322. node.select();
  5323. }
  5324. }
  5325. module.exports = focusTrap;
  5326. /***/ }),
  5327. /* 36 */
  5328. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5329. "use strict";
  5330. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__adapter__ = __webpack_require__(14);
  5331. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_foundation__ = __webpack_require__(0);
  5332. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(37);
  5333. 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; };
  5334. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  5335. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5336. 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; }
  5337. 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; }
  5338. /**
  5339. * @license
  5340. * Copyright 2018 Google Inc.
  5341. *
  5342. * Permission is hereby granted, free of charge, to any person obtaining a copy
  5343. * of this software and associated documentation files (the "Software"), to deal
  5344. * in the Software without restriction, including without limitation the rights
  5345. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  5346. * copies of the Software, and to permit persons to whom the Software is
  5347. * furnished to do so, subject to the following conditions:
  5348. *
  5349. * The above copyright notice and this permission notice shall be included in
  5350. * all copies or substantial portions of the Software.
  5351. *
  5352. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  5353. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  5354. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  5355. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  5356. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  5357. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  5358. * THE SOFTWARE.
  5359. */
  5360. /**
  5361. * @extends {MDCFoundation<!MDCDrawerAdapter>}
  5362. */
  5363. var MDCDismissibleDrawerFoundation = function (_MDCFoundation) {
  5364. _inherits(MDCDismissibleDrawerFoundation, _MDCFoundation);
  5365. _createClass(MDCDismissibleDrawerFoundation, null, [{
  5366. key: 'strings',
  5367. /** @return enum {string} */
  5368. get: function get() {
  5369. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  5370. }
  5371. /** @return enum {string} */
  5372. }, {
  5373. key: 'cssClasses',
  5374. get: function get() {
  5375. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  5376. }
  5377. }, {
  5378. key: 'defaultAdapter',
  5379. get: function get() {
  5380. return (/** @type {!MDCDrawerAdapter} */{
  5381. addClass: function addClass() /* className: string */{},
  5382. removeClass: function removeClass() /* className: string */{},
  5383. hasClass: function hasClass() /* className: string */{},
  5384. elementHasClass: function elementHasClass() /* element: !Element, className: string */{},
  5385. notifyClose: function notifyClose() {},
  5386. notifyOpen: function notifyOpen() {},
  5387. saveFocus: function saveFocus() {},
  5388. restoreFocus: function restoreFocus() {},
  5389. focusActiveNavigationItem: function focusActiveNavigationItem() {},
  5390. trapFocus: function trapFocus() {},
  5391. releaseFocus: function releaseFocus() {}
  5392. }
  5393. );
  5394. }
  5395. }]);
  5396. function MDCDismissibleDrawerFoundation(adapter) {
  5397. _classCallCheck(this, MDCDismissibleDrawerFoundation);
  5398. /** @private {number} */
  5399. var _this = _possibleConstructorReturn(this, (MDCDismissibleDrawerFoundation.__proto__ || Object.getPrototypeOf(MDCDismissibleDrawerFoundation)).call(this, _extends(MDCDismissibleDrawerFoundation.defaultAdapter, adapter)));
  5400. _this.animationFrame_ = 0;
  5401. /** @private {number} */
  5402. _this.animationTimer_ = 0;
  5403. return _this;
  5404. }
  5405. _createClass(MDCDismissibleDrawerFoundation, [{
  5406. key: 'destroy',
  5407. value: function destroy() {
  5408. if (this.animationFrame_) {
  5409. cancelAnimationFrame(this.animationFrame_);
  5410. }
  5411. if (this.animationTimer_) {
  5412. clearTimeout(this.animationTimer_);
  5413. }
  5414. }
  5415. /**
  5416. * Function to open the drawer.
  5417. */
  5418. }, {
  5419. key: 'open',
  5420. value: function open() {
  5421. var _this2 = this;
  5422. if (this.isOpen() || this.isOpening() || this.isClosing()) {
  5423. return;
  5424. }
  5425. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].OPEN);
  5426. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ANIMATE);
  5427. // Wait a frame once display is no longer "none", to establish basis for animation
  5428. this.runNextAnimationFrame_(function () {
  5429. _this2.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].OPENING);
  5430. });
  5431. this.adapter_.saveFocus();
  5432. }
  5433. /**
  5434. * Function to close the drawer.
  5435. */
  5436. }, {
  5437. key: 'close',
  5438. value: function close() {
  5439. if (!this.isOpen() || this.isOpening() || this.isClosing()) {
  5440. return;
  5441. }
  5442. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CLOSING);
  5443. }
  5444. /**
  5445. * Extension point for when drawer finishes open animation.
  5446. * @protected
  5447. */
  5448. }, {
  5449. key: 'opened',
  5450. value: function opened() {}
  5451. /**
  5452. * Extension point for when drawer finishes close animation.
  5453. * @protected
  5454. */
  5455. }, {
  5456. key: 'closed',
  5457. value: function closed() {}
  5458. /**
  5459. * Returns true if drawer is in open state.
  5460. * @return {boolean}
  5461. */
  5462. }, {
  5463. key: 'isOpen',
  5464. value: function isOpen() {
  5465. return this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].OPEN);
  5466. }
  5467. /**
  5468. * Returns true if drawer is animating open.
  5469. * @return {boolean}
  5470. */
  5471. }, {
  5472. key: 'isOpening',
  5473. value: function isOpening() {
  5474. return this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].OPENING);
  5475. }
  5476. /**
  5477. * Returns true if drawer is animating closed.
  5478. * @return {boolean}
  5479. */
  5480. }, {
  5481. key: 'isClosing',
  5482. value: function isClosing() {
  5483. return this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CLOSING);
  5484. }
  5485. /**
  5486. * Keydown handler to close drawer when key is escape.
  5487. * @param evt
  5488. */
  5489. }, {
  5490. key: 'handleKeydown',
  5491. value: function handleKeydown(evt) {
  5492. var keyCode = evt.keyCode,
  5493. key = evt.key;
  5494. var isEscape = key === 'Escape' || keyCode === 27;
  5495. if (isEscape) {
  5496. this.close();
  5497. }
  5498. }
  5499. /**
  5500. * Handles a transition end event on the root element.
  5501. * @param {!Event} evt
  5502. */
  5503. }, {
  5504. key: 'handleTransitionEnd',
  5505. value: function handleTransitionEnd(evt) {
  5506. var OPENING = __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].OPENING,
  5507. CLOSING = __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CLOSING,
  5508. OPEN = __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].OPEN,
  5509. ANIMATE = __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ANIMATE,
  5510. ROOT = __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ROOT;
  5511. // In Edge, transitionend on ripple pseudo-elements yields a target without classList, so check for Element first.
  5512. var isElement = evt.target instanceof Element;
  5513. if (!isElement || !this.adapter_.elementHasClass( /** @type {!Element} */evt.target, ROOT)) {
  5514. return;
  5515. }
  5516. if (this.isClosing()) {
  5517. this.adapter_.removeClass(OPEN);
  5518. this.adapter_.restoreFocus();
  5519. this.closed();
  5520. this.adapter_.notifyClose();
  5521. } else {
  5522. this.adapter_.focusActiveNavigationItem();
  5523. this.opened();
  5524. this.adapter_.notifyOpen();
  5525. }
  5526. this.adapter_.removeClass(ANIMATE);
  5527. this.adapter_.removeClass(OPENING);
  5528. this.adapter_.removeClass(CLOSING);
  5529. }
  5530. /**
  5531. * Runs the given logic on the next animation frame, using setTimeout to factor in Firefox reflow behavior.
  5532. * @param {Function} callback
  5533. * @private
  5534. */
  5535. }, {
  5536. key: 'runNextAnimationFrame_',
  5537. value: function runNextAnimationFrame_(callback) {
  5538. var _this3 = this;
  5539. cancelAnimationFrame(this.animationFrame_);
  5540. this.animationFrame_ = requestAnimationFrame(function () {
  5541. _this3.animationFrame_ = 0;
  5542. clearTimeout(_this3.animationTimer_);
  5543. _this3.animationTimer_ = setTimeout(callback, 0);
  5544. });
  5545. }
  5546. }]);
  5547. return MDCDismissibleDrawerFoundation;
  5548. }(__WEBPACK_IMPORTED_MODULE_1__material_base_foundation__["a" /* default */]);
  5549. /* harmony default export */ __webpack_exports__["a"] = (MDCDismissibleDrawerFoundation);
  5550. /***/ }),
  5551. /* 37 */
  5552. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5553. "use strict";
  5554. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  5555. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  5556. /**
  5557. * @license
  5558. * Copyright 2016 Google Inc.
  5559. *
  5560. * Permission is hereby granted, free of charge, to any person obtaining a copy
  5561. * of this software and associated documentation files (the "Software"), to deal
  5562. * in the Software without restriction, including without limitation the rights
  5563. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  5564. * copies of the Software, and to permit persons to whom the Software is
  5565. * furnished to do so, subject to the following conditions:
  5566. *
  5567. * The above copyright notice and this permission notice shall be included in
  5568. * all copies or substantial portions of the Software.
  5569. *
  5570. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  5571. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  5572. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  5573. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  5574. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  5575. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  5576. * THE SOFTWARE.
  5577. */
  5578. /** @enum {string} */
  5579. var cssClasses = {
  5580. ROOT: 'mdc-drawer',
  5581. DISMISSIBLE: 'mdc-drawer--dismissible',
  5582. MODAL: 'mdc-drawer--modal',
  5583. OPEN: 'mdc-drawer--open',
  5584. ANIMATE: 'mdc-drawer--animate',
  5585. OPENING: 'mdc-drawer--opening',
  5586. CLOSING: 'mdc-drawer--closing'
  5587. };
  5588. /** @enum {string} */
  5589. var strings = {
  5590. APP_CONTENT_SELECTOR: '.mdc-drawer-app-content',
  5591. SCRIM_SELECTOR: '.mdc-drawer-scrim',
  5592. CLOSE_EVENT: 'MDCDrawer:closed',
  5593. OPEN_EVENT: 'MDCDrawer:opened'
  5594. };
  5595. /***/ }),
  5596. /* 38 */
  5597. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5598. "use strict";
  5599. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  5600. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5601. /**
  5602. * @license
  5603. * Copyright 2018 Google Inc.
  5604. *
  5605. * Permission is hereby granted, free of charge, to any person obtaining a copy
  5606. * of this software and associated documentation files (the "Software"), to deal
  5607. * in the Software without restriction, including without limitation the rights
  5608. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  5609. * copies of the Software, and to permit persons to whom the Software is
  5610. * furnished to do so, subject to the following conditions:
  5611. *
  5612. * The above copyright notice and this permission notice shall be included in
  5613. * all copies or substantial portions of the Software.
  5614. *
  5615. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  5616. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  5617. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  5618. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  5619. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  5620. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  5621. * THE SOFTWARE.
  5622. */
  5623. /* eslint no-unused-vars: [2, {"args": "none"}] */
  5624. /**
  5625. * Adapter for MDC List. Provides an interface for managing focus.
  5626. *
  5627. * Additionally, provides type information for the adapter to the Closure
  5628. * compiler.
  5629. *
  5630. * Implement this adapter for your framework of choice to delegate updates to
  5631. * the component in your framework of choice. See architecture documentation
  5632. * for more details.
  5633. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  5634. *
  5635. * @record
  5636. */
  5637. var MDCListAdapter = function () {
  5638. function MDCListAdapter() {
  5639. _classCallCheck(this, MDCListAdapter);
  5640. }
  5641. _createClass(MDCListAdapter, [{
  5642. key: "getListItemCount",
  5643. /** @return {number} */
  5644. value: function getListItemCount() {}
  5645. /**
  5646. * @return {number} */
  5647. }, {
  5648. key: "getFocusedElementIndex",
  5649. value: function getFocusedElementIndex() {}
  5650. /**
  5651. * @param {number} index
  5652. * @param {string} attribute
  5653. * @param {string} value
  5654. */
  5655. }, {
  5656. key: "setAttributeForElementIndex",
  5657. value: function setAttributeForElementIndex(index, attribute, value) {}
  5658. /**
  5659. * @param {number} index
  5660. * @param {string} attribute
  5661. */
  5662. }, {
  5663. key: "removeAttributeForElementIndex",
  5664. value: function removeAttributeForElementIndex(index, attribute) {}
  5665. /**
  5666. * @param {number} index
  5667. * @param {string} className
  5668. */
  5669. }, {
  5670. key: "addClassForElementIndex",
  5671. value: function addClassForElementIndex(index, className) {}
  5672. /**
  5673. * @param {number} index
  5674. * @param {string} className
  5675. */
  5676. }, {
  5677. key: "removeClassForElementIndex",
  5678. value: function removeClassForElementIndex(index, className) {}
  5679. /**
  5680. * Focuses list item at the index specified.
  5681. * @param {number} index
  5682. */
  5683. }, {
  5684. key: "focusItemAtIndex",
  5685. value: function focusItemAtIndex(index) {}
  5686. /**
  5687. * Sets the tabindex to the value specified for all button/a element children of
  5688. * the list item at the index specified.
  5689. * @param {number} listItemIndex
  5690. * @param {number} tabIndexValue
  5691. */
  5692. }, {
  5693. key: "setTabIndexForListItemChildren",
  5694. value: function setTabIndexForListItemChildren(listItemIndex, tabIndexValue) {}
  5695. /**
  5696. * If the given element has an href, follows the link.
  5697. * @param {!Element} ele
  5698. */
  5699. }, {
  5700. key: "followHref",
  5701. value: function followHref(ele) {}
  5702. /**
  5703. * Toggles the checkbox or radio button within a list item.
  5704. * @param {number} index
  5705. * @return {boolean} true if a radio button or checkbox was present.
  5706. */
  5707. }, {
  5708. key: "toggleCheckbox",
  5709. value: function toggleCheckbox(index) {}
  5710. }]);
  5711. return MDCListAdapter;
  5712. }();
  5713. /* unused harmony default export */ var _unused_webpack_default_export = (MDCListAdapter);
  5714. /***/ }),
  5715. /* 39 */
  5716. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5717. "use strict";
  5718. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  5719. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  5720. /**
  5721. * @license
  5722. * Copyright 2018 Google Inc.
  5723. *
  5724. * Permission is hereby granted, free of charge, to any person obtaining a copy
  5725. * of this software and associated documentation files (the "Software"), to deal
  5726. * in the Software without restriction, including without limitation the rights
  5727. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  5728. * copies of the Software, and to permit persons to whom the Software is
  5729. * furnished to do so, subject to the following conditions:
  5730. *
  5731. * The above copyright notice and this permission notice shall be included in
  5732. * all copies or substantial portions of the Software.
  5733. *
  5734. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  5735. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  5736. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  5737. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  5738. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  5739. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  5740. * THE SOFTWARE.
  5741. */
  5742. /** @enum {string} */
  5743. var cssClasses = {
  5744. ROOT: 'mdc-list',
  5745. LIST_ITEM_CLASS: 'mdc-list-item',
  5746. LIST_ITEM_SELECTED_CLASS: 'mdc-list-item--selected',
  5747. LIST_ITEM_ACTIVATED_CLASS: 'mdc-list-item--activated'
  5748. };
  5749. /** @enum {string} */
  5750. var strings = {
  5751. ARIA_ORIENTATION: 'aria-orientation',
  5752. ARIA_ORIENTATION_HORIZONTAL: 'horizontal',
  5753. ARIA_SELECTED: 'aria-selected',
  5754. CHECKBOX_RADIO_SELECTOR: 'input[type="checkbox"]:not(:disabled), input[type="radio"]:not(:disabled)',
  5755. CHILD_ELEMENTS_TO_TOGGLE_TABINDEX: '.' + cssClasses.LIST_ITEM_CLASS + ' button:not(:disabled),\n .' + cssClasses.LIST_ITEM_CLASS + ' a',
  5756. 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)',
  5757. ENABLED_ITEMS_SELECTOR: '.mdc-list-item:not(.mdc-list-item--disabled)'
  5758. };
  5759. /***/ }),
  5760. /* 40 */
  5761. /***/ (function(module, exports, __webpack_require__) {
  5762. var tabbable = __webpack_require__(85);
  5763. var xtend = __webpack_require__(86);
  5764. var listeningFocusTrap = null;
  5765. function focusTrap(element, userOptions) {
  5766. var doc = document;
  5767. var container =
  5768. typeof element === 'string' ? doc.querySelector(element) : element;
  5769. var config = xtend(
  5770. {
  5771. returnFocusOnDeactivate: true,
  5772. escapeDeactivates: true
  5773. },
  5774. userOptions
  5775. );
  5776. var state = {
  5777. firstTabbableNode: null,
  5778. lastTabbableNode: null,
  5779. nodeFocusedBeforeActivation: null,
  5780. mostRecentlyFocusedNode: null,
  5781. active: false,
  5782. paused: false
  5783. };
  5784. var trap = {
  5785. activate: activate,
  5786. deactivate: deactivate,
  5787. pause: pause,
  5788. unpause: unpause
  5789. };
  5790. return trap;
  5791. function activate(activateOptions) {
  5792. if (state.active) return;
  5793. updateTabbableNodes();
  5794. state.active = true;
  5795. state.paused = false;
  5796. state.nodeFocusedBeforeActivation = doc.activeElement;
  5797. var onActivate =
  5798. activateOptions && activateOptions.onActivate
  5799. ? activateOptions.onActivate
  5800. : config.onActivate;
  5801. if (onActivate) {
  5802. onActivate();
  5803. }
  5804. addListeners();
  5805. return trap;
  5806. }
  5807. function deactivate(deactivateOptions) {
  5808. if (!state.active) return;
  5809. removeListeners();
  5810. state.active = false;
  5811. state.paused = false;
  5812. var onDeactivate =
  5813. deactivateOptions && deactivateOptions.onDeactivate !== undefined
  5814. ? deactivateOptions.onDeactivate
  5815. : config.onDeactivate;
  5816. if (onDeactivate) {
  5817. onDeactivate();
  5818. }
  5819. var returnFocus =
  5820. deactivateOptions && deactivateOptions.returnFocus !== undefined
  5821. ? deactivateOptions.returnFocus
  5822. : config.returnFocusOnDeactivate;
  5823. if (returnFocus) {
  5824. delay(function() {
  5825. tryFocus(state.nodeFocusedBeforeActivation);
  5826. });
  5827. }
  5828. return trap;
  5829. }
  5830. function pause() {
  5831. if (state.paused || !state.active) return;
  5832. state.paused = true;
  5833. removeListeners();
  5834. }
  5835. function unpause() {
  5836. if (!state.paused || !state.active) return;
  5837. state.paused = false;
  5838. addListeners();
  5839. }
  5840. function addListeners() {
  5841. if (!state.active) return;
  5842. // There can be only one listening focus trap at a time
  5843. if (listeningFocusTrap) {
  5844. listeningFocusTrap.pause();
  5845. }
  5846. listeningFocusTrap = trap;
  5847. updateTabbableNodes();
  5848. // Delay ensures that the focused element doesn't capture the event
  5849. // that caused the focus trap activation.
  5850. delay(function() {
  5851. tryFocus(getInitialFocusNode());
  5852. });
  5853. doc.addEventListener('focusin', checkFocusIn, true);
  5854. doc.addEventListener('mousedown', checkPointerDown, true);
  5855. doc.addEventListener('touchstart', checkPointerDown, true);
  5856. doc.addEventListener('click', checkClick, true);
  5857. doc.addEventListener('keydown', checkKey, true);
  5858. return trap;
  5859. }
  5860. function removeListeners() {
  5861. if (!state.active || listeningFocusTrap !== trap) return;
  5862. doc.removeEventListener('focusin', checkFocusIn, true);
  5863. doc.removeEventListener('mousedown', checkPointerDown, true);
  5864. doc.removeEventListener('touchstart', checkPointerDown, true);
  5865. doc.removeEventListener('click', checkClick, true);
  5866. doc.removeEventListener('keydown', checkKey, true);
  5867. listeningFocusTrap = null;
  5868. return trap;
  5869. }
  5870. function getNodeForOption(optionName) {
  5871. var optionValue = config[optionName];
  5872. var node = optionValue;
  5873. if (!optionValue) {
  5874. return null;
  5875. }
  5876. if (typeof optionValue === 'string') {
  5877. node = doc.querySelector(optionValue);
  5878. if (!node) {
  5879. throw new Error('`' + optionName + '` refers to no known node');
  5880. }
  5881. }
  5882. if (typeof optionValue === 'function') {
  5883. node = optionValue();
  5884. if (!node) {
  5885. throw new Error('`' + optionName + '` did not return a node');
  5886. }
  5887. }
  5888. return node;
  5889. }
  5890. function getInitialFocusNode() {
  5891. var node;
  5892. if (getNodeForOption('initialFocus') !== null) {
  5893. node = getNodeForOption('initialFocus');
  5894. } else if (container.contains(doc.activeElement)) {
  5895. node = doc.activeElement;
  5896. } else {
  5897. node = state.firstTabbableNode || getNodeForOption('fallbackFocus');
  5898. }
  5899. if (!node) {
  5900. throw new Error(
  5901. "You can't have a focus-trap without at least one focusable element"
  5902. );
  5903. }
  5904. return node;
  5905. }
  5906. // This needs to be done on mousedown and touchstart instead of click
  5907. // so that it precedes the focus event.
  5908. function checkPointerDown(e) {
  5909. if (container.contains(e.target)) return;
  5910. if (config.clickOutsideDeactivates) {
  5911. deactivate({
  5912. returnFocus: !tabbable.isFocusable(e.target)
  5913. });
  5914. } else {
  5915. e.preventDefault();
  5916. }
  5917. }
  5918. // In case focus escapes the trap for some strange reason, pull it back in.
  5919. function checkFocusIn(e) {
  5920. // In Firefox when you Tab out of an iframe the Document is briefly focused.
  5921. if (container.contains(e.target) || e.target instanceof Document) {
  5922. return;
  5923. }
  5924. e.stopImmediatePropagation();
  5925. tryFocus(state.mostRecentlyFocusedNode || getInitialFocusNode());
  5926. }
  5927. function checkKey(e) {
  5928. if (config.escapeDeactivates !== false && isEscapeEvent(e)) {
  5929. e.preventDefault();
  5930. deactivate();
  5931. return;
  5932. }
  5933. if (isTabEvent(e)) {
  5934. checkTab(e);
  5935. return;
  5936. }
  5937. }
  5938. // Hijack Tab events on the first and last focusable nodes of the trap,
  5939. // in order to prevent focus from escaping. If it escapes for even a
  5940. // moment it can end up scrolling the page and causing confusion so we
  5941. // kind of need to capture the action at the keydown phase.
  5942. function checkTab(e) {
  5943. updateTabbableNodes();
  5944. if (e.shiftKey && e.target === state.firstTabbableNode) {
  5945. e.preventDefault();
  5946. tryFocus(state.lastTabbableNode);
  5947. return;
  5948. }
  5949. if (!e.shiftKey && e.target === state.lastTabbableNode) {
  5950. e.preventDefault();
  5951. tryFocus(state.firstTabbableNode);
  5952. return;
  5953. }
  5954. }
  5955. function checkClick(e) {
  5956. if (config.clickOutsideDeactivates) return;
  5957. if (container.contains(e.target)) return;
  5958. e.preventDefault();
  5959. e.stopImmediatePropagation();
  5960. }
  5961. function updateTabbableNodes() {
  5962. var tabbableNodes = tabbable(container);
  5963. state.firstTabbableNode = tabbableNodes[0] || getInitialFocusNode();
  5964. state.lastTabbableNode =
  5965. tabbableNodes[tabbableNodes.length - 1] || getInitialFocusNode();
  5966. }
  5967. function tryFocus(node) {
  5968. if (node === doc.activeElement) return;
  5969. if (!node || !node.focus) {
  5970. tryFocus(getInitialFocusNode());
  5971. return;
  5972. }
  5973. node.focus();
  5974. state.mostRecentlyFocusedNode = node;
  5975. if (isSelectableInput(node)) {
  5976. node.select();
  5977. }
  5978. }
  5979. }
  5980. function isSelectableInput(node) {
  5981. return (
  5982. node.tagName &&
  5983. node.tagName.toLowerCase() === 'input' &&
  5984. typeof node.select === 'function'
  5985. );
  5986. }
  5987. function isEscapeEvent(e) {
  5988. return e.key === 'Escape' || e.key === 'Esc' || e.keyCode === 27;
  5989. }
  5990. function isTabEvent(e) {
  5991. return e.key === 'Tab' || e.keyCode === 9;
  5992. }
  5993. function delay(fn) {
  5994. return setTimeout(fn, 0);
  5995. }
  5996. module.exports = focusTrap;
  5997. /***/ }),
  5998. /* 41 */
  5999. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6000. "use strict";
  6001. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  6002. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6003. /**
  6004. * @license
  6005. * Copyright 2017 Google Inc.
  6006. *
  6007. * Permission is hereby granted, free of charge, to any person obtaining a copy
  6008. * of this software and associated documentation files (the "Software"), to deal
  6009. * in the Software without restriction, including without limitation the rights
  6010. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  6011. * copies of the Software, and to permit persons to whom the Software is
  6012. * furnished to do so, subject to the following conditions:
  6013. *
  6014. * The above copyright notice and this permission notice shall be included in
  6015. * all copies or substantial portions of the Software.
  6016. *
  6017. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  6018. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  6019. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  6020. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  6021. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  6022. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  6023. * THE SOFTWARE.
  6024. */
  6025. /* eslint no-unused-vars: [2, {"args": "none"}] */
  6026. /**
  6027. * Adapter for MDC Floating Label.
  6028. *
  6029. * Defines the shape of the adapter expected by the foundation. Implement this
  6030. * adapter to integrate the floating label into your framework. See
  6031. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  6032. * for more information.
  6033. *
  6034. * @record
  6035. */
  6036. var MDCFloatingLabelAdapter = function () {
  6037. function MDCFloatingLabelAdapter() {
  6038. _classCallCheck(this, MDCFloatingLabelAdapter);
  6039. }
  6040. _createClass(MDCFloatingLabelAdapter, [{
  6041. key: "addClass",
  6042. /**
  6043. * Adds a class to the label element.
  6044. * @param {string} className
  6045. */
  6046. value: function addClass(className) {}
  6047. /**
  6048. * Removes a class from the label element.
  6049. * @param {string} className
  6050. */
  6051. }, {
  6052. key: "removeClass",
  6053. value: function removeClass(className) {}
  6054. /**
  6055. * Returns the width of the label element.
  6056. * @return {number}
  6057. */
  6058. }, {
  6059. key: "getWidth",
  6060. value: function getWidth() {}
  6061. /**
  6062. * Registers an event listener on the root element for a given event.
  6063. * @param {string} evtType
  6064. * @param {function(!Event): undefined} handler
  6065. */
  6066. }, {
  6067. key: "registerInteractionHandler",
  6068. value: function registerInteractionHandler(evtType, handler) {}
  6069. /**
  6070. * Deregisters an event listener on the root element for a given event.
  6071. * @param {string} evtType
  6072. * @param {function(!Event): undefined} handler
  6073. */
  6074. }, {
  6075. key: "deregisterInteractionHandler",
  6076. value: function deregisterInteractionHandler(evtType, handler) {}
  6077. }]);
  6078. return MDCFloatingLabelAdapter;
  6079. }();
  6080. /* unused harmony default export */ var _unused_webpack_default_export = (MDCFloatingLabelAdapter);
  6081. /***/ }),
  6082. /* 42 */
  6083. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6084. "use strict";
  6085. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  6086. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6087. /**
  6088. * @license
  6089. * Copyright 2018 Google Inc.
  6090. *
  6091. * Permission is hereby granted, free of charge, to any person obtaining a copy
  6092. * of this software and associated documentation files (the "Software"), to deal
  6093. * in the Software without restriction, including without limitation the rights
  6094. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  6095. * copies of the Software, and to permit persons to whom the Software is
  6096. * furnished to do so, subject to the following conditions:
  6097. *
  6098. * The above copyright notice and this permission notice shall be included in
  6099. * all copies or substantial portions of the Software.
  6100. *
  6101. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  6102. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  6103. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  6104. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  6105. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  6106. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  6107. * THE SOFTWARE.
  6108. */
  6109. /* eslint no-unused-vars: [2, {"args": "none"}] */
  6110. /**
  6111. * Adapter for MDC TextField Line Ripple.
  6112. *
  6113. * Defines the shape of the adapter expected by the foundation. Implement this
  6114. * adapter to integrate the line ripple into your framework. See
  6115. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  6116. * for more information.
  6117. *
  6118. * @record
  6119. */
  6120. var MDCLineRippleAdapter = function () {
  6121. function MDCLineRippleAdapter() {
  6122. _classCallCheck(this, MDCLineRippleAdapter);
  6123. }
  6124. _createClass(MDCLineRippleAdapter, [{
  6125. key: "addClass",
  6126. /**
  6127. * Adds a class to the line ripple element.
  6128. * @param {string} className
  6129. */
  6130. value: function addClass(className) {}
  6131. /**
  6132. * Removes a class from the line ripple element.
  6133. * @param {string} className
  6134. */
  6135. }, {
  6136. key: "removeClass",
  6137. value: function removeClass(className) {}
  6138. /**
  6139. * @param {string} className
  6140. * @return {boolean}
  6141. */
  6142. }, {
  6143. key: "hasClass",
  6144. value: function hasClass(className) {}
  6145. /**
  6146. * Sets the style property with propertyName to value on the root element.
  6147. * @param {string} propertyName
  6148. * @param {string} value
  6149. */
  6150. }, {
  6151. key: "setStyle",
  6152. value: function setStyle(propertyName, value) {}
  6153. /**
  6154. * Registers an event listener on the line ripple element for a given event.
  6155. * @param {string} evtType
  6156. * @param {function(!Event): undefined} handler
  6157. */
  6158. }, {
  6159. key: "registerEventHandler",
  6160. value: function registerEventHandler(evtType, handler) {}
  6161. /**
  6162. * Deregisters an event listener on the line ripple element for a given event.
  6163. * @param {string} evtType
  6164. * @param {function(!Event): undefined} handler
  6165. */
  6166. }, {
  6167. key: "deregisterEventHandler",
  6168. value: function deregisterEventHandler(evtType, handler) {}
  6169. }]);
  6170. return MDCLineRippleAdapter;
  6171. }();
  6172. /* unused harmony default export */ var _unused_webpack_default_export = (MDCLineRippleAdapter);
  6173. /***/ }),
  6174. /* 43 */
  6175. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6176. "use strict";
  6177. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  6178. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCMenu", function() { return MDCMenu; });
  6179. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  6180. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(109);
  6181. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(19);
  6182. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_menu_surface_index__ = __webpack_require__(45);
  6183. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__material_menu_surface_foundation__ = __webpack_require__(20);
  6184. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__material_list_index__ = __webpack_require__(15);
  6185. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCMenuFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__foundation__["a"]; });
  6186. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "AnchorMargin", function() { return __WEBPACK_IMPORTED_MODULE_4__material_menu_surface_foundation__["a"]; });
  6187. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Corner", function() { return __WEBPACK_IMPORTED_MODULE_3__material_menu_surface_index__["Corner"]; });
  6188. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  6189. 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); } };
  6190. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6191. 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; }
  6192. 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; }
  6193. /**
  6194. * @license
  6195. * Copyright 2018 Google Inc.
  6196. *
  6197. * Permission is hereby granted, free of charge, to any person obtaining a copy
  6198. * of this software and associated documentation files (the "Software"), to deal
  6199. * in the Software without restriction, including without limitation the rights
  6200. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  6201. * copies of the Software, and to permit persons to whom the Software is
  6202. * furnished to do so, subject to the following conditions:
  6203. *
  6204. * The above copyright notice and this permission notice shall be included in
  6205. * all copies or substantial portions of the Software.
  6206. *
  6207. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  6208. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  6209. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  6210. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  6211. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  6212. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  6213. * THE SOFTWARE.
  6214. */
  6215. /**
  6216. * @extends MDCComponent<!MDCMenuFoundation>
  6217. */
  6218. var MDCMenu = function (_MDCComponent) {
  6219. _inherits(MDCMenu, _MDCComponent);
  6220. /** @param {...?} args */
  6221. function MDCMenu() {
  6222. var _ref;
  6223. _classCallCheck(this, MDCMenu);
  6224. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  6225. args[_key] = arguments[_key];
  6226. }
  6227. /** @private {!MDCMenuSurface} */
  6228. var _this = _possibleConstructorReturn(this, (_ref = MDCMenu.__proto__ || Object.getPrototypeOf(MDCMenu)).call.apply(_ref, [this].concat(args)));
  6229. _this.menuSurface_;
  6230. /** @private {!MDCList} */
  6231. _this.list_;
  6232. /** @private {!Function} */
  6233. _this.handleKeydown_;
  6234. /** @private {!Function} */
  6235. _this.handleClick_;
  6236. /** @private {!Function} */
  6237. _this.afterOpenedCallback_;
  6238. return _this;
  6239. }
  6240. /**
  6241. * @param {!HTMLElement} root
  6242. * @return {!MDCMenu}
  6243. */
  6244. _createClass(MDCMenu, [{
  6245. key: 'initialize',
  6246. value: function initialize() {
  6247. var menuSurfaceFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (el) {
  6248. return new __WEBPACK_IMPORTED_MODULE_3__material_menu_surface_index__["MDCMenuSurface"](el);
  6249. };
  6250. var listFactory = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (el) {
  6251. return new __WEBPACK_IMPORTED_MODULE_5__material_list_index__["MDCList"](el);
  6252. };
  6253. this.menuSurface_ = menuSurfaceFactory(this.root_);
  6254. var list = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].LIST_SELECTOR);
  6255. if (list) {
  6256. this.list_ = listFactory(list);
  6257. this.list_.wrapFocus = true;
  6258. }
  6259. }
  6260. }, {
  6261. key: 'initialSyncWithDOM',
  6262. value: function initialSyncWithDOM() {
  6263. var _this2 = this;
  6264. this.afterOpenedCallback_ = function () {
  6265. return _this2.handleAfterOpened_();
  6266. };
  6267. this.handleKeydown_ = function (evt) {
  6268. return _this2.foundation_.handleKeydown(evt);
  6269. };
  6270. this.handleClick_ = function (evt) {
  6271. return _this2.foundation_.handleClick(evt);
  6272. };
  6273. this.menuSurface_.listen(__WEBPACK_IMPORTED_MODULE_4__material_menu_surface_foundation__["b" /* MDCMenuSurfaceFoundation */].strings.OPENED_EVENT, this.afterOpenedCallback_);
  6274. this.listen('keydown', this.handleKeydown_);
  6275. this.listen('click', this.handleClick_);
  6276. }
  6277. }, {
  6278. key: 'destroy',
  6279. value: function destroy() {
  6280. if (this.list_) {
  6281. this.list_.destroy();
  6282. }
  6283. this.menuSurface_.destroy();
  6284. this.menuSurface_.unlisten(__WEBPACK_IMPORTED_MODULE_4__material_menu_surface_foundation__["b" /* MDCMenuSurfaceFoundation */].strings.OPENED_EVENT, this.afterOpenedCallback_);
  6285. this.unlisten('keydown', this.handleKeydown_);
  6286. this.unlisten('click', this.handleClick_);
  6287. _get(MDCMenu.prototype.__proto__ || Object.getPrototypeOf(MDCMenu.prototype), 'destroy', this).call(this);
  6288. }
  6289. /** @return {boolean} */
  6290. }, {
  6291. key: 'setAnchorCorner',
  6292. /**
  6293. * @param {!Corner} corner Default anchor corner alignment of top-left
  6294. * menu corner.
  6295. */
  6296. value: function setAnchorCorner(corner) {
  6297. this.menuSurface_.setAnchorCorner(corner);
  6298. }
  6299. /**
  6300. * @param {!AnchorMargin} margin
  6301. */
  6302. }, {
  6303. key: 'setAnchorMargin',
  6304. value: function setAnchorMargin(margin) {
  6305. this.menuSurface_.setAnchorMargin(margin);
  6306. }
  6307. /**
  6308. * Return the items within the menu. Note that this only contains the set of elements within
  6309. * the items container that are proper list items, and not supplemental / presentational DOM
  6310. * elements.
  6311. * @return {!Array<!HTMLElement>}
  6312. */
  6313. }, {
  6314. key: 'getOptionByIndex',
  6315. /**
  6316. * Return the item within the menu at the index specified.
  6317. * @param {number} index
  6318. * @return {?HTMLElement}
  6319. */
  6320. value: function getOptionByIndex(index) {
  6321. var items = this.items;
  6322. if (index < items.length) {
  6323. return this.items[index];
  6324. } else {
  6325. return null;
  6326. }
  6327. }
  6328. /** @param {boolean} quickOpen */
  6329. }, {
  6330. key: 'setFixedPosition',
  6331. /** @param {boolean} isFixed */
  6332. value: function setFixedPosition(isFixed) {
  6333. this.menuSurface_.setFixedPosition(isFixed);
  6334. }
  6335. }, {
  6336. key: 'hoistMenuToBody',
  6337. value: function hoistMenuToBody() {
  6338. this.menuSurface_.hoistMenuToBody();
  6339. }
  6340. /** @param {boolean} isHoisted */
  6341. }, {
  6342. key: 'setIsHoisted',
  6343. value: function setIsHoisted(isHoisted) {
  6344. this.menuSurface_.setIsHoisted(isHoisted);
  6345. }
  6346. /**
  6347. * @param {number} x
  6348. * @param {number} y
  6349. */
  6350. }, {
  6351. key: 'setAbsolutePosition',
  6352. value: function setAbsolutePosition(x, y) {
  6353. this.menuSurface_.setAbsolutePosition(x, y);
  6354. }
  6355. /**
  6356. * Sets the element that the menu-surface is anchored to.
  6357. * @param {!HTMLElement} element
  6358. */
  6359. }, {
  6360. key: 'setAnchorElement',
  6361. value: function setAnchorElement(element) {
  6362. this.menuSurface_.anchorElement = element;
  6363. }
  6364. }, {
  6365. key: 'handleAfterOpened_',
  6366. value: function handleAfterOpened_() {
  6367. var list = this.items;
  6368. if (list.length > 0) {
  6369. list[0].focus();
  6370. }
  6371. }
  6372. /** @return {!MDCMenuFoundation} */
  6373. }, {
  6374. key: 'getDefaultFoundation',
  6375. value: function getDefaultFoundation() {
  6376. var _this3 = this;
  6377. return new __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* MDCMenuFoundation */]({
  6378. addClassToElementAtIndex: function addClassToElementAtIndex(index, className) {
  6379. var list = _this3.items;
  6380. list[index].classList.add(className);
  6381. },
  6382. removeClassFromElementAtIndex: function removeClassFromElementAtIndex(index, className) {
  6383. var list = _this3.items;
  6384. list[index].classList.remove(className);
  6385. },
  6386. addAttributeToElementAtIndex: function addAttributeToElementAtIndex(index, attr, value) {
  6387. var list = _this3.items;
  6388. list[index].setAttribute(attr, value);
  6389. },
  6390. removeAttributeFromElementAtIndex: function removeAttributeFromElementAtIndex(index, attr) {
  6391. var list = _this3.items;
  6392. list[index].removeAttribute(attr);
  6393. },
  6394. elementContainsClass: function elementContainsClass(element, className) {
  6395. return element.classList.contains(className);
  6396. },
  6397. closeSurface: function closeSurface() {
  6398. return _this3.open = false;
  6399. },
  6400. getElementIndex: function getElementIndex(element) {
  6401. return _this3.items.indexOf(element);
  6402. },
  6403. getParentElement: function getParentElement(element) {
  6404. return element.parentElement;
  6405. },
  6406. getSelectedElementIndex: function getSelectedElementIndex(selectionGroup) {
  6407. return _this3.items.indexOf(selectionGroup.querySelector('.' + __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].MENU_SELECTED_LIST_ITEM));
  6408. },
  6409. notifySelected: function notifySelected(evtData) {
  6410. return _this3.emit(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].SELECTED_EVENT, {
  6411. index: evtData.index,
  6412. item: _this3.items[evtData.index]
  6413. });
  6414. }
  6415. });
  6416. }
  6417. }, {
  6418. key: 'open',
  6419. get: function get() {
  6420. return this.menuSurface_.open;
  6421. }
  6422. /** @param {boolean} value */
  6423. ,
  6424. set: function set(value) {
  6425. this.menuSurface_.open = value;
  6426. }
  6427. }, {
  6428. key: 'items',
  6429. get: function get() {
  6430. return this.list_.listElements;
  6431. }
  6432. }, {
  6433. key: 'quickOpen',
  6434. set: function set(quickOpen) {
  6435. this.menuSurface_.quickOpen = quickOpen;
  6436. }
  6437. }], [{
  6438. key: 'attachTo',
  6439. value: function attachTo(root) {
  6440. return new MDCMenu(root);
  6441. }
  6442. }]);
  6443. return MDCMenu;
  6444. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  6445. /***/ }),
  6446. /* 44 */
  6447. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6448. "use strict";
  6449. /* unused harmony export MDCMenuSurfaceAdapter */
  6450. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  6451. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6452. /**
  6453. * @license
  6454. * Copyright 2018 Google Inc.
  6455. *
  6456. * Permission is hereby granted, free of charge, to any person obtaining a copy
  6457. * of this software and associated documentation files (the "Software"), to deal
  6458. * in the Software without restriction, including without limitation the rights
  6459. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  6460. * copies of the Software, and to permit persons to whom the Software is
  6461. * furnished to do so, subject to the following conditions:
  6462. *
  6463. * The above copyright notice and this permission notice shall be included in
  6464. * all copies or substantial portions of the Software.
  6465. *
  6466. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  6467. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  6468. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  6469. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  6470. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  6471. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  6472. * THE SOFTWARE.
  6473. */
  6474. /* eslint no-unused-vars: [2, {"args": "none"}] */
  6475. /**
  6476. * Adapter for MDCMenuSurface. Provides an interface for managing
  6477. * - classes
  6478. * - dom
  6479. * - focus
  6480. * - position
  6481. * - dimensions
  6482. * - event handlers
  6483. *
  6484. * Additionally, provides type information for the adapter to the Closure
  6485. * compiler.
  6486. *
  6487. * Implement this adapter for your framework of choice to delegate updates to
  6488. * the component in your framework of choice. See architecture documentation
  6489. * for more details.
  6490. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  6491. *
  6492. * @record
  6493. */
  6494. var MDCMenuSurfaceAdapter = function () {
  6495. function MDCMenuSurfaceAdapter() {
  6496. _classCallCheck(this, MDCMenuSurfaceAdapter);
  6497. }
  6498. _createClass(MDCMenuSurfaceAdapter, [{
  6499. key: "addClass",
  6500. /** @param {string} className */
  6501. value: function addClass(className) {}
  6502. /** @param {string} className */
  6503. }, {
  6504. key: "removeClass",
  6505. value: function removeClass(className) {}
  6506. /**
  6507. * @param {string} className
  6508. * @return {boolean}
  6509. */
  6510. }, {
  6511. key: "hasClass",
  6512. value: function hasClass(className) {}
  6513. /** @return {boolean} */
  6514. }, {
  6515. key: "hasAnchor",
  6516. value: function hasAnchor() {}
  6517. /** Emits an event when the menu surface is closed. */
  6518. }, {
  6519. key: "notifyClose",
  6520. value: function notifyClose() {}
  6521. /** Emits an event when the menu surface is opened. */
  6522. }, {
  6523. key: "notifyOpen",
  6524. value: function notifyOpen() {}
  6525. /**
  6526. * @return {boolean}
  6527. * @param {EventTarget} el
  6528. */
  6529. }, {
  6530. key: "isElementInContainer",
  6531. value: function isElementInContainer(el) {}
  6532. /** @return {boolean} */
  6533. }, {
  6534. key: "isRtl",
  6535. value: function isRtl() {}
  6536. /** @param {string} origin */
  6537. }, {
  6538. key: "setTransformOrigin",
  6539. value: function setTransformOrigin(origin) {}
  6540. /** @return {boolean} */
  6541. }, {
  6542. key: "isFocused",
  6543. value: function isFocused() {}
  6544. /** Saves the element that was focused before the menu surface was opened. */
  6545. }, {
  6546. key: "saveFocus",
  6547. value: function saveFocus() {}
  6548. /** Restores focus to the element that was focused before the menu surface was opened. */
  6549. }, {
  6550. key: "restoreFocus",
  6551. value: function restoreFocus() {}
  6552. /** @return {boolean} */
  6553. }, {
  6554. key: "isFirstElementFocused",
  6555. value: function isFirstElementFocused() {}
  6556. /** @return {boolean} */
  6557. }, {
  6558. key: "isLastElementFocused",
  6559. value: function isLastElementFocused() {}
  6560. /** Focuses the first focusable element in the menu-surface. */
  6561. }, {
  6562. key: "focusFirstElement",
  6563. value: function focusFirstElement() {}
  6564. /** Focuses the first focusable element in the menu-surface. */
  6565. }, {
  6566. key: "focusLastElement",
  6567. value: function focusLastElement() {}
  6568. /** @return {!{width: number, height: number}} */
  6569. }, {
  6570. key: "getInnerDimensions",
  6571. value: function getInnerDimensions() {}
  6572. /** @return {!{width: number, height: number, top: number, right: number, bottom: number, left: number}} */
  6573. }, {
  6574. key: "getAnchorDimensions",
  6575. value: function getAnchorDimensions() {}
  6576. /** @return {!{ width: number, height: number }} */
  6577. }, {
  6578. key: "getWindowDimensions",
  6579. value: function getWindowDimensions() {}
  6580. /** @return {!{ width: number, height: number }} */
  6581. }, {
  6582. key: "getBodyDimensions",
  6583. value: function getBodyDimensions() {}
  6584. /** @return {!{ width: number, height: number }} */
  6585. }, {
  6586. key: "getWindowScroll",
  6587. value: function getWindowScroll() {}
  6588. /** @param {!{
  6589. * top: (string|undefined),
  6590. * right: (string|undefined),
  6591. * bottom: (string|undefined),
  6592. * left: (string|undefined)
  6593. * }} position */
  6594. }, {
  6595. key: "setPosition",
  6596. value: function setPosition(position) {}
  6597. /** @param {string} height */
  6598. }, {
  6599. key: "setMaxHeight",
  6600. value: function setMaxHeight(height) {}
  6601. }]);
  6602. return MDCMenuSurfaceAdapter;
  6603. }();
  6604. /***/ }),
  6605. /* 45 */
  6606. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6607. "use strict";
  6608. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  6609. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCMenuSurface", function() { return MDCMenuSurface; });
  6610. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  6611. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util__ = __webpack_require__(111);
  6612. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(20);
  6613. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__adapter__ = __webpack_require__(44);
  6614. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__constants__ = __webpack_require__(21);
  6615. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCMenuSurfaceFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["b"]; });
  6616. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "AnchorMargin", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  6617. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Corner", function() { return __WEBPACK_IMPORTED_MODULE_4__constants__["a"]; });
  6618. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "CornerBit", function() { return __WEBPACK_IMPORTED_MODULE_4__constants__["b"]; });
  6619. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "util", function() { return __WEBPACK_IMPORTED_MODULE_1__util__; });
  6620. 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; };
  6621. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  6622. 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); } };
  6623. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6624. 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; }
  6625. 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; }
  6626. /**
  6627. * @license
  6628. * Copyright 2018 Google Inc.
  6629. *
  6630. * Permission is hereby granted, free of charge, to any person obtaining a copy
  6631. * of this software and associated documentation files (the "Software"), to deal
  6632. * in the Software without restriction, including without limitation the rights
  6633. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  6634. * copies of the Software, and to permit persons to whom the Software is
  6635. * furnished to do so, subject to the following conditions:
  6636. *
  6637. * The above copyright notice and this permission notice shall be included in
  6638. * all copies or substantial portions of the Software.
  6639. *
  6640. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  6641. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  6642. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  6643. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  6644. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  6645. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  6646. * THE SOFTWARE.
  6647. */
  6648. /**
  6649. * @extends MDCComponent<!MDCMenuSurfaceFoundation>
  6650. */
  6651. var MDCMenuSurface = function (_MDCComponent) {
  6652. _inherits(MDCMenuSurface, _MDCComponent);
  6653. /** @param {...?} args */
  6654. function MDCMenuSurface() {
  6655. var _ref;
  6656. _classCallCheck(this, MDCMenuSurface);
  6657. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  6658. args[_key] = arguments[_key];
  6659. }
  6660. /** @private {!Element} */
  6661. var _this = _possibleConstructorReturn(this, (_ref = MDCMenuSurface.__proto__ || Object.getPrototypeOf(MDCMenuSurface)).call.apply(_ref, [this].concat(args)));
  6662. _this.previousFocus_;
  6663. /** @private {!Element} */
  6664. _this.anchorElement;
  6665. /** @private {Element} */
  6666. _this.firstFocusableElement_;
  6667. /** @private {Element} */
  6668. _this.lastFocusableElement_;
  6669. /** @private {!Function} */
  6670. _this.handleKeydown_;
  6671. /** @private {!Function} */
  6672. _this.handleBodyClick_;
  6673. /** @private {!Function} */
  6674. _this.registerBodyClickListener_;
  6675. /** @private {!Function} */
  6676. _this.deregisterBodyClickListener_;
  6677. return _this;
  6678. }
  6679. /**
  6680. * @param {!Element} root
  6681. * @return {!MDCMenuSurface}
  6682. */
  6683. _createClass(MDCMenuSurface, [{
  6684. key: 'initialSyncWithDOM',
  6685. value: function initialSyncWithDOM() {
  6686. var _this2 = this;
  6687. if (this.root_.parentElement && this.root_.parentElement.classList.contains(__WEBPACK_IMPORTED_MODULE_4__constants__["c" /* cssClasses */].ANCHOR)) {
  6688. this.anchorElement = this.root_.parentElement;
  6689. }
  6690. if (this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_4__constants__["c" /* cssClasses */].FIXED)) {
  6691. this.setFixedPosition(true);
  6692. }
  6693. this.handleKeydown_ = function (evt) {
  6694. return _this2.foundation_.handleKeydown(evt);
  6695. };
  6696. this.handleBodyClick_ = function (evt) {
  6697. return _this2.foundation_.handleBodyClick(evt);
  6698. };
  6699. this.registerBodyClickListener_ = function () {
  6700. return document.body.addEventListener('click', _this2.handleBodyClick_);
  6701. };
  6702. this.deregisterBodyClickListener_ = function () {
  6703. return document.body.removeEventListener('click', _this2.handleBodyClick_);
  6704. };
  6705. this.root_.addEventListener('keydown', this.handleKeydown_);
  6706. this.root_.addEventListener(__WEBPACK_IMPORTED_MODULE_4__constants__["e" /* strings */].OPENED_EVENT, this.registerBodyClickListener_);
  6707. this.root_.addEventListener(__WEBPACK_IMPORTED_MODULE_4__constants__["e" /* strings */].CLOSED_EVENT, this.deregisterBodyClickListener_);
  6708. }
  6709. }, {
  6710. key: 'destroy',
  6711. value: function destroy() {
  6712. this.root_.removeEventListener('keydown', this.handleKeydown_);
  6713. this.root_.removeEventListener(__WEBPACK_IMPORTED_MODULE_4__constants__["e" /* strings */].OPENED_EVENT, this.registerBodyClickListener_);
  6714. this.root_.removeEventListener(__WEBPACK_IMPORTED_MODULE_4__constants__["e" /* strings */].CLOSED_EVENT, this.deregisterBodyClickListener_);
  6715. _get(MDCMenuSurface.prototype.__proto__ || Object.getPrototypeOf(MDCMenuSurface.prototype), 'destroy', this).call(this);
  6716. }
  6717. /** @return {boolean} */
  6718. }, {
  6719. key: 'hoistMenuToBody',
  6720. /**
  6721. * Removes the menu-surface from it's current location and appends it to the
  6722. * body to overcome any overflow:hidden issues.
  6723. */
  6724. value: function hoistMenuToBody() {
  6725. document.body.appendChild(this.root_.parentElement.removeChild(this.root_));
  6726. this.setIsHoisted(true);
  6727. }
  6728. /**
  6729. * Sets the foundation to use page offsets for an positioning when the menu
  6730. * is hoisted to the body.
  6731. * @param {boolean} isHoisted
  6732. */
  6733. }, {
  6734. key: 'setIsHoisted',
  6735. value: function setIsHoisted(isHoisted) {
  6736. this.foundation_.setIsHoisted(isHoisted);
  6737. }
  6738. /**
  6739. * Sets the element that the menu-surface is anchored to.
  6740. * @param {!Element} element
  6741. */
  6742. }, {
  6743. key: 'setMenuSurfaceAnchorElement',
  6744. value: function setMenuSurfaceAnchorElement(element) {
  6745. this.anchorElement = element;
  6746. }
  6747. /**
  6748. * Sets the menu-surface to position: fixed.
  6749. * @param {boolean} isFixed
  6750. */
  6751. }, {
  6752. key: 'setFixedPosition',
  6753. value: function setFixedPosition(isFixed) {
  6754. if (isFixed) {
  6755. this.root_.classList.add(__WEBPACK_IMPORTED_MODULE_4__constants__["c" /* cssClasses */].FIXED);
  6756. } else {
  6757. this.root_.classList.remove(__WEBPACK_IMPORTED_MODULE_4__constants__["c" /* cssClasses */].FIXED);
  6758. }
  6759. this.foundation_.setFixedPosition(isFixed);
  6760. }
  6761. /**
  6762. * Sets the absolute x/y position to position based on. Requires the menu to be hoisted.
  6763. * @param {number} x
  6764. * @param {number} y
  6765. */
  6766. }, {
  6767. key: 'setAbsolutePosition',
  6768. value: function setAbsolutePosition(x, y) {
  6769. this.foundation_.setAbsolutePosition(x, y);
  6770. this.setIsHoisted(true);
  6771. }
  6772. /**
  6773. * @param {!Corner} corner Default anchor corner alignment of top-left
  6774. * surface corner.
  6775. */
  6776. }, {
  6777. key: 'setAnchorCorner',
  6778. value: function setAnchorCorner(corner) {
  6779. this.foundation_.setAnchorCorner(corner);
  6780. }
  6781. /**
  6782. * @param {!AnchorMargin} margin
  6783. */
  6784. }, {
  6785. key: 'setAnchorMargin',
  6786. value: function setAnchorMargin(margin) {
  6787. this.foundation_.setAnchorMargin(margin);
  6788. }
  6789. /** @param {boolean} quickOpen */
  6790. }, {
  6791. key: 'getDefaultFoundation',
  6792. /** @return {!MDCMenuSurfaceFoundation} */
  6793. value: function getDefaultFoundation() {
  6794. var _this3 = this;
  6795. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["b" /* MDCMenuSurfaceFoundation */](
  6796. /** @type {!MDCMenuSurfaceAdapter} */_extends({
  6797. addClass: function addClass(className) {
  6798. return _this3.root_.classList.add(className);
  6799. },
  6800. removeClass: function removeClass(className) {
  6801. return _this3.root_.classList.remove(className);
  6802. },
  6803. hasClass: function hasClass(className) {
  6804. return _this3.root_.classList.contains(className);
  6805. },
  6806. hasAnchor: function hasAnchor() {
  6807. return !!_this3.anchorElement;
  6808. },
  6809. notifyClose: function notifyClose() {
  6810. return _this3.emit(__WEBPACK_IMPORTED_MODULE_2__foundation__["b" /* MDCMenuSurfaceFoundation */].strings.CLOSED_EVENT, {});
  6811. },
  6812. notifyOpen: function notifyOpen() {
  6813. return _this3.emit(__WEBPACK_IMPORTED_MODULE_2__foundation__["b" /* MDCMenuSurfaceFoundation */].strings.OPENED_EVENT, {});
  6814. },
  6815. isElementInContainer: function isElementInContainer(el) {
  6816. return _this3.root_ === el || _this3.root_.contains(el);
  6817. },
  6818. isRtl: function isRtl() {
  6819. return getComputedStyle(_this3.root_).getPropertyValue('direction') === 'rtl';
  6820. },
  6821. setTransformOrigin: function setTransformOrigin(origin) {
  6822. _this3.root_.style[__WEBPACK_IMPORTED_MODULE_1__util__["getTransformPropertyName"](window) + '-origin'] = origin;
  6823. }
  6824. }, this.getFocusAdapterMethods_(), this.getDimensionAdapterMethods_()));
  6825. }
  6826. /**
  6827. * @return {!{
  6828. * isFocused: function(): boolean,
  6829. * saveFocus: function(),
  6830. * restoreFocus: function(),
  6831. * isFirstElementFocused: function(): boolean,
  6832. * isLastElementFocused: function(): boolean,
  6833. * focusFirstElement: function(),
  6834. * focusLastElement: function(),
  6835. * }}
  6836. * @private
  6837. */
  6838. }, {
  6839. key: 'getFocusAdapterMethods_',
  6840. value: function getFocusAdapterMethods_() {
  6841. var _this4 = this;
  6842. return {
  6843. isFocused: function isFocused() {
  6844. return document.activeElement === _this4.root_;
  6845. },
  6846. saveFocus: function saveFocus() {
  6847. _this4.previousFocus_ = document.activeElement;
  6848. },
  6849. restoreFocus: function restoreFocus() {
  6850. if (_this4.root_.contains(document.activeElement)) {
  6851. if (_this4.previousFocus_ && _this4.previousFocus_.focus) {
  6852. _this4.previousFocus_.focus();
  6853. }
  6854. }
  6855. },
  6856. isFirstElementFocused: function isFirstElementFocused() {
  6857. return _this4.firstFocusableElement_ && _this4.firstFocusableElement_ === document.activeElement;
  6858. },
  6859. isLastElementFocused: function isLastElementFocused() {
  6860. return _this4.lastFocusableElement_ && _this4.lastFocusableElement_ === document.activeElement;
  6861. },
  6862. focusFirstElement: function focusFirstElement() {
  6863. return _this4.firstFocusableElement_ && _this4.firstFocusableElement_.focus && _this4.firstFocusableElement_.focus();
  6864. },
  6865. focusLastElement: function focusLastElement() {
  6866. return _this4.lastFocusableElement_ && _this4.lastFocusableElement_.focus && _this4.lastFocusableElement_.focus();
  6867. }
  6868. };
  6869. }
  6870. /**
  6871. * @return {!{
  6872. * getInnerDimensions: function(),
  6873. * getAnchorDimensions: function(): (HTMLElement | null | * | ClientRect),
  6874. * getWindowDimensions: function(),
  6875. * setPosition: function(*),
  6876. * setMaxHeight: function(string)}}
  6877. * @private
  6878. */
  6879. }, {
  6880. key: 'getDimensionAdapterMethods_',
  6881. value: function getDimensionAdapterMethods_() {
  6882. var _this5 = this;
  6883. return {
  6884. getInnerDimensions: function getInnerDimensions() {
  6885. return { width: _this5.root_.offsetWidth, height: _this5.root_.offsetHeight };
  6886. },
  6887. getAnchorDimensions: function getAnchorDimensions() {
  6888. return _this5.anchorElement && _this5.anchorElement.getBoundingClientRect();
  6889. },
  6890. getWindowDimensions: function getWindowDimensions() {
  6891. return { width: window.innerWidth, height: window.innerHeight };
  6892. },
  6893. getBodyDimensions: function getBodyDimensions() {
  6894. return { width: document.body.clientWidth, height: document.body.clientHeight };
  6895. },
  6896. getWindowScroll: function getWindowScroll() {
  6897. return { x: window.pageXOffset, y: window.pageYOffset };
  6898. },
  6899. setPosition: function setPosition(position) {
  6900. _this5.root_.style.left = 'left' in position ? position.left : null;
  6901. _this5.root_.style.right = 'right' in position ? position.right : null;
  6902. _this5.root_.style.top = 'top' in position ? position.top : null;
  6903. _this5.root_.style.bottom = 'bottom' in position ? position.bottom : null;
  6904. },
  6905. setMaxHeight: function setMaxHeight(height) {
  6906. _this5.root_.style.maxHeight = height;
  6907. }
  6908. };
  6909. }
  6910. }, {
  6911. key: 'open',
  6912. get: function get() {
  6913. return this.foundation_.isOpen();
  6914. }
  6915. /** @param {boolean} value */
  6916. ,
  6917. set: function set(value) {
  6918. if (value) {
  6919. var focusableElements = this.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_4__constants__["e" /* strings */].FOCUSABLE_ELEMENTS);
  6920. this.firstFocusableElement_ = focusableElements.length > 0 ? focusableElements[0] : null;
  6921. this.lastFocusableElement_ = focusableElements.length > 0 ? focusableElements[focusableElements.length - 1] : null;
  6922. this.foundation_.open();
  6923. } else {
  6924. this.foundation_.close();
  6925. }
  6926. }
  6927. }, {
  6928. key: 'quickOpen',
  6929. set: function set(quickOpen) {
  6930. this.foundation_.setQuickOpen(quickOpen);
  6931. }
  6932. }], [{
  6933. key: 'attachTo',
  6934. value: function attachTo(root) {
  6935. return new MDCMenuSurface(root);
  6936. }
  6937. }]);
  6938. return MDCMenuSurface;
  6939. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  6940. /***/ }),
  6941. /* 46 */
  6942. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6943. "use strict";
  6944. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  6945. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6946. /**
  6947. * @license
  6948. * Copyright 2017 Google Inc.
  6949. *
  6950. * Permission is hereby granted, free of charge, to any person obtaining a copy
  6951. * of this software and associated documentation files (the "Software"), to deal
  6952. * in the Software without restriction, including without limitation the rights
  6953. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  6954. * copies of the Software, and to permit persons to whom the Software is
  6955. * furnished to do so, subject to the following conditions:
  6956. *
  6957. * The above copyright notice and this permission notice shall be included in
  6958. * all copies or substantial portions of the Software.
  6959. *
  6960. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  6961. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  6962. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  6963. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  6964. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  6965. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  6966. * THE SOFTWARE.
  6967. */
  6968. /* eslint no-unused-vars: [2, {"args": "none"}] */
  6969. /**
  6970. * Adapter for MDC Notched Outline.
  6971. *
  6972. * Defines the shape of the adapter expected by the foundation. Implement this
  6973. * adapter to integrate the Notched Outline into your framework. See
  6974. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  6975. * for more information.
  6976. *
  6977. * @record
  6978. */
  6979. var MDCNotchedOutlineAdapter = function () {
  6980. function MDCNotchedOutlineAdapter() {
  6981. _classCallCheck(this, MDCNotchedOutlineAdapter);
  6982. }
  6983. _createClass(MDCNotchedOutlineAdapter, [{
  6984. key: "getWidth",
  6985. /**
  6986. * Returns the width of the root element.
  6987. * @return {number}
  6988. */
  6989. value: function getWidth() {}
  6990. /**
  6991. * Returns the height of the root element.
  6992. * @return {number}
  6993. */
  6994. }, {
  6995. key: "getHeight",
  6996. value: function getHeight() {}
  6997. /**
  6998. * Adds a class to the root element.
  6999. * @param {string} className
  7000. */
  7001. }, {
  7002. key: "addClass",
  7003. value: function addClass(className) {}
  7004. /**
  7005. * Removes a class from the root element.
  7006. * @param {string} className
  7007. */
  7008. }, {
  7009. key: "removeClass",
  7010. value: function removeClass(className) {}
  7011. /**
  7012. * Sets the "d" attribute of the outline element's SVG path.
  7013. * @param {string} value
  7014. */
  7015. }, {
  7016. key: "setOutlinePathAttr",
  7017. value: function setOutlinePathAttr(value) {}
  7018. /**
  7019. * Returns the idle outline element's computed style value of the given css property `propertyName`.
  7020. * We achieve this via `getComputedStyle(...).getPropertyValue(propertyName)`.
  7021. * @param {string} propertyName
  7022. * @return {string}
  7023. */
  7024. }, {
  7025. key: "getIdleOutlineStyleValue",
  7026. value: function getIdleOutlineStyleValue(propertyName) {}
  7027. }]);
  7028. return MDCNotchedOutlineAdapter;
  7029. }();
  7030. /* unused harmony default export */ var _unused_webpack_default_export = (MDCNotchedOutlineAdapter);
  7031. /***/ }),
  7032. /* 47 */
  7033. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7034. "use strict";
  7035. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  7036. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; });
  7037. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; });
  7038. /**
  7039. * @license
  7040. * Copyright 2018 Google Inc.
  7041. *
  7042. * Permission is hereby granted, free of charge, to any person obtaining a copy
  7043. * of this software and associated documentation files (the "Software"), to deal
  7044. * in the Software without restriction, including without limitation the rights
  7045. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7046. * copies of the Software, and to permit persons to whom the Software is
  7047. * furnished to do so, subject to the following conditions:
  7048. *
  7049. * The above copyright notice and this permission notice shall be included in
  7050. * all copies or substantial portions of the Software.
  7051. *
  7052. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  7053. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  7054. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  7055. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  7056. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  7057. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  7058. * THE SOFTWARE.
  7059. */
  7060. /** @enum {string} */
  7061. var strings = {
  7062. PATH_SELECTOR: '.mdc-notched-outline__path',
  7063. IDLE_OUTLINE_SELECTOR: '.mdc-notched-outline__idle'
  7064. };
  7065. /** @enum {string} */
  7066. var cssClasses = {
  7067. OUTLINE_NOTCHED: 'mdc-notched-outline--notched'
  7068. };
  7069. /** @enum {number} */
  7070. var numbers = {
  7071. NOTCH_GUTTER_SIZE: 4,
  7072. MIN_LEADING_STROKE_EDGE_POSITION: 12
  7073. };
  7074. /***/ }),
  7075. /* 48 */
  7076. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7077. "use strict";
  7078. /* unused harmony export MDCSelectAdapter */
  7079. /* unused harmony export FoundationMapType */
  7080. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__icon_index__ = __webpack_require__(23);
  7081. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__helper_text_index__ = __webpack_require__(24);
  7082. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  7083. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7084. /**
  7085. * @license
  7086. * Copyright 2018 Google Inc.
  7087. *
  7088. * Permission is hereby granted, free of charge, to any person obtaining a copy
  7089. * of this software and associated documentation files (the "Software"), to deal
  7090. * in the Software without restriction, including without limitation the rights
  7091. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7092. * copies of the Software, and to permit persons to whom the Software is
  7093. * furnished to do so, subject to the following conditions:
  7094. *
  7095. * The above copyright notice and this permission notice shall be included in
  7096. * all copies or substantial portions of the Software.
  7097. *
  7098. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  7099. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  7100. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  7101. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  7102. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  7103. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  7104. * THE SOFTWARE.
  7105. */
  7106. /* eslint no-unused-vars: [2, {"args": "none"}] */
  7107. /* eslint-disable no-unused-vars */
  7108. /* eslint-enable no-unused-vars */
  7109. /**
  7110. * @typedef {{
  7111. * leadingIcon: (!MDCSelectIconFoundation|undefined),
  7112. * helperText: (!MDCSelectHelperTextFoundation|undefined),
  7113. * }}
  7114. */
  7115. var FoundationMapType = void 0;
  7116. /**
  7117. * Adapter for MDC Select. Provides an interface for managing
  7118. * - classes
  7119. * - dom
  7120. * - event handlers
  7121. *
  7122. * Additionally, provides type information for the adapter to the Closure
  7123. * compiler.
  7124. *
  7125. * Implement this adapter for your framework of choice to delegate updates to
  7126. * the component in your framework of choice. See architecture documentation
  7127. * for more details.
  7128. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  7129. *
  7130. * @record
  7131. */
  7132. var MDCSelectAdapter = function () {
  7133. function MDCSelectAdapter() {
  7134. _classCallCheck(this, MDCSelectAdapter);
  7135. }
  7136. _createClass(MDCSelectAdapter, [{
  7137. key: 'addClass',
  7138. /**
  7139. * Adds class to root element.
  7140. * @param {string} className
  7141. */
  7142. value: function addClass(className) {}
  7143. /**
  7144. * Removes a class from the root element.
  7145. * @param {string} className
  7146. */
  7147. }, {
  7148. key: 'removeClass',
  7149. value: function removeClass(className) {}
  7150. /**
  7151. * Returns true if the root element contains the given class name.
  7152. * @param {string} className
  7153. * @return {boolean}
  7154. */
  7155. }, {
  7156. key: 'hasClass',
  7157. value: function hasClass(className) {}
  7158. /**
  7159. * Activates the bottom line, showing a focused state.
  7160. */
  7161. }, {
  7162. key: 'activateBottomLine',
  7163. value: function activateBottomLine() {}
  7164. /**
  7165. * Deactivates the bottom line.
  7166. */
  7167. }, {
  7168. key: 'deactivateBottomLine',
  7169. value: function deactivateBottomLine() {}
  7170. /**
  7171. * Sets the value of the select.
  7172. * @param {string} value
  7173. */
  7174. }, {
  7175. key: 'setValue',
  7176. value: function setValue(value) {}
  7177. /**
  7178. * Returns the selected value of the select element.
  7179. * @return {string}
  7180. */
  7181. }, {
  7182. key: 'getValue',
  7183. value: function getValue() {}
  7184. /**
  7185. * Returns true if the direction of the root element is set to RTL.
  7186. * @return {boolean}
  7187. */
  7188. }, {
  7189. key: 'isRtl',
  7190. value: function isRtl() {}
  7191. /**
  7192. * Floats label determined based off of the shouldFloat argument.
  7193. * @param {boolean} shouldFloat
  7194. */
  7195. }, {
  7196. key: 'floatLabel',
  7197. value: function floatLabel(shouldFloat) {}
  7198. /**
  7199. * Returns width of label in pixels, if the label exists.
  7200. * @return {number}
  7201. */
  7202. }, {
  7203. key: 'getLabelWidth',
  7204. value: function getLabelWidth() {}
  7205. /**
  7206. * Returns true if outline element exists, false if it doesn't.
  7207. * @return {boolean}
  7208. */
  7209. }, {
  7210. key: 'hasOutline',
  7211. value: function hasOutline() {}
  7212. /**
  7213. * Updates SVG Path and outline element based on the
  7214. * label element width and RTL context, if the outline exists.
  7215. * @param {number} labelWidth
  7216. * @param {boolean=} isRtl
  7217. */
  7218. }, {
  7219. key: 'notchOutline',
  7220. value: function notchOutline(labelWidth, isRtl) {}
  7221. /**
  7222. * Closes notch in outline element, if the outline exists.
  7223. */
  7224. }, {
  7225. key: 'closeOutline',
  7226. value: function closeOutline() {}
  7227. /**
  7228. * Opens the menu.
  7229. */
  7230. }, {
  7231. key: 'openMenu',
  7232. value: function openMenu() {}
  7233. /**
  7234. * Closes the menu.
  7235. */
  7236. }, {
  7237. key: 'closeMenu',
  7238. value: function closeMenu() {}
  7239. /**
  7240. * Returns true if the menu is currently open.
  7241. * @return {boolean}
  7242. */
  7243. }, {
  7244. key: 'isMenuOpen',
  7245. value: function isMenuOpen() {}
  7246. /**
  7247. * Sets the selected index of the select to the index provided.
  7248. * @param {number} index
  7249. */
  7250. }, {
  7251. key: 'setSelectedIndex',
  7252. value: function setSelectedIndex(index) {}
  7253. /**
  7254. * Sets the select to disabled.
  7255. * @param {boolean} isDisabled
  7256. */
  7257. }, {
  7258. key: 'setDisabled',
  7259. value: function setDisabled(isDisabled) {}
  7260. /**
  7261. * Sets the line ripple transform origin center.
  7262. * @param {number} normalizedX
  7263. */
  7264. }, {
  7265. key: 'setRippleCenter',
  7266. value: function setRippleCenter(normalizedX) {}
  7267. /**
  7268. * Emits a change event when an element is selected.
  7269. * @param {string} value
  7270. */
  7271. }, {
  7272. key: 'notifyChange',
  7273. value: function notifyChange(value) {}
  7274. /**
  7275. * Checks if the select is currently valid.
  7276. * @return {boolean} isValid
  7277. */
  7278. }, {
  7279. key: 'checkValidity',
  7280. value: function checkValidity() {}
  7281. /**
  7282. * Adds/Removes the invalid class.
  7283. * @param {boolean} isValid
  7284. */
  7285. }, {
  7286. key: 'setValid',
  7287. value: function setValid(isValid) {}
  7288. }]);
  7289. return MDCSelectAdapter;
  7290. }();
  7291. /***/ }),
  7292. /* 49 */
  7293. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7294. "use strict";
  7295. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  7296. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7297. /**
  7298. * @license
  7299. * Copyright 2018 Google Inc.
  7300. *
  7301. * Permission is hereby granted, free of charge, to any person obtaining a copy
  7302. * of this software and associated documentation files (the "Software"), to deal
  7303. * in the Software without restriction, including without limitation the rights
  7304. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7305. * copies of the Software, and to permit persons to whom the Software is
  7306. * furnished to do so, subject to the following conditions:
  7307. *
  7308. * The above copyright notice and this permission notice shall be included in
  7309. * all copies or substantial portions of the Software.
  7310. *
  7311. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  7312. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  7313. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  7314. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  7315. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  7316. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  7317. * THE SOFTWARE.
  7318. */
  7319. /* eslint no-unused-vars: [2, {"args": "none"}] */
  7320. /**
  7321. * Adapter for MDC Select Icon.
  7322. *
  7323. * Defines the shape of the adapter expected by the foundation. Implement this
  7324. * adapter to integrate the select icon into your framework. See
  7325. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  7326. * for more information.
  7327. *
  7328. * @record
  7329. */
  7330. var MDCSelectIconAdapter = function () {
  7331. function MDCSelectIconAdapter() {
  7332. _classCallCheck(this, MDCSelectIconAdapter);
  7333. }
  7334. _createClass(MDCSelectIconAdapter, [{
  7335. key: "getAttr",
  7336. /**
  7337. * Gets the value of an attribute on the icon element.
  7338. * @param {string} attr
  7339. * @return {string}
  7340. */
  7341. value: function getAttr(attr) {}
  7342. /**
  7343. * Sets an attribute on the icon element.
  7344. * @param {string} attr
  7345. * @param {string} value
  7346. */
  7347. }, {
  7348. key: "setAttr",
  7349. value: function setAttr(attr, value) {}
  7350. /**
  7351. * Removes an attribute from the icon element.
  7352. * @param {string} attr
  7353. */
  7354. }, {
  7355. key: "removeAttr",
  7356. value: function removeAttr(attr) {}
  7357. /**
  7358. * Sets the text content of the icon element.
  7359. * @param {string} content
  7360. */
  7361. }, {
  7362. key: "setContent",
  7363. value: function setContent(content) {}
  7364. /**
  7365. * Registers an event listener on the icon element for a given event.
  7366. * @param {string} evtType
  7367. * @param {function(!Event): undefined} handler
  7368. */
  7369. }, {
  7370. key: "registerInteractionHandler",
  7371. value: function registerInteractionHandler(evtType, handler) {}
  7372. /**
  7373. * Deregisters an event listener on the icon element for a given event.
  7374. * @param {string} evtType
  7375. * @param {function(!Event): undefined} handler
  7376. */
  7377. }, {
  7378. key: "deregisterInteractionHandler",
  7379. value: function deregisterInteractionHandler(evtType, handler) {}
  7380. /**
  7381. * Emits a custom event "MDCSelect:icon" denoting a user has clicked the icon.
  7382. */
  7383. }, {
  7384. key: "notifyIconAction",
  7385. value: function notifyIconAction() {}
  7386. }]);
  7387. return MDCSelectIconAdapter;
  7388. }();
  7389. /* unused harmony default export */ var _unused_webpack_default_export = (MDCSelectIconAdapter);
  7390. /***/ }),
  7391. /* 50 */
  7392. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7393. "use strict";
  7394. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  7395. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7396. /**
  7397. * @license
  7398. * Copyright 2018 Google Inc.
  7399. *
  7400. * Permission is hereby granted, free of charge, to any person obtaining a copy
  7401. * of this software and associated documentation files (the "Software"), to deal
  7402. * in the Software without restriction, including without limitation the rights
  7403. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7404. * copies of the Software, and to permit persons to whom the Software is
  7405. * furnished to do so, subject to the following conditions:
  7406. *
  7407. * The above copyright notice and this permission notice shall be included in
  7408. * all copies or substantial portions of the Software.
  7409. *
  7410. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  7411. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  7412. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  7413. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  7414. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  7415. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  7416. * THE SOFTWARE.
  7417. */
  7418. /* eslint no-unused-vars: [2, {"args": "none"}] */
  7419. /**
  7420. * Adapter for MDC Select Helper Text.
  7421. *
  7422. * Defines the shape of the adapter expected by the foundation. Implement this
  7423. * adapter to integrate the Select helper text into your framework. See
  7424. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  7425. * for more information.
  7426. *
  7427. * @record
  7428. */
  7429. var MDCSelectHelperTextAdapter = function () {
  7430. function MDCSelectHelperTextAdapter() {
  7431. _classCallCheck(this, MDCSelectHelperTextAdapter);
  7432. }
  7433. _createClass(MDCSelectHelperTextAdapter, [{
  7434. key: "addClass",
  7435. /**
  7436. * Adds a class to the helper text element.
  7437. * @param {string} className
  7438. */
  7439. value: function addClass(className) {}
  7440. /**
  7441. * Removes a class from the helper text element.
  7442. * @param {string} className
  7443. */
  7444. }, {
  7445. key: "removeClass",
  7446. value: function removeClass(className) {}
  7447. /**
  7448. * Returns whether or not the helper text element contains the given class.
  7449. * @param {string} className
  7450. * @return {boolean}
  7451. */
  7452. }, {
  7453. key: "hasClass",
  7454. value: function hasClass(className) {}
  7455. /**
  7456. * Sets an attribute with a given value on the helper text element.
  7457. * @param {string} attr
  7458. * @param {string} value
  7459. */
  7460. }, {
  7461. key: "setAttr",
  7462. value: function setAttr(attr, value) {}
  7463. /**
  7464. * Removes an attribute from the helper text element.
  7465. * @param {string} attr
  7466. */
  7467. }, {
  7468. key: "removeAttr",
  7469. value: function removeAttr(attr) {}
  7470. /**
  7471. * Sets the text content for the helper text element.
  7472. * @param {string} content
  7473. */
  7474. }, {
  7475. key: "setContent",
  7476. value: function setContent(content) {}
  7477. }]);
  7478. return MDCSelectHelperTextAdapter;
  7479. }();
  7480. /* unused harmony default export */ var _unused_webpack_default_export = (MDCSelectHelperTextAdapter);
  7481. /***/ }),
  7482. /* 51 */
  7483. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7484. "use strict";
  7485. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  7486. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; });
  7487. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; });
  7488. /**
  7489. * @license
  7490. * Copyright 2016 Google Inc.
  7491. *
  7492. * Permission is hereby granted, free of charge, to any person obtaining a copy
  7493. * of this software and associated documentation files (the "Software"), to deal
  7494. * in the Software without restriction, including without limitation the rights
  7495. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7496. * copies of the Software, and to permit persons to whom the Software is
  7497. * furnished to do so, subject to the following conditions:
  7498. *
  7499. * The above copyright notice and this permission notice shall be included in
  7500. * all copies or substantial portions of the Software.
  7501. *
  7502. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  7503. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  7504. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  7505. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  7506. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  7507. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  7508. * THE SOFTWARE.
  7509. */
  7510. /** @enum {string} */
  7511. var cssClasses = {
  7512. DISABLED: 'mdc-select--disabled',
  7513. ROOT: 'mdc-select',
  7514. OUTLINED: 'mdc-select--outlined',
  7515. FOCUSED: 'mdc-select--focused',
  7516. SELECTED_ITEM_CLASS: 'mdc-list-item--selected',
  7517. WITH_LEADING_ICON: 'mdc-select--with-leading-icon',
  7518. INVALID: 'mdc-select--invalid',
  7519. REQUIRED: 'mdc-select--required'
  7520. };
  7521. /** @enum {string} */
  7522. var strings = {
  7523. ARIA_CONTROLS: 'aria-controls',
  7524. CHANGE_EVENT: 'MDCSelect:change',
  7525. SELECTED_ITEM_SELECTOR: '.' + cssClasses.SELECTED_ITEM_CLASS,
  7526. LEADING_ICON_SELECTOR: '.mdc-select__icon',
  7527. SELECTED_TEXT_SELECTOR: '.mdc-select__selected-text',
  7528. HIDDEN_INPUT_SELECTOR: 'input[type="hidden"]',
  7529. MENU_SELECTOR: '.mdc-select__menu',
  7530. LINE_RIPPLE_SELECTOR: '.mdc-line-ripple',
  7531. LABEL_SELECTOR: '.mdc-floating-label',
  7532. NATIVE_CONTROL_SELECTOR: '.mdc-select__native-control',
  7533. OUTLINE_SELECTOR: '.mdc-notched-outline',
  7534. ENHANCED_VALUE_ATTR: 'data-value',
  7535. ARIA_SELECTED_ATTR: 'aria-selected'
  7536. };
  7537. /** @enum {number} */
  7538. var numbers = {
  7539. LABEL_SCALE: 0.75
  7540. };
  7541. /***/ }),
  7542. /* 52 */
  7543. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7544. "use strict";
  7545. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  7546. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; });
  7547. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; });
  7548. /**
  7549. * @license
  7550. * Copyright 2017 Google Inc.
  7551. *
  7552. * Permission is hereby granted, free of charge, to any person obtaining a copy
  7553. * of this software and associated documentation files (the "Software"), to deal
  7554. * in the Software without restriction, including without limitation the rights
  7555. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7556. * copies of the Software, and to permit persons to whom the Software is
  7557. * furnished to do so, subject to the following conditions:
  7558. *
  7559. * The above copyright notice and this permission notice shall be included in
  7560. * all copies or substantial portions of the Software.
  7561. *
  7562. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  7563. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  7564. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  7565. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  7566. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  7567. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  7568. * THE SOFTWARE.
  7569. */
  7570. /** @enum {string} */
  7571. var cssClasses = {
  7572. ACTIVE: 'mdc-slider--active',
  7573. DISABLED: 'mdc-slider--disabled',
  7574. DISCRETE: 'mdc-slider--discrete',
  7575. FOCUS: 'mdc-slider--focus',
  7576. IN_TRANSIT: 'mdc-slider--in-transit',
  7577. IS_DISCRETE: 'mdc-slider--discrete',
  7578. HAS_TRACK_MARKER: 'mdc-slider--display-markers'
  7579. };
  7580. /** @enum {string} */
  7581. var strings = {
  7582. TRACK_SELECTOR: '.mdc-slider__track',
  7583. TRACK_MARKER_CONTAINER_SELECTOR: '.mdc-slider__track-marker-container',
  7584. LAST_TRACK_MARKER_SELECTOR: '.mdc-slider__track-marker:last-child',
  7585. THUMB_CONTAINER_SELECTOR: '.mdc-slider__thumb-container',
  7586. PIN_VALUE_MARKER_SELECTOR: '.mdc-slider__pin-value-marker',
  7587. ARIA_VALUEMIN: 'aria-valuemin',
  7588. ARIA_VALUEMAX: 'aria-valuemax',
  7589. ARIA_VALUENOW: 'aria-valuenow',
  7590. ARIA_DISABLED: 'aria-disabled',
  7591. STEP_DATA_ATTR: 'data-step',
  7592. CHANGE_EVENT: 'MDCSlider:change',
  7593. INPUT_EVENT: 'MDCSlider:input'
  7594. };
  7595. /** @enum {number} */
  7596. var numbers = {
  7597. PAGE_FACTOR: 4
  7598. };
  7599. /***/ }),
  7600. /* 53 */
  7601. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7602. "use strict";
  7603. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  7604. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7605. /**
  7606. * @license
  7607. * Copyright 2017 Google Inc.
  7608. *
  7609. * Permission is hereby granted, free of charge, to any person obtaining a copy
  7610. * of this software and associated documentation files (the "Software"), to deal
  7611. * in the Software without restriction, including without limitation the rights
  7612. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7613. * copies of the Software, and to permit persons to whom the Software is
  7614. * furnished to do so, subject to the following conditions:
  7615. *
  7616. * The above copyright notice and this permission notice shall be included in
  7617. * all copies or substantial portions of the Software.
  7618. *
  7619. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  7620. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  7621. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  7622. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  7623. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  7624. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  7625. * THE SOFTWARE.
  7626. */
  7627. /* eslint-disable no-unused-vars */
  7628. /**
  7629. * Adapter for MDC Slider.
  7630. *
  7631. * Defines the shape of the adapter expected by the foundation. Implement this
  7632. * adapter to integrate the Slider into your framework. See
  7633. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  7634. * for more information.
  7635. *
  7636. * @record
  7637. */
  7638. var MDCSliderAdapter = function () {
  7639. function MDCSliderAdapter() {
  7640. _classCallCheck(this, MDCSliderAdapter);
  7641. }
  7642. _createClass(MDCSliderAdapter, [{
  7643. key: "hasClass",
  7644. /**
  7645. * Returns true if className exists for the slider Element
  7646. * @param {string} className
  7647. * @return {boolean}
  7648. */
  7649. value: function hasClass(className) {}
  7650. /**
  7651. * Adds a class to the slider Element
  7652. * @param {string} className
  7653. */
  7654. }, {
  7655. key: "addClass",
  7656. value: function addClass(className) {}
  7657. /**
  7658. * Removes a class from the slider Element
  7659. * @param {string} className
  7660. */
  7661. }, {
  7662. key: "removeClass",
  7663. value: function removeClass(className) {}
  7664. /**
  7665. * Returns a string if attribute name exists on the slider Element,
  7666. * otherwise returns null
  7667. * @param {string} name
  7668. * @return {?string}
  7669. */
  7670. }, {
  7671. key: "getAttribute",
  7672. value: function getAttribute(name) {}
  7673. /**
  7674. * Sets attribute name on slider Element to value
  7675. * @param {string} name
  7676. * @param {string} value
  7677. */
  7678. }, {
  7679. key: "setAttribute",
  7680. value: function setAttribute(name, value) {}
  7681. /**
  7682. * Removes attribute name from slider Element
  7683. * @param {string} name
  7684. */
  7685. }, {
  7686. key: "removeAttribute",
  7687. value: function removeAttribute(name) {}
  7688. /**
  7689. * Returns the bounding client rect for the slider Element
  7690. * @return {?ClientRect}
  7691. */
  7692. }, {
  7693. key: "computeBoundingRect",
  7694. value: function computeBoundingRect() {}
  7695. /**
  7696. * Returns the tab index of the slider Element
  7697. * @return {number}
  7698. */
  7699. }, {
  7700. key: "getTabIndex",
  7701. value: function getTabIndex() {}
  7702. /**
  7703. * Registers an event handler on the root element for a given event.
  7704. * @param {string} type
  7705. * @param {function(!Event): undefined} handler
  7706. */
  7707. }, {
  7708. key: "registerInteractionHandler",
  7709. value: function registerInteractionHandler(type, handler) {}
  7710. /**
  7711. * Deregisters an event handler on the root element for a given event.
  7712. * @param {string} type
  7713. * @param {function(!Event): undefined} handler
  7714. */
  7715. }, {
  7716. key: "deregisterInteractionHandler",
  7717. value: function deregisterInteractionHandler(type, handler) {}
  7718. /**
  7719. * Registers an event handler on the thumb container element for a given event.
  7720. * @param {string} type
  7721. * @param {function(!Event): undefined} handler
  7722. */
  7723. }, {
  7724. key: "registerThumbContainerInteractionHandler",
  7725. value: function registerThumbContainerInteractionHandler(type, handler) {}
  7726. /**
  7727. * Deregisters an event handler on the thumb container element for a given event.
  7728. * @param {string} type
  7729. * @param {function(!Event): undefined} handler
  7730. */
  7731. }, {
  7732. key: "deregisterThumbContainerInteractionHandler",
  7733. value: function deregisterThumbContainerInteractionHandler(type, handler) {}
  7734. /**
  7735. * Registers an event handler on the body for a given event.
  7736. * @param {string} type
  7737. * @param {function(!Event): undefined} handler
  7738. */
  7739. }, {
  7740. key: "registerBodyInteractionHandler",
  7741. value: function registerBodyInteractionHandler(type, handler) {}
  7742. /**
  7743. * Deregisters an event handler on the body for a given event.
  7744. * @param {string} type
  7745. * @param {function(!Event): undefined} handler
  7746. */
  7747. }, {
  7748. key: "deregisterBodyInteractionHandler",
  7749. value: function deregisterBodyInteractionHandler(type, handler) {}
  7750. /**
  7751. * Registers an event handler for the window resize event
  7752. * @param {function(!Event): undefined} handler
  7753. */
  7754. }, {
  7755. key: "registerResizeHandler",
  7756. value: function registerResizeHandler(handler) {}
  7757. /**
  7758. * Deregisters an event handler for the window resize event
  7759. * @param {function(!Event): undefined} handler
  7760. */
  7761. }, {
  7762. key: "deregisterResizeHandler",
  7763. value: function deregisterResizeHandler(handler) {}
  7764. /**
  7765. * Emits a custom event MDCSlider:input from the root
  7766. */
  7767. }, {
  7768. key: "notifyInput",
  7769. value: function notifyInput() {}
  7770. /**
  7771. * Emits a custom event MDCSlider:change from the root
  7772. */
  7773. }, {
  7774. key: "notifyChange",
  7775. value: function notifyChange() {}
  7776. /**
  7777. * Sets a style property of the thumb container element to the passed value
  7778. * @param {string} propertyName
  7779. * @param {string} value
  7780. */
  7781. }, {
  7782. key: "setThumbContainerStyleProperty",
  7783. value: function setThumbContainerStyleProperty(propertyName, value) {}
  7784. /**
  7785. * Sets a style property of the track element to the passed value
  7786. * @param {string} propertyName
  7787. * @param {string} value
  7788. */
  7789. }, {
  7790. key: "setTrackStyleProperty",
  7791. value: function setTrackStyleProperty(propertyName, value) {}
  7792. /**
  7793. * Sets the inner text of the pin marker to the passed value
  7794. * @param {number} value
  7795. */
  7796. }, {
  7797. key: "setMarkerValue",
  7798. value: function setMarkerValue(value) {}
  7799. /**
  7800. * Appends the passed number of track markers to the track mark container element
  7801. * @param {number} numMarkers
  7802. */
  7803. }, {
  7804. key: "appendTrackMarkers",
  7805. value: function appendTrackMarkers(numMarkers) {}
  7806. /**
  7807. * Removes all track markers fromt he track mark container element
  7808. */
  7809. }, {
  7810. key: "removeTrackMarkers",
  7811. value: function removeTrackMarkers() {}
  7812. /**
  7813. * Sets a style property of the last track marker to the passed value
  7814. * @param {string} propertyName
  7815. * @param {string} value
  7816. */
  7817. }, {
  7818. key: "setLastTrackMarkersStyleProperty",
  7819. value: function setLastTrackMarkersStyleProperty(propertyName, value) {}
  7820. /**
  7821. * Returns true if the root element is RTL, otherwise false
  7822. * @return {boolean}
  7823. */
  7824. }, {
  7825. key: "isRTL",
  7826. value: function isRTL() {}
  7827. }]);
  7828. return MDCSliderAdapter;
  7829. }();
  7830. /* unused harmony default export */ var _unused_webpack_default_export = (MDCSliderAdapter);
  7831. /***/ }),
  7832. /* 54 */
  7833. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7834. "use strict";
  7835. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  7836. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTabIndicator", function() { return MDCTabIndicator; });
  7837. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  7838. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(55);
  7839. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(26);
  7840. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__sliding_foundation__ = __webpack_require__(133);
  7841. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__fading_foundation__ = __webpack_require__(134);
  7842. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTabIndicatorFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  7843. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSlidingTabIndicatorFoundation", function() { return __WEBPACK_IMPORTED_MODULE_3__sliding_foundation__["a"]; });
  7844. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCFadingTabIndicatorFoundation", function() { return __WEBPACK_IMPORTED_MODULE_4__fading_foundation__["a"]; });
  7845. 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; };
  7846. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  7847. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7848. 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; }
  7849. 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; }
  7850. /**
  7851. * @license
  7852. * Copyright 2018 Google Inc.
  7853. *
  7854. * Permission is hereby granted, free of charge, to any person obtaining a copy
  7855. * of this software and associated documentation files (the "Software"), to deal
  7856. * in the Software without restriction, including without limitation the rights
  7857. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7858. * copies of the Software, and to permit persons to whom the Software is
  7859. * furnished to do so, subject to the following conditions:
  7860. *
  7861. * The above copyright notice and this permission notice shall be included in
  7862. * all copies or substantial portions of the Software.
  7863. *
  7864. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  7865. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  7866. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  7867. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  7868. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  7869. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  7870. * THE SOFTWARE.
  7871. */
  7872. /**
  7873. * @extends {MDCComponent<!MDCTabIndicatorFoundation>}
  7874. * @final
  7875. */
  7876. var MDCTabIndicator = function (_MDCComponent) {
  7877. _inherits(MDCTabIndicator, _MDCComponent);
  7878. _createClass(MDCTabIndicator, null, [{
  7879. key: 'attachTo',
  7880. /**
  7881. * @param {!Element} root
  7882. * @return {!MDCTabIndicator}
  7883. */
  7884. value: function attachTo(root) {
  7885. return new MDCTabIndicator(root);
  7886. }
  7887. /**
  7888. * @param {...?} args
  7889. */
  7890. }]);
  7891. function MDCTabIndicator() {
  7892. var _ref;
  7893. _classCallCheck(this, MDCTabIndicator);
  7894. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  7895. args[_key] = arguments[_key];
  7896. }
  7897. /** @type {?Element} */
  7898. var _this = _possibleConstructorReturn(this, (_ref = MDCTabIndicator.__proto__ || Object.getPrototypeOf(MDCTabIndicator)).call.apply(_ref, [this].concat(args)));
  7899. _this.content_;
  7900. return _this;
  7901. }
  7902. _createClass(MDCTabIndicator, [{
  7903. key: 'initialize',
  7904. value: function initialize() {
  7905. this.content_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.CONTENT_SELECTOR);
  7906. }
  7907. /**
  7908. * @return {!ClientRect}
  7909. */
  7910. }, {
  7911. key: 'computeContentClientRect',
  7912. value: function computeContentClientRect() {
  7913. return this.foundation_.computeContentClientRect();
  7914. }
  7915. /**
  7916. * @return {!MDCTabIndicatorFoundation}
  7917. */
  7918. }, {
  7919. key: 'getDefaultFoundation',
  7920. value: function getDefaultFoundation() {
  7921. var _this2 = this;
  7922. var adapter = /** @type {!MDCTabIndicatorAdapter} */_extends({
  7923. addClass: function addClass(className) {
  7924. return _this2.root_.classList.add(className);
  7925. },
  7926. removeClass: function removeClass(className) {
  7927. return _this2.root_.classList.remove(className);
  7928. },
  7929. computeContentClientRect: function computeContentClientRect() {
  7930. return _this2.content_.getBoundingClientRect();
  7931. },
  7932. setContentStyleProperty: function setContentStyleProperty(prop, value) {
  7933. return _this2.content_.style.setProperty(prop, value);
  7934. }
  7935. });
  7936. if (this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].cssClasses.FADE)) {
  7937. return new __WEBPACK_IMPORTED_MODULE_4__fading_foundation__["a" /* default */](adapter);
  7938. }
  7939. // Default to the sliding indicator
  7940. return new __WEBPACK_IMPORTED_MODULE_3__sliding_foundation__["a" /* default */](adapter);
  7941. }
  7942. /**
  7943. * @param {!ClientRect=} previousIndicatorClientRect
  7944. */
  7945. }, {
  7946. key: 'activate',
  7947. value: function activate(previousIndicatorClientRect) {
  7948. this.foundation_.activate(previousIndicatorClientRect);
  7949. }
  7950. }, {
  7951. key: 'deactivate',
  7952. value: function deactivate() {
  7953. this.foundation_.deactivate();
  7954. }
  7955. }]);
  7956. return MDCTabIndicator;
  7957. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  7958. /***/ }),
  7959. /* 55 */
  7960. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7961. "use strict";
  7962. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  7963. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7964. /**
  7965. * @license
  7966. * Copyright 2018 Google Inc.
  7967. *
  7968. * Permission is hereby granted, free of charge, to any person obtaining a copy
  7969. * of this software and associated documentation files (the "Software"), to deal
  7970. * in the Software without restriction, including without limitation the rights
  7971. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7972. * copies of the Software, and to permit persons to whom the Software is
  7973. * furnished to do so, subject to the following conditions:
  7974. *
  7975. * The above copyright notice and this permission notice shall be included in
  7976. * all copies or substantial portions of the Software.
  7977. *
  7978. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  7979. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  7980. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  7981. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  7982. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  7983. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  7984. * THE SOFTWARE.
  7985. */
  7986. /* eslint no-unused-vars: [2, {"args": "none"}] */
  7987. /**
  7988. * Adapter for MDC Tab Indicator.
  7989. *
  7990. * Defines the shape of the adapter expected by the foundation. Implement this
  7991. * adapter to integrate the Tab Indicator into your framework. See
  7992. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  7993. * for more information.
  7994. *
  7995. * @record
  7996. */
  7997. var MDCTabIndicatorAdapter = function () {
  7998. function MDCTabIndicatorAdapter() {
  7999. _classCallCheck(this, MDCTabIndicatorAdapter);
  8000. }
  8001. _createClass(MDCTabIndicatorAdapter, [{
  8002. key: "addClass",
  8003. /**
  8004. * Adds the given className to the root element.
  8005. * @param {string} className The className to add
  8006. */
  8007. value: function addClass(className) {}
  8008. /**
  8009. * Removes the given className from the root element.
  8010. * @param {string} className The className to remove
  8011. */
  8012. }, {
  8013. key: "removeClass",
  8014. value: function removeClass(className) {}
  8015. /**
  8016. * Returns the client rect of the content element.
  8017. * @return {!ClientRect}
  8018. */
  8019. }, {
  8020. key: "computeContentClientRect",
  8021. value: function computeContentClientRect() {}
  8022. /**
  8023. * Sets a style property of the content element to the passed value
  8024. * @param {string} propName The style property name to set
  8025. * @param {string} value The style property value
  8026. */
  8027. }, {
  8028. key: "setContentStyleProperty",
  8029. value: function setContentStyleProperty(propName, value) {}
  8030. }]);
  8031. return MDCTabIndicatorAdapter;
  8032. }();
  8033. /* unused harmony default export */ var _unused_webpack_default_export = (MDCTabIndicatorAdapter);
  8034. /***/ }),
  8035. /* 56 */
  8036. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8037. "use strict";
  8038. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  8039. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTabScroller", function() { return MDCTabScroller; });
  8040. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  8041. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(5);
  8042. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(138);
  8043. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util__ = __webpack_require__(142);
  8044. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTabScrollerFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  8045. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "util", function() { return __WEBPACK_IMPORTED_MODULE_3__util__; });
  8046. 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); } };
  8047. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  8048. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8049. 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; }
  8050. 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; }
  8051. /**
  8052. * @license
  8053. * Copyright 2018 Google Inc.
  8054. *
  8055. * Permission is hereby granted, free of charge, to any person obtaining a copy
  8056. * of this software and associated documentation files (the "Software"), to deal
  8057. * in the Software without restriction, including without limitation the rights
  8058. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8059. * copies of the Software, and to permit persons to whom the Software is
  8060. * furnished to do so, subject to the following conditions:
  8061. *
  8062. * The above copyright notice and this permission notice shall be included in
  8063. * all copies or substantial portions of the Software.
  8064. *
  8065. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  8066. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  8067. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  8068. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  8069. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  8070. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  8071. * THE SOFTWARE.
  8072. */
  8073. /**
  8074. * @extends {MDCComponent<!MDCTabScrollerFoundation>}
  8075. * @final
  8076. */
  8077. var MDCTabScroller = function (_MDCComponent) {
  8078. _inherits(MDCTabScroller, _MDCComponent);
  8079. _createClass(MDCTabScroller, null, [{
  8080. key: 'attachTo',
  8081. /**
  8082. * @param {!Element} root
  8083. * @return {!MDCTabScroller}
  8084. */
  8085. value: function attachTo(root) {
  8086. return new MDCTabScroller(root);
  8087. }
  8088. }]);
  8089. function MDCTabScroller() {
  8090. var _ref;
  8091. _classCallCheck(this, MDCTabScroller);
  8092. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  8093. args[_key] = arguments[_key];
  8094. }
  8095. /** @private {?Element} */
  8096. var _this = _possibleConstructorReturn(this, (_ref = MDCTabScroller.__proto__ || Object.getPrototypeOf(MDCTabScroller)).call.apply(_ref, [this].concat(args)));
  8097. _this.content_;
  8098. /** @private {?Element} */
  8099. _this.area_;
  8100. /** @private {?function(?Event): undefined} */
  8101. _this.handleInteraction_;
  8102. /** @private {?function(!Event): undefined} */
  8103. _this.handleTransitionEnd_;
  8104. return _this;
  8105. }
  8106. _createClass(MDCTabScroller, [{
  8107. key: 'initialize',
  8108. value: function initialize() {
  8109. this.area_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.AREA_SELECTOR);
  8110. this.content_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.CONTENT_SELECTOR);
  8111. }
  8112. }, {
  8113. key: 'initialSyncWithDOM',
  8114. value: function initialSyncWithDOM() {
  8115. var _this2 = this;
  8116. this.handleInteraction_ = function () {
  8117. return _this2.foundation_.handleInteraction();
  8118. };
  8119. this.handleTransitionEnd_ = function (evt) {
  8120. return _this2.foundation_.handleTransitionEnd(evt);
  8121. };
  8122. this.area_.addEventListener('wheel', this.handleInteraction_);
  8123. this.area_.addEventListener('touchstart', this.handleInteraction_);
  8124. this.area_.addEventListener('pointerdown', this.handleInteraction_);
  8125. this.area_.addEventListener('mousedown', this.handleInteraction_);
  8126. this.area_.addEventListener('keydown', this.handleInteraction_);
  8127. this.content_.addEventListener('transitionend', this.handleTransitionEnd_);
  8128. }
  8129. }, {
  8130. key: 'destroy',
  8131. value: function destroy() {
  8132. _get(MDCTabScroller.prototype.__proto__ || Object.getPrototypeOf(MDCTabScroller.prototype), 'destroy', this).call(this);
  8133. this.area_.removeEventListener('wheel', this.handleInteraction_);
  8134. this.area_.removeEventListener('touchstart', this.handleInteraction_);
  8135. this.area_.removeEventListener('pointerdown', this.handleInteraction_);
  8136. this.area_.removeEventListener('mousedown', this.handleInteraction_);
  8137. this.area_.removeEventListener('keydown', this.handleInteraction_);
  8138. this.content_.removeEventListener('transitionend', this.handleTransitionEnd_);
  8139. }
  8140. /**
  8141. * @return {!MDCTabScrollerFoundation}
  8142. */
  8143. }, {
  8144. key: 'getDefaultFoundation',
  8145. value: function getDefaultFoundation() {
  8146. var _this3 = this;
  8147. var adapter = /** @type {!MDCTabScrollerAdapter} */{
  8148. eventTargetMatchesSelector: function eventTargetMatchesSelector(evtTarget, selector) {
  8149. var MATCHES = __WEBPACK_IMPORTED_MODULE_3__util__["getMatchesProperty"](HTMLElement.prototype);
  8150. return evtTarget[MATCHES](selector);
  8151. },
  8152. addClass: function addClass(className) {
  8153. return _this3.root_.classList.add(className);
  8154. },
  8155. removeClass: function removeClass(className) {
  8156. return _this3.root_.classList.remove(className);
  8157. },
  8158. addScrollAreaClass: function addScrollAreaClass(className) {
  8159. return _this3.area_.classList.add(className);
  8160. },
  8161. setScrollAreaStyleProperty: function setScrollAreaStyleProperty(prop, value) {
  8162. return _this3.area_.style.setProperty(prop, value);
  8163. },
  8164. setScrollContentStyleProperty: function setScrollContentStyleProperty(prop, value) {
  8165. return _this3.content_.style.setProperty(prop, value);
  8166. },
  8167. getScrollContentStyleValue: function getScrollContentStyleValue(propName) {
  8168. return window.getComputedStyle(_this3.content_).getPropertyValue(propName);
  8169. },
  8170. setScrollAreaScrollLeft: function setScrollAreaScrollLeft(scrollX) {
  8171. return _this3.area_.scrollLeft = scrollX;
  8172. },
  8173. getScrollAreaScrollLeft: function getScrollAreaScrollLeft() {
  8174. return _this3.area_.scrollLeft;
  8175. },
  8176. getScrollContentOffsetWidth: function getScrollContentOffsetWidth() {
  8177. return _this3.content_.offsetWidth;
  8178. },
  8179. getScrollAreaOffsetWidth: function getScrollAreaOffsetWidth() {
  8180. return _this3.area_.offsetWidth;
  8181. },
  8182. computeScrollAreaClientRect: function computeScrollAreaClientRect() {
  8183. return _this3.area_.getBoundingClientRect();
  8184. },
  8185. computeScrollContentClientRect: function computeScrollContentClientRect() {
  8186. return _this3.content_.getBoundingClientRect();
  8187. },
  8188. computeHorizontalScrollbarHeight: function computeHorizontalScrollbarHeight() {
  8189. return __WEBPACK_IMPORTED_MODULE_3__util__["computeHorizontalScrollbarHeight"](document);
  8190. }
  8191. };
  8192. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */](adapter);
  8193. }
  8194. /**
  8195. * Returns the current visual scroll position
  8196. * @return {number}
  8197. */
  8198. }, {
  8199. key: 'getScrollPosition',
  8200. value: function getScrollPosition() {
  8201. return this.foundation_.getScrollPosition();
  8202. }
  8203. /**
  8204. * Returns the width of the scroll content
  8205. * @return {number}
  8206. */
  8207. }, {
  8208. key: 'getScrollContentWidth',
  8209. value: function getScrollContentWidth() {
  8210. return this.content_.offsetWidth;
  8211. }
  8212. /**
  8213. * Increments the scroll value by the given amount
  8214. * @param {number} scrollXIncrement The pixel value by which to increment the scroll value
  8215. */
  8216. }, {
  8217. key: 'incrementScroll',
  8218. value: function incrementScroll(scrollXIncrement) {
  8219. this.foundation_.incrementScroll(scrollXIncrement);
  8220. }
  8221. /**
  8222. * Scrolls to the given pixel position
  8223. * @param {number} scrollX The pixel value to scroll to
  8224. */
  8225. }, {
  8226. key: 'scrollTo',
  8227. value: function scrollTo(scrollX) {
  8228. this.foundation_.scrollTo(scrollX);
  8229. }
  8230. }]);
  8231. return MDCTabScroller;
  8232. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  8233. /***/ }),
  8234. /* 57 */
  8235. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8236. "use strict";
  8237. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  8238. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  8239. /**
  8240. * @license
  8241. * Copyright 2018 Google Inc.
  8242. *
  8243. * Permission is hereby granted, free of charge, to any person obtaining a copy
  8244. * of this software and associated documentation files (the "Software"), to deal
  8245. * in the Software without restriction, including without limitation the rights
  8246. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8247. * copies of the Software, and to permit persons to whom the Software is
  8248. * furnished to do so, subject to the following conditions:
  8249. *
  8250. * The above copyright notice and this permission notice shall be included in
  8251. * all copies or substantial portions of the Software.
  8252. *
  8253. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  8254. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  8255. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  8256. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  8257. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  8258. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  8259. * THE SOFTWARE.
  8260. */
  8261. /** @enum {string} */
  8262. var cssClasses = {
  8263. ANIMATING: 'mdc-tab-scroller--animating',
  8264. SCROLL_TEST: 'mdc-tab-scroller__test',
  8265. SCROLL_AREA_SCROLL: 'mdc-tab-scroller__scroll-area--scroll'
  8266. };
  8267. /** @enum {string} */
  8268. var strings = {
  8269. AREA_SELECTOR: '.mdc-tab-scroller__scroll-area',
  8270. CONTENT_SELECTOR: '.mdc-tab-scroller__scroll-content'
  8271. };
  8272. /***/ }),
  8273. /* 58 */
  8274. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8275. "use strict";
  8276. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_tab_adapter__ = __webpack_require__(10);
  8277. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_tab_index__ = __webpack_require__(25);
  8278. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  8279. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8280. /**
  8281. * @license
  8282. * Copyright 2018 Google Inc.
  8283. *
  8284. * Permission is hereby granted, free of charge, to any person obtaining a copy
  8285. * of this software and associated documentation files (the "Software"), to deal
  8286. * in the Software without restriction, including without limitation the rights
  8287. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8288. * copies of the Software, and to permit persons to whom the Software is
  8289. * furnished to do so, subject to the following conditions:
  8290. *
  8291. * The above copyright notice and this permission notice shall be included in
  8292. * all copies or substantial portions of the Software.
  8293. *
  8294. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  8295. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  8296. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  8297. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  8298. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  8299. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  8300. * THE SOFTWARE.
  8301. */
  8302. /* eslint no-unused-vars: [2, {"args": "none"}] */
  8303. /* eslint-disable no-unused-vars */
  8304. /* eslint-enable no-unused-vars */
  8305. /**
  8306. * Adapter for MDC Tab Bar.
  8307. *
  8308. * Defines the shape of the adapter expected by the foundation. Implement this
  8309. * adapter to integrate the Tab Bar into your framework. See
  8310. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  8311. * for more information.
  8312. *
  8313. * @record
  8314. */
  8315. var MDCTabBarAdapter = function () {
  8316. function MDCTabBarAdapter() {
  8317. _classCallCheck(this, MDCTabBarAdapter);
  8318. }
  8319. _createClass(MDCTabBarAdapter, [{
  8320. key: 'scrollTo',
  8321. /**
  8322. * Scrolls to the given position
  8323. * @param {number} scrollX The position to scroll to
  8324. */
  8325. value: function scrollTo(scrollX) {}
  8326. /**
  8327. * Increments the current scroll position by the given amount
  8328. * @param {number} scrollXIncrement The amount to increment scroll
  8329. */
  8330. }, {
  8331. key: 'incrementScroll',
  8332. value: function incrementScroll(scrollXIncrement) {}
  8333. /**
  8334. * Returns the current scroll position
  8335. * @return {number}
  8336. */
  8337. }, {
  8338. key: 'getScrollPosition',
  8339. value: function getScrollPosition() {}
  8340. /**
  8341. * Returns the width of the scroll content
  8342. * @return {number}
  8343. */
  8344. }, {
  8345. key: 'getScrollContentWidth',
  8346. value: function getScrollContentWidth() {}
  8347. /**
  8348. * Returns the root element's offsetWidth
  8349. * @return {number}
  8350. */
  8351. }, {
  8352. key: 'getOffsetWidth',
  8353. value: function getOffsetWidth() {}
  8354. /**
  8355. * Returns if the Tab Bar language direction is RTL
  8356. * @return {boolean}
  8357. */
  8358. }, {
  8359. key: 'isRTL',
  8360. value: function isRTL() {}
  8361. /**
  8362. * Sets the tab at the given index to be activated
  8363. * @param {number} index The index of the tab to activate
  8364. */
  8365. }, {
  8366. key: 'setActiveTab',
  8367. value: function setActiveTab(index) {}
  8368. /**
  8369. * Activates the tab at the given index with the given client rect
  8370. * @param {number} index The index of the tab to activate
  8371. * @param {!ClientRect} clientRect The client rect of the previously active Tab Indicator
  8372. */
  8373. }, {
  8374. key: 'activateTabAtIndex',
  8375. value: function activateTabAtIndex(index, clientRect) {}
  8376. /**
  8377. * Deactivates the tab at the given index
  8378. * @param {number} index The index of the tab to deactivate
  8379. */
  8380. }, {
  8381. key: 'deactivateTabAtIndex',
  8382. value: function deactivateTabAtIndex(index) {}
  8383. /**
  8384. * Focuses the tab at the given index
  8385. * @param {number} index The index of the tab to focus
  8386. */
  8387. }, {
  8388. key: 'focusTabAtIndex',
  8389. value: function focusTabAtIndex(index) {}
  8390. /**
  8391. * Returns the client rect of the tab's indicator
  8392. * @param {number} index The index of the tab
  8393. * @return {!ClientRect}
  8394. */
  8395. }, {
  8396. key: 'getTabIndicatorClientRectAtIndex',
  8397. value: function getTabIndicatorClientRectAtIndex(index) {}
  8398. /**
  8399. * Returns the tab dimensions of the tab at the given index
  8400. * @param {number} index The index of the tab
  8401. * @return {!MDCTabDimensions}
  8402. */
  8403. }, {
  8404. key: 'getTabDimensionsAtIndex',
  8405. value: function getTabDimensionsAtIndex(index) {}
  8406. /**
  8407. * Returns the length of the tab list
  8408. * @return {number}
  8409. */
  8410. }, {
  8411. key: 'getTabListLength',
  8412. value: function getTabListLength() {}
  8413. /**
  8414. * Returns the index of the previously active tab
  8415. * @return {number}
  8416. */
  8417. }, {
  8418. key: 'getPreviousActiveTabIndex',
  8419. value: function getPreviousActiveTabIndex() {}
  8420. /**
  8421. * Returns the index of the focused tab
  8422. * @return {number}
  8423. */
  8424. }, {
  8425. key: 'getFocusedTabIndex',
  8426. value: function getFocusedTabIndex() {}
  8427. /**
  8428. * Returns the index of the given tab
  8429. * @param {!MDCTab} tab The tab whose index to determin
  8430. * @return {number}
  8431. */
  8432. }, {
  8433. key: 'getIndexOfTab',
  8434. value: function getIndexOfTab(tab) {}
  8435. /**
  8436. * Emits the MDCTabBar:activated event
  8437. * @param {number} index The index of the activated tab
  8438. */
  8439. }, {
  8440. key: 'notifyTabActivated',
  8441. value: function notifyTabActivated(index) {}
  8442. }]);
  8443. return MDCTabBarAdapter;
  8444. }();
  8445. /* unused harmony default export */ var _unused_webpack_default_export = (MDCTabBarAdapter);
  8446. /***/ }),
  8447. /* 59 */
  8448. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8449. "use strict";
  8450. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return cssClasses; });
  8451. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return strings; });
  8452. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return numbers; });
  8453. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return VALIDATION_ATTR_WHITELIST; });
  8454. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ALWAYS_FLOAT_TYPES; });
  8455. /**
  8456. * @license
  8457. * Copyright 2016 Google Inc.
  8458. *
  8459. * Permission is hereby granted, free of charge, to any person obtaining a copy
  8460. * of this software and associated documentation files (the "Software"), to deal
  8461. * in the Software without restriction, including without limitation the rights
  8462. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8463. * copies of the Software, and to permit persons to whom the Software is
  8464. * furnished to do so, subject to the following conditions:
  8465. *
  8466. * The above copyright notice and this permission notice shall be included in
  8467. * all copies or substantial portions of the Software.
  8468. *
  8469. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  8470. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  8471. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  8472. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  8473. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  8474. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  8475. * THE SOFTWARE.
  8476. */
  8477. /** @enum {string} */
  8478. var strings = {
  8479. ARIA_CONTROLS: 'aria-controls',
  8480. INPUT_SELECTOR: '.mdc-text-field__input',
  8481. LABEL_SELECTOR: '.mdc-floating-label',
  8482. ICON_SELECTOR: '.mdc-text-field__icon',
  8483. OUTLINE_SELECTOR: '.mdc-notched-outline',
  8484. LINE_RIPPLE_SELECTOR: '.mdc-line-ripple'
  8485. };
  8486. /** @enum {string} */
  8487. var cssClasses = {
  8488. ROOT: 'mdc-text-field',
  8489. DISABLED: 'mdc-text-field--disabled',
  8490. DENSE: 'mdc-text-field--dense',
  8491. FOCUSED: 'mdc-text-field--focused',
  8492. INVALID: 'mdc-text-field--invalid',
  8493. TEXTAREA: 'mdc-text-field--textarea',
  8494. OUTLINED: 'mdc-text-field--outlined',
  8495. WITH_LEADING_ICON: 'mdc-text-field--with-leading-icon'
  8496. };
  8497. /** @enum {number} */
  8498. var numbers = {
  8499. LABEL_SCALE: 0.75,
  8500. DENSE_LABEL_SCALE: 0.923
  8501. };
  8502. // whitelist based off of https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation
  8503. // under section: `Validation-related attributes`
  8504. var VALIDATION_ATTR_WHITELIST = ['pattern', 'min', 'max', 'required', 'step', 'minlength', 'maxlength'];
  8505. // Label should always float for these types as they show some UI even if value is empty.
  8506. var ALWAYS_FLOAT_TYPES = ['color', 'date', 'datetime-local', 'month', 'range', 'time', 'week'];
  8507. /***/ }),
  8508. /* 60 */
  8509. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8510. "use strict";
  8511. /* unused harmony export MDCTextFieldAdapter */
  8512. /* unused harmony export NativeInputType */
  8513. /* unused harmony export FoundationMapType */
  8514. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__helper_text_foundation__ = __webpack_require__(27);
  8515. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__icon_foundation__ = __webpack_require__(28);
  8516. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  8517. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8518. /**
  8519. * @license
  8520. * Copyright 2017 Google Inc.
  8521. *
  8522. * Permission is hereby granted, free of charge, to any person obtaining a copy
  8523. * of this software and associated documentation files (the "Software"), to deal
  8524. * in the Software without restriction, including without limitation the rights
  8525. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8526. * copies of the Software, and to permit persons to whom the Software is
  8527. * furnished to do so, subject to the following conditions:
  8528. *
  8529. * The above copyright notice and this permission notice shall be included in
  8530. * all copies or substantial portions of the Software.
  8531. *
  8532. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  8533. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  8534. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  8535. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  8536. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  8537. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  8538. * THE SOFTWARE.
  8539. */
  8540. /* eslint-disable no-unused-vars */
  8541. /* eslint no-unused-vars: [2, {"args": "none"}] */
  8542. /**
  8543. * @typedef {{
  8544. * value: string,
  8545. * disabled: boolean,
  8546. * badInput: boolean,
  8547. * validity: {
  8548. * badInput: boolean,
  8549. * valid: boolean,
  8550. * },
  8551. * }}
  8552. */
  8553. var NativeInputType = void 0;
  8554. /**
  8555. * @typedef {{
  8556. * helperText: (!MDCTextFieldHelperTextFoundation|undefined),
  8557. * leadingIcon: (!MDCTextFieldIconFoundation|undefined),
  8558. * trailingIcon: (!MDCTextFieldIconFoundation|undefined),
  8559. * }}
  8560. */
  8561. var FoundationMapType = void 0;
  8562. /**
  8563. * Adapter for MDC Text Field.
  8564. *
  8565. * Defines the shape of the adapter expected by the foundation. Implement this
  8566. * adapter to integrate the Text Field into your framework. See
  8567. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  8568. * for more information.
  8569. *
  8570. * @record
  8571. */
  8572. var MDCTextFieldAdapter = function () {
  8573. function MDCTextFieldAdapter() {
  8574. _classCallCheck(this, MDCTextFieldAdapter);
  8575. }
  8576. _createClass(MDCTextFieldAdapter, [{
  8577. key: 'addClass',
  8578. /**
  8579. * Adds a class to the root Element.
  8580. * @param {string} className
  8581. */
  8582. value: function addClass(className) {}
  8583. /**
  8584. * Removes a class from the root Element.
  8585. * @param {string} className
  8586. */
  8587. }, {
  8588. key: 'removeClass',
  8589. value: function removeClass(className) {}
  8590. /**
  8591. * Returns true if the root element contains the given class name.
  8592. * @param {string} className
  8593. * @return {boolean}
  8594. */
  8595. }, {
  8596. key: 'hasClass',
  8597. value: function hasClass(className) {}
  8598. /**
  8599. * Registers an event handler on the root element for a given event.
  8600. * @param {string} type
  8601. * @param {function(!Event): undefined} handler
  8602. */
  8603. }, {
  8604. key: 'registerTextFieldInteractionHandler',
  8605. value: function registerTextFieldInteractionHandler(type, handler) {}
  8606. /**
  8607. * Deregisters an event handler on the root element for a given event.
  8608. * @param {string} type
  8609. * @param {function(!Event): undefined} handler
  8610. */
  8611. }, {
  8612. key: 'deregisterTextFieldInteractionHandler',
  8613. value: function deregisterTextFieldInteractionHandler(type, handler) {}
  8614. /**
  8615. * Registers an event listener on the native input element for a given event.
  8616. * @param {string} evtType
  8617. * @param {function(!Event): undefined} handler
  8618. */
  8619. }, {
  8620. key: 'registerInputInteractionHandler',
  8621. value: function registerInputInteractionHandler(evtType, handler) {}
  8622. /**
  8623. * Deregisters an event listener on the native input element for a given event.
  8624. * @param {string} evtType
  8625. * @param {function(!Event): undefined} handler
  8626. */
  8627. }, {
  8628. key: 'deregisterInputInteractionHandler',
  8629. value: function deregisterInputInteractionHandler(evtType, handler) {}
  8630. /**
  8631. * Registers a validation attribute change listener on the input element.
  8632. * Handler accepts list of attribute names.
  8633. * @param {function(!Array<string>): undefined} handler
  8634. * @return {!MutationObserver}
  8635. */
  8636. }, {
  8637. key: 'registerValidationAttributeChangeHandler',
  8638. value: function registerValidationAttributeChangeHandler(handler) {}
  8639. /**
  8640. * Disconnects a validation attribute observer on the input element.
  8641. * @param {!MutationObserver} observer
  8642. */
  8643. }, {
  8644. key: 'deregisterValidationAttributeChangeHandler',
  8645. value: function deregisterValidationAttributeChangeHandler(observer) {}
  8646. /**
  8647. * Returns an object representing the native text input element, with a
  8648. * similar API shape. The object returned should include the value, disabled
  8649. * and badInput properties, as well as the checkValidity() function. We never
  8650. * alter the value within our code, however we do update the disabled
  8651. * property, so if you choose to duck-type the return value for this method
  8652. * in your implementation it's important to keep this in mind. Also note that
  8653. * this method can return null, which the foundation will handle gracefully.
  8654. * @return {?Element|?NativeInputType}
  8655. */
  8656. }, {
  8657. key: 'getNativeInput',
  8658. value: function getNativeInput() {}
  8659. /**
  8660. * Returns true if the textfield is focused.
  8661. * We achieve this via `document.activeElement === this.root_`.
  8662. * @return {boolean}
  8663. */
  8664. }, {
  8665. key: 'isFocused',
  8666. value: function isFocused() {}
  8667. /**
  8668. * Returns true if the direction of the root element is set to RTL.
  8669. * @return {boolean}
  8670. */
  8671. }, {
  8672. key: 'isRtl',
  8673. value: function isRtl() {}
  8674. /**
  8675. * Activates the line ripple.
  8676. */
  8677. }, {
  8678. key: 'activateLineRipple',
  8679. value: function activateLineRipple() {}
  8680. /**
  8681. * Deactivates the line ripple.
  8682. */
  8683. }, {
  8684. key: 'deactivateLineRipple',
  8685. value: function deactivateLineRipple() {}
  8686. /**
  8687. * Sets the transform origin of the line ripple.
  8688. * @param {number} normalizedX
  8689. */
  8690. }, {
  8691. key: 'setLineRippleTransformOrigin',
  8692. value: function setLineRippleTransformOrigin(normalizedX) {}
  8693. /**
  8694. * Only implement if label exists.
  8695. * Shakes label if shouldShake is true.
  8696. * @param {boolean} shouldShake
  8697. */
  8698. }, {
  8699. key: 'shakeLabel',
  8700. value: function shakeLabel(shouldShake) {}
  8701. /**
  8702. * Only implement if label exists.
  8703. * Floats the label above the input element if shouldFloat is true.
  8704. * @param {boolean} shouldFloat
  8705. */
  8706. }, {
  8707. key: 'floatLabel',
  8708. value: function floatLabel(shouldFloat) {}
  8709. /**
  8710. * Returns true if label element exists, false if it doesn't.
  8711. * @return {boolean}
  8712. */
  8713. }, {
  8714. key: 'hasLabel',
  8715. value: function hasLabel() {}
  8716. /**
  8717. * Only implement if label exists.
  8718. * Returns width of label in pixels.
  8719. * @return {number}
  8720. */
  8721. }, {
  8722. key: 'getLabelWidth',
  8723. value: function getLabelWidth() {}
  8724. /**
  8725. * Returns true if outline element exists, false if it doesn't.
  8726. * @return {boolean}
  8727. */
  8728. }, {
  8729. key: 'hasOutline',
  8730. value: function hasOutline() {}
  8731. /**
  8732. * Only implement if outline element exists.
  8733. * Updates SVG Path and outline element based on the
  8734. * label element width and RTL context.
  8735. * @param {number} labelWidth
  8736. * @param {boolean=} isRtl
  8737. */
  8738. }, {
  8739. key: 'notchOutline',
  8740. value: function notchOutline(labelWidth, isRtl) {}
  8741. /**
  8742. * Only implement if outline element exists.
  8743. * Closes notch in outline element.
  8744. */
  8745. }, {
  8746. key: 'closeOutline',
  8747. value: function closeOutline() {}
  8748. }]);
  8749. return MDCTextFieldAdapter;
  8750. }();
  8751. /***/ }),
  8752. /* 61 */
  8753. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8754. "use strict";
  8755. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  8756. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8757. /**
  8758. * @license
  8759. * Copyright 2017 Google Inc.
  8760. *
  8761. * Permission is hereby granted, free of charge, to any person obtaining a copy
  8762. * of this software and associated documentation files (the "Software"), to deal
  8763. * in the Software without restriction, including without limitation the rights
  8764. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8765. * copies of the Software, and to permit persons to whom the Software is
  8766. * furnished to do so, subject to the following conditions:
  8767. *
  8768. * The above copyright notice and this permission notice shall be included in
  8769. * all copies or substantial portions of the Software.
  8770. *
  8771. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  8772. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  8773. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  8774. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  8775. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  8776. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  8777. * THE SOFTWARE.
  8778. */
  8779. /* eslint no-unused-vars: [2, {"args": "none"}] */
  8780. /**
  8781. * Adapter for MDC Text Field Helper Text.
  8782. *
  8783. * Defines the shape of the adapter expected by the foundation. Implement this
  8784. * adapter to integrate the TextField helper text into your framework. See
  8785. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  8786. * for more information.
  8787. *
  8788. * @record
  8789. */
  8790. var MDCTextFieldHelperTextAdapter = function () {
  8791. function MDCTextFieldHelperTextAdapter() {
  8792. _classCallCheck(this, MDCTextFieldHelperTextAdapter);
  8793. }
  8794. _createClass(MDCTextFieldHelperTextAdapter, [{
  8795. key: "addClass",
  8796. /**
  8797. * Adds a class to the helper text element.
  8798. * @param {string} className
  8799. */
  8800. value: function addClass(className) {}
  8801. /**
  8802. * Removes a class from the helper text element.
  8803. * @param {string} className
  8804. */
  8805. }, {
  8806. key: "removeClass",
  8807. value: function removeClass(className) {}
  8808. /**
  8809. * Returns whether or not the helper text element contains the given class.
  8810. * @param {string} className
  8811. * @return {boolean}
  8812. */
  8813. }, {
  8814. key: "hasClass",
  8815. value: function hasClass(className) {}
  8816. /**
  8817. * Sets an attribute with a given value on the helper text element.
  8818. * @param {string} attr
  8819. * @param {string} value
  8820. */
  8821. }, {
  8822. key: "setAttr",
  8823. value: function setAttr(attr, value) {}
  8824. /**
  8825. * Removes an attribute from the helper text element.
  8826. * @param {string} attr
  8827. */
  8828. }, {
  8829. key: "removeAttr",
  8830. value: function removeAttr(attr) {}
  8831. /**
  8832. * Sets the text content for the helper text element.
  8833. * @param {string} content
  8834. */
  8835. }, {
  8836. key: "setContent",
  8837. value: function setContent(content) {}
  8838. }]);
  8839. return MDCTextFieldHelperTextAdapter;
  8840. }();
  8841. /* unused harmony default export */ var _unused_webpack_default_export = (MDCTextFieldHelperTextAdapter);
  8842. /***/ }),
  8843. /* 62 */
  8844. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8845. "use strict";
  8846. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  8847. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8848. /**
  8849. * @license
  8850. * Copyright 2017 Google Inc.
  8851. *
  8852. * Permission is hereby granted, free of charge, to any person obtaining a copy
  8853. * of this software and associated documentation files (the "Software"), to deal
  8854. * in the Software without restriction, including without limitation the rights
  8855. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8856. * copies of the Software, and to permit persons to whom the Software is
  8857. * furnished to do so, subject to the following conditions:
  8858. *
  8859. * The above copyright notice and this permission notice shall be included in
  8860. * all copies or substantial portions of the Software.
  8861. *
  8862. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  8863. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  8864. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  8865. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  8866. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  8867. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  8868. * THE SOFTWARE.
  8869. */
  8870. /* eslint no-unused-vars: [2, {"args": "none"}] */
  8871. /**
  8872. * Adapter for MDC Text Field Icon.
  8873. *
  8874. * Defines the shape of the adapter expected by the foundation. Implement this
  8875. * adapter to integrate the text field icon into your framework. See
  8876. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  8877. * for more information.
  8878. *
  8879. * @record
  8880. */
  8881. var MDCTextFieldIconAdapter = function () {
  8882. function MDCTextFieldIconAdapter() {
  8883. _classCallCheck(this, MDCTextFieldIconAdapter);
  8884. }
  8885. _createClass(MDCTextFieldIconAdapter, [{
  8886. key: "getAttr",
  8887. /**
  8888. * Gets the value of an attribute on the icon element.
  8889. * @param {string} attr
  8890. * @return {string}
  8891. */
  8892. value: function getAttr(attr) {}
  8893. /**
  8894. * Sets an attribute on the icon element.
  8895. * @param {string} attr
  8896. * @param {string} value
  8897. */
  8898. }, {
  8899. key: "setAttr",
  8900. value: function setAttr(attr, value) {}
  8901. /**
  8902. * Removes an attribute from the icon element.
  8903. * @param {string} attr
  8904. */
  8905. }, {
  8906. key: "removeAttr",
  8907. value: function removeAttr(attr) {}
  8908. /**
  8909. * Sets the text content of the icon element.
  8910. * @param {string} content
  8911. */
  8912. }, {
  8913. key: "setContent",
  8914. value: function setContent(content) {}
  8915. /**
  8916. * Registers an event listener on the icon element for a given event.
  8917. * @param {string} evtType
  8918. * @param {function(!Event): undefined} handler
  8919. */
  8920. }, {
  8921. key: "registerInteractionHandler",
  8922. value: function registerInteractionHandler(evtType, handler) {}
  8923. /**
  8924. * Deregisters an event listener on the icon element for a given event.
  8925. * @param {string} evtType
  8926. * @param {function(!Event): undefined} handler
  8927. */
  8928. }, {
  8929. key: "deregisterInteractionHandler",
  8930. value: function deregisterInteractionHandler(evtType, handler) {}
  8931. /**
  8932. * Emits a custom event "MDCTextField:icon" denoting a user has clicked the icon.
  8933. */
  8934. }, {
  8935. key: "notifyIconAction",
  8936. value: function notifyIconAction() {}
  8937. }]);
  8938. return MDCTextFieldIconAdapter;
  8939. }();
  8940. /* unused harmony default export */ var _unused_webpack_default_export = (MDCTextFieldIconAdapter);
  8941. /***/ }),
  8942. /* 63 */
  8943. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8944. "use strict";
  8945. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  8946. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__ = __webpack_require__(64);
  8947. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_index__ = __webpack_require__(3);
  8948. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_checkbox_index__ = __webpack_require__(65);
  8949. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_chips_index__ = __webpack_require__(71);
  8950. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__material_dialog_index__ = __webpack_require__(75);
  8951. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__material_dom_index__ = __webpack_require__(81);
  8952. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__material_drawer_index__ = __webpack_require__(82);
  8953. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__material_floating_label_index__ = __webpack_require__(17);
  8954. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__material_form_field_index__ = __webpack_require__(89);
  8955. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__material_grid_list_index__ = __webpack_require__(93);
  8956. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__material_icon_button_index__ = __webpack_require__(96);
  8957. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__material_icon_toggle_index__ = __webpack_require__(100);
  8958. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__material_linear_progress_index__ = __webpack_require__(104);
  8959. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__material_line_ripple_index__ = __webpack_require__(18);
  8960. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__material_list_index__ = __webpack_require__(15);
  8961. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__material_menu_index__ = __webpack_require__(43);
  8962. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__material_menu_surface_index__ = __webpack_require__(45);
  8963. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__material_notched_outline_index__ = __webpack_require__(22);
  8964. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__material_radio_index__ = __webpack_require__(113);
  8965. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__material_ripple_index__ = __webpack_require__(2);
  8966. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__material_select_index__ = __webpack_require__(117);
  8967. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_21__material_selection_control_index__ = __webpack_require__(4);
  8968. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_22__material_slider_index__ = __webpack_require__(123);
  8969. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_23__material_snackbar_index__ = __webpack_require__(125);
  8970. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_24__material_switch_index__ = __webpack_require__(128);
  8971. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_25__material_tab_index__ = __webpack_require__(25);
  8972. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_26__material_tab_bar_index__ = __webpack_require__(137);
  8973. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_27__material_tab_indicator_index__ = __webpack_require__(54);
  8974. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_28__material_tab_scroller_index__ = __webpack_require__(56);
  8975. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_29__material_textfield_index__ = __webpack_require__(145);
  8976. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_30__material_toolbar_index__ = __webpack_require__(151);
  8977. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_31__material_top_app_bar_index__ = __webpack_require__(154);
  8978. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "autoInit", function() { return __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a"]; });
  8979. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "base", function() { return __WEBPACK_IMPORTED_MODULE_1__material_base_index__; });
  8980. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "checkbox", function() { return __WEBPACK_IMPORTED_MODULE_2__material_checkbox_index__; });
  8981. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "chips", function() { return __WEBPACK_IMPORTED_MODULE_3__material_chips_index__; });
  8982. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "dialog", function() { return __WEBPACK_IMPORTED_MODULE_4__material_dialog_index__; });
  8983. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "dom", function() { return __WEBPACK_IMPORTED_MODULE_5__material_dom_index__; });
  8984. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "drawer", function() { return __WEBPACK_IMPORTED_MODULE_6__material_drawer_index__; });
  8985. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "floatingLabel", function() { return __WEBPACK_IMPORTED_MODULE_7__material_floating_label_index__; });
  8986. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "formField", function() { return __WEBPACK_IMPORTED_MODULE_8__material_form_field_index__; });
  8987. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "gridList", function() { return __WEBPACK_IMPORTED_MODULE_9__material_grid_list_index__; });
  8988. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "iconButton", function() { return __WEBPACK_IMPORTED_MODULE_10__material_icon_button_index__; });
  8989. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "iconToggle", function() { return __WEBPACK_IMPORTED_MODULE_11__material_icon_toggle_index__; });
  8990. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "lineRipple", function() { return __WEBPACK_IMPORTED_MODULE_13__material_line_ripple_index__; });
  8991. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "linearProgress", function() { return __WEBPACK_IMPORTED_MODULE_12__material_linear_progress_index__; });
  8992. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "list", function() { return __WEBPACK_IMPORTED_MODULE_14__material_list_index__; });
  8993. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "menu", function() { return __WEBPACK_IMPORTED_MODULE_15__material_menu_index__; });
  8994. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "menuSurface", function() { return __WEBPACK_IMPORTED_MODULE_16__material_menu_surface_index__; });
  8995. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "notchedOutline", function() { return __WEBPACK_IMPORTED_MODULE_17__material_notched_outline_index__; });
  8996. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "radio", function() { return __WEBPACK_IMPORTED_MODULE_18__material_radio_index__; });
  8997. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "ripple", function() { return __WEBPACK_IMPORTED_MODULE_19__material_ripple_index__; });
  8998. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "select", function() { return __WEBPACK_IMPORTED_MODULE_20__material_select_index__; });
  8999. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "selectionControl", function() { return __WEBPACK_IMPORTED_MODULE_21__material_selection_control_index__; });
  9000. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "slider", function() { return __WEBPACK_IMPORTED_MODULE_22__material_slider_index__; });
  9001. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "switchControl", function() { return __WEBPACK_IMPORTED_MODULE_24__material_switch_index__; });
  9002. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "snackbar", function() { return __WEBPACK_IMPORTED_MODULE_23__material_snackbar_index__; });
  9003. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "tab", function() { return __WEBPACK_IMPORTED_MODULE_25__material_tab_index__; });
  9004. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "tabBar", function() { return __WEBPACK_IMPORTED_MODULE_26__material_tab_bar_index__; });
  9005. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "tabIndicator", function() { return __WEBPACK_IMPORTED_MODULE_27__material_tab_indicator_index__; });
  9006. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "tabScroller", function() { return __WEBPACK_IMPORTED_MODULE_28__material_tab_scroller_index__; });
  9007. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "textField", function() { return __WEBPACK_IMPORTED_MODULE_29__material_textfield_index__; });
  9008. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "toolbar", function() { return __WEBPACK_IMPORTED_MODULE_30__material_toolbar_index__; });
  9009. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "topAppBar", function() { return __WEBPACK_IMPORTED_MODULE_31__material_top_app_bar_index__; });
  9010. /**
  9011. * @license
  9012. * Copyright 2016 Google Inc.
  9013. *
  9014. * Permission is hereby granted, free of charge, to any person obtaining a copy
  9015. * of this software and associated documentation files (the "Software"), to deal
  9016. * in the Software without restriction, including without limitation the rights
  9017. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9018. * copies of the Software, and to permit persons to whom the Software is
  9019. * furnished to do so, subject to the following conditions:
  9020. *
  9021. * The above copyright notice and this permission notice shall be included in
  9022. * all copies or substantial portions of the Software.
  9023. *
  9024. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  9025. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  9026. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  9027. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  9028. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  9029. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  9030. * THE SOFTWARE.
  9031. */
  9032. // Register all components
  9033. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCCheckbox', __WEBPACK_IMPORTED_MODULE_2__material_checkbox_index__["MDCCheckbox"]);
  9034. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCChip', __WEBPACK_IMPORTED_MODULE_3__material_chips_index__["MDCChip"]);
  9035. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCChipSet', __WEBPACK_IMPORTED_MODULE_3__material_chips_index__["MDCChipSet"]);
  9036. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCDialog', __WEBPACK_IMPORTED_MODULE_4__material_dialog_index__["MDCDialog"]);
  9037. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCDrawer', __WEBPACK_IMPORTED_MODULE_6__material_drawer_index__["MDCDrawer"]);
  9038. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCFloatingLabel', __WEBPACK_IMPORTED_MODULE_7__material_floating_label_index__["MDCFloatingLabel"]);
  9039. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCFormField', __WEBPACK_IMPORTED_MODULE_8__material_form_field_index__["MDCFormField"]);
  9040. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCRipple', __WEBPACK_IMPORTED_MODULE_19__material_ripple_index__["MDCRipple"]);
  9041. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCGridList', __WEBPACK_IMPORTED_MODULE_9__material_grid_list_index__["MDCGridList"]);
  9042. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCIconButtonToggle', __WEBPACK_IMPORTED_MODULE_10__material_icon_button_index__["MDCIconButtonToggle"]);
  9043. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCIconToggle', __WEBPACK_IMPORTED_MODULE_11__material_icon_toggle_index__["MDCIconToggle"]);
  9044. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCLineRipple', __WEBPACK_IMPORTED_MODULE_13__material_line_ripple_index__["MDCLineRipple"]);
  9045. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCLinearProgress', __WEBPACK_IMPORTED_MODULE_12__material_linear_progress_index__["MDCLinearProgress"]);
  9046. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCList', __WEBPACK_IMPORTED_MODULE_14__material_list_index__["MDCList"]);
  9047. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCNotchedOutline', __WEBPACK_IMPORTED_MODULE_17__material_notched_outline_index__["MDCNotchedOutline"]);
  9048. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCRadio', __WEBPACK_IMPORTED_MODULE_18__material_radio_index__["MDCRadio"]);
  9049. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCSnackbar', __WEBPACK_IMPORTED_MODULE_23__material_snackbar_index__["MDCSnackbar"]);
  9050. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCTabBar', __WEBPACK_IMPORTED_MODULE_26__material_tab_bar_index__["MDCTabBar"]);
  9051. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCTextField', __WEBPACK_IMPORTED_MODULE_29__material_textfield_index__["MDCTextField"]);
  9052. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCMenu', __WEBPACK_IMPORTED_MODULE_15__material_menu_index__["MDCMenu"]);
  9053. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCMenuSurface', __WEBPACK_IMPORTED_MODULE_16__material_menu_surface_index__["MDCMenuSurface"]);
  9054. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCSelect', __WEBPACK_IMPORTED_MODULE_20__material_select_index__["MDCSelect"]);
  9055. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCSlider', __WEBPACK_IMPORTED_MODULE_22__material_slider_index__["MDCSlider"]);
  9056. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCSwitch', __WEBPACK_IMPORTED_MODULE_24__material_switch_index__["MDCSwitch"]);
  9057. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCToolbar', __WEBPACK_IMPORTED_MODULE_30__material_toolbar_index__["MDCToolbar"]);
  9058. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCTopAppBar', __WEBPACK_IMPORTED_MODULE_31__material_top_app_bar_index__["MDCTopAppBar"]);
  9059. // Export all components.
  9060. /***/ }),
  9061. /* 64 */
  9062. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9063. "use strict";
  9064. /* harmony export (immutable) */ __webpack_exports__["a"] = mdcAutoInit;
  9065. /**
  9066. * @license
  9067. * Copyright 2016 Google Inc.
  9068. *
  9069. * Permission is hereby granted, free of charge, to any person obtaining a copy
  9070. * of this software and associated documentation files (the "Software"), to deal
  9071. * in the Software without restriction, including without limitation the rights
  9072. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9073. * copies of the Software, and to permit persons to whom the Software is
  9074. * furnished to do so, subject to the following conditions:
  9075. *
  9076. * The above copyright notice and this permission notice shall be included in
  9077. * all copies or substantial portions of the Software.
  9078. *
  9079. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  9080. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  9081. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  9082. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  9083. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  9084. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  9085. * THE SOFTWARE.
  9086. */
  9087. var registry = Object.create(null);
  9088. var CONSOLE_WARN = console.warn.bind(console);
  9089. function _emit(evtType, evtData) {
  9090. var shouldBubble = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  9091. var evt = void 0;
  9092. if (typeof CustomEvent === 'function') {
  9093. evt = new CustomEvent(evtType, {
  9094. detail: evtData,
  9095. bubbles: shouldBubble
  9096. });
  9097. } else {
  9098. evt = document.createEvent('CustomEvent');
  9099. evt.initCustomEvent(evtType, shouldBubble, false, evtData);
  9100. }
  9101. document.dispatchEvent(evt);
  9102. }
  9103. /**
  9104. * Auto-initializes all mdc components on a page.
  9105. */
  9106. function mdcAutoInit() {
  9107. var root = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document;
  9108. var warn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : CONSOLE_WARN;
  9109. var components = [];
  9110. var nodes = root.querySelectorAll('[data-mdc-auto-init]');
  9111. for (var i = 0, node; node = nodes[i]; i++) {
  9112. var ctorName = node.dataset.mdcAutoInit;
  9113. if (!ctorName) {
  9114. throw new Error('(mdc-auto-init) Constructor name must be given.');
  9115. }
  9116. var Ctor = registry[ctorName];
  9117. if (typeof Ctor !== 'function') {
  9118. throw new Error('(mdc-auto-init) Could not find constructor in registry for ' + ctorName);
  9119. }
  9120. if (node[ctorName]) {
  9121. warn('(mdc-auto-init) Component already initialized for ' + node + '. Skipping...');
  9122. continue;
  9123. }
  9124. // TODO: Should we make an eslint rule for an attachTo() static method?
  9125. var component = Ctor.attachTo(node);
  9126. Object.defineProperty(node, ctorName, {
  9127. value: component,
  9128. writable: false,
  9129. enumerable: false,
  9130. configurable: true
  9131. });
  9132. components.push(component);
  9133. }
  9134. _emit('MDCAutoInit:End', {});
  9135. return components;
  9136. }
  9137. mdcAutoInit.register = function (componentName, Ctor) {
  9138. var warn = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : CONSOLE_WARN;
  9139. if (typeof Ctor !== 'function') {
  9140. throw new Error('(mdc-auto-init) Invalid Ctor value ' + Ctor + '. Expected function');
  9141. }
  9142. if (registry[componentName]) {
  9143. warn('(mdc-auto-init) Overriding registration for ' + componentName + ' with ' + Ctor + '. ' + ('Was: ' + registry[componentName]));
  9144. }
  9145. registry[componentName] = Ctor;
  9146. };
  9147. mdcAutoInit.deregister = function (componentName) {
  9148. delete registry[componentName];
  9149. };
  9150. mdcAutoInit.deregisterAll = function () {
  9151. Object.keys(registry).forEach(this.deregister, this);
  9152. };
  9153. /***/ }),
  9154. /* 65 */
  9155. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9156. "use strict";
  9157. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  9158. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCCheckbox", function() { return MDCCheckbox; });
  9159. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_animation_index__ = __webpack_require__(9);
  9160. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_component__ = __webpack_require__(1);
  9161. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_selection_control_index__ = __webpack_require__(4);
  9162. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation__ = __webpack_require__(68);
  9163. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__material_ripple_index__ = __webpack_require__(2);
  9164. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__material_ripple_util__ = __webpack_require__(6);
  9165. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCCheckboxFoundation", function() { return __WEBPACK_IMPORTED_MODULE_3__foundation__["a"]; });
  9166. 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; };
  9167. 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); } };
  9168. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  9169. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9170. 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; }
  9171. 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; }
  9172. /**
  9173. * @license
  9174. * Copyright 2016 Google Inc.
  9175. *
  9176. * Permission is hereby granted, free of charge, to any person obtaining a copy
  9177. * of this software and associated documentation files (the "Software"), to deal
  9178. * in the Software without restriction, including without limitation the rights
  9179. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9180. * copies of the Software, and to permit persons to whom the Software is
  9181. * furnished to do so, subject to the following conditions:
  9182. *
  9183. * The above copyright notice and this permission notice shall be included in
  9184. * all copies or substantial portions of the Software.
  9185. *
  9186. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  9187. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  9188. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  9189. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  9190. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  9191. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  9192. * THE SOFTWARE.
  9193. */
  9194. /* eslint-disable no-unused-vars */
  9195. /* eslint-enable no-unused-vars */
  9196. /**
  9197. * @extends MDCComponent<!MDCCheckboxFoundation>
  9198. * @implements {MDCSelectionControl}
  9199. */
  9200. var MDCCheckbox = function (_MDCComponent) {
  9201. _inherits(MDCCheckbox, _MDCComponent);
  9202. _createClass(MDCCheckbox, [{
  9203. key: 'nativeCb_',
  9204. /**
  9205. * Returns the state of the native control element, or null if the native control element is not present.
  9206. * @return {?MDCSelectionControlState}
  9207. * @private
  9208. */
  9209. get: function get() {
  9210. var NATIVE_CONTROL_SELECTOR = __WEBPACK_IMPORTED_MODULE_3__foundation__["a" /* default */].strings.NATIVE_CONTROL_SELECTOR;
  9211. var cbEl = /** @type {?MDCSelectionControlState} */this.root_.querySelector(NATIVE_CONTROL_SELECTOR);
  9212. return cbEl;
  9213. }
  9214. }], [{
  9215. key: 'attachTo',
  9216. value: function attachTo(root) {
  9217. return new MDCCheckbox(root);
  9218. }
  9219. }]);
  9220. function MDCCheckbox() {
  9221. var _ref;
  9222. _classCallCheck(this, MDCCheckbox);
  9223. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  9224. args[_key] = arguments[_key];
  9225. }
  9226. /** @private {!MDCRipple} */
  9227. var _this = _possibleConstructorReturn(this, (_ref = MDCCheckbox.__proto__ || Object.getPrototypeOf(MDCCheckbox)).call.apply(_ref, [this].concat(args)));
  9228. _this.ripple_ = _this.initRipple_();
  9229. /** @private {!Function} */
  9230. _this.handleChange_;
  9231. /** @private {!Function} */
  9232. _this.handleAnimationEnd_;
  9233. return _this;
  9234. }
  9235. _createClass(MDCCheckbox, [{
  9236. key: 'initialSyncWithDOM',
  9237. value: function initialSyncWithDOM() {
  9238. var _this2 = this;
  9239. this.handleChange_ = function () {
  9240. return _this2.foundation_.handleChange();
  9241. };
  9242. this.handleAnimationEnd_ = function () {
  9243. return _this2.foundation_.handleAnimationEnd();
  9244. };
  9245. this.nativeCb_.addEventListener('change', this.handleChange_);
  9246. this.listen(Object(__WEBPACK_IMPORTED_MODULE_0__material_animation_index__["a" /* getCorrectEventName */])(window, 'animationend'), this.handleAnimationEnd_);
  9247. }
  9248. /**
  9249. * @return {!MDCRipple}
  9250. * @private
  9251. */
  9252. }, {
  9253. key: 'initRipple_',
  9254. value: function initRipple_() {
  9255. var _this3 = this;
  9256. var MATCHES = Object(__WEBPACK_IMPORTED_MODULE_5__material_ripple_util__["getMatchesProperty"])(HTMLElement.prototype);
  9257. var adapter = _extends(__WEBPACK_IMPORTED_MODULE_4__material_ripple_index__["MDCRipple"].createAdapter(this), {
  9258. isUnbounded: function isUnbounded() {
  9259. return true;
  9260. },
  9261. isSurfaceActive: function isSurfaceActive() {
  9262. return _this3.nativeCb_[MATCHES](':active');
  9263. },
  9264. registerInteractionHandler: function registerInteractionHandler(type, handler) {
  9265. return _this3.nativeCb_.addEventListener(type, handler);
  9266. },
  9267. deregisterInteractionHandler: function deregisterInteractionHandler(type, handler) {
  9268. return _this3.nativeCb_.removeEventListener(type, handler);
  9269. }
  9270. });
  9271. var foundation = new __WEBPACK_IMPORTED_MODULE_4__material_ripple_index__["MDCRippleFoundation"](adapter);
  9272. return new __WEBPACK_IMPORTED_MODULE_4__material_ripple_index__["MDCRipple"](this.root_, foundation);
  9273. }
  9274. /** @return {!MDCCheckboxFoundation} */
  9275. }, {
  9276. key: 'getDefaultFoundation',
  9277. value: function getDefaultFoundation() {
  9278. var _this4 = this;
  9279. return new __WEBPACK_IMPORTED_MODULE_3__foundation__["a" /* default */]({
  9280. addClass: function addClass(className) {
  9281. return _this4.root_.classList.add(className);
  9282. },
  9283. removeClass: function removeClass(className) {
  9284. return _this4.root_.classList.remove(className);
  9285. },
  9286. setNativeControlAttr: function setNativeControlAttr(attr, value) {
  9287. return _this4.nativeCb_.setAttribute(attr, value);
  9288. },
  9289. removeNativeControlAttr: function removeNativeControlAttr(attr) {
  9290. return _this4.nativeCb_.removeAttribute(attr);
  9291. },
  9292. getNativeControl: function getNativeControl() {
  9293. return _this4.nativeCb_;
  9294. },
  9295. isIndeterminate: function isIndeterminate() {
  9296. return _this4.indeterminate;
  9297. },
  9298. isChecked: function isChecked() {
  9299. return _this4.checked;
  9300. },
  9301. hasNativeControl: function hasNativeControl() {
  9302. return !!_this4.nativeCb_;
  9303. },
  9304. setNativeControlDisabled: function setNativeControlDisabled(disabled) {
  9305. return _this4.nativeCb_.disabled = disabled;
  9306. },
  9307. forceLayout: function forceLayout() {
  9308. return _this4.root_.offsetWidth;
  9309. },
  9310. isAttachedToDOM: function isAttachedToDOM() {
  9311. return Boolean(_this4.root_.parentNode);
  9312. }
  9313. });
  9314. }
  9315. /** @return {!MDCRipple} */
  9316. }, {
  9317. key: 'destroy',
  9318. value: function destroy() {
  9319. this.ripple_.destroy();
  9320. this.nativeCb_.removeEventListener('change', this.handleChange_);
  9321. this.unlisten(Object(__WEBPACK_IMPORTED_MODULE_0__material_animation_index__["a" /* getCorrectEventName */])(window, 'animationend'), this.handleAnimationEnd_);
  9322. _get(MDCCheckbox.prototype.__proto__ || Object.getPrototypeOf(MDCCheckbox.prototype), 'destroy', this).call(this);
  9323. }
  9324. }, {
  9325. key: 'ripple',
  9326. get: function get() {
  9327. return this.ripple_;
  9328. }
  9329. /** @return {boolean} */
  9330. }, {
  9331. key: 'checked',
  9332. get: function get() {
  9333. return this.nativeCb_.checked;
  9334. }
  9335. /** @param {boolean} checked */
  9336. ,
  9337. set: function set(checked) {
  9338. this.nativeCb_.checked = checked;
  9339. }
  9340. /** @return {boolean} */
  9341. }, {
  9342. key: 'indeterminate',
  9343. get: function get() {
  9344. return this.nativeCb_.indeterminate;
  9345. }
  9346. /** @param {boolean} indeterminate */
  9347. ,
  9348. set: function set(indeterminate) {
  9349. this.nativeCb_.indeterminate = indeterminate;
  9350. }
  9351. /** @return {boolean} */
  9352. }, {
  9353. key: 'disabled',
  9354. get: function get() {
  9355. return this.nativeCb_.disabled;
  9356. }
  9357. /** @param {boolean} disabled */
  9358. ,
  9359. set: function set(disabled) {
  9360. this.foundation_.setDisabled(disabled);
  9361. }
  9362. /** @return {?string} */
  9363. }, {
  9364. key: 'value',
  9365. get: function get() {
  9366. return this.nativeCb_.value;
  9367. }
  9368. /** @param {?string} value */
  9369. ,
  9370. set: function set(value) {
  9371. this.nativeCb_.value = value;
  9372. }
  9373. }]);
  9374. return MDCCheckbox;
  9375. }(__WEBPACK_IMPORTED_MODULE_1__material_base_component__["a" /* default */]);
  9376. /***/ }),
  9377. /* 66 */
  9378. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9379. "use strict";
  9380. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  9381. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(29);
  9382. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(67);
  9383. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util__ = __webpack_require__(6);
  9384. 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; };
  9385. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  9386. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9387. 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; }
  9388. 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; }
  9389. /**
  9390. * @license
  9391. * Copyright 2016 Google Inc.
  9392. *
  9393. * Permission is hereby granted, free of charge, to any person obtaining a copy
  9394. * of this software and associated documentation files (the "Software"), to deal
  9395. * in the Software without restriction, including without limitation the rights
  9396. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9397. * copies of the Software, and to permit persons to whom the Software is
  9398. * furnished to do so, subject to the following conditions:
  9399. *
  9400. * The above copyright notice and this permission notice shall be included in
  9401. * all copies or substantial portions of the Software.
  9402. *
  9403. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  9404. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  9405. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  9406. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  9407. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  9408. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  9409. * THE SOFTWARE.
  9410. */
  9411. /**
  9412. * @typedef {{
  9413. * isActivated: (boolean|undefined),
  9414. * hasDeactivationUXRun: (boolean|undefined),
  9415. * wasActivatedByPointer: (boolean|undefined),
  9416. * wasElementMadeActive: (boolean|undefined),
  9417. * activationEvent: (!Event|undefined),
  9418. * isProgrammatic: (boolean|undefined)
  9419. * }}
  9420. */
  9421. var ActivationStateType = void 0;
  9422. /**
  9423. * @typedef {{
  9424. * activate: (string|undefined),
  9425. * deactivate: (string|undefined),
  9426. * focus: (string|undefined),
  9427. * blur: (string|undefined)
  9428. * }}
  9429. */
  9430. var ListenerInfoType = void 0;
  9431. /**
  9432. * @typedef {{
  9433. * activate: function(!Event),
  9434. * deactivate: function(!Event=),
  9435. * focus: function(),
  9436. * blur: function()
  9437. * }}
  9438. */
  9439. var ListenersType = void 0;
  9440. /**
  9441. * @typedef {{
  9442. * x: number,
  9443. * y: number
  9444. * }}
  9445. */
  9446. var PointType = void 0;
  9447. // Activation events registered on the root element of each instance for activation
  9448. var ACTIVATION_EVENT_TYPES = ['touchstart', 'pointerdown', 'mousedown', 'keydown'];
  9449. // Deactivation events registered on documentElement when a pointer-related down event occurs
  9450. var POINTER_DEACTIVATION_EVENT_TYPES = ['touchend', 'pointerup', 'mouseup', 'contextmenu'];
  9451. // Tracks activations that have occurred on the current frame, to avoid simultaneous nested activations
  9452. /** @type {!Array<!EventTarget>} */
  9453. var activatedTargets = [];
  9454. /**
  9455. * @extends {MDCFoundation<!MDCRippleAdapter>}
  9456. */
  9457. var MDCRippleFoundation = function (_MDCFoundation) {
  9458. _inherits(MDCRippleFoundation, _MDCFoundation);
  9459. _createClass(MDCRippleFoundation, null, [{
  9460. key: 'cssClasses',
  9461. get: function get() {
  9462. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  9463. }
  9464. }, {
  9465. key: 'strings',
  9466. get: function get() {
  9467. return __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */];
  9468. }
  9469. }, {
  9470. key: 'numbers',
  9471. get: function get() {
  9472. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */];
  9473. }
  9474. }, {
  9475. key: 'defaultAdapter',
  9476. get: function get() {
  9477. return {
  9478. browserSupportsCssVars: function browserSupportsCssVars() /* boolean - cached */{},
  9479. isUnbounded: function isUnbounded() /* boolean */{},
  9480. isSurfaceActive: function isSurfaceActive() /* boolean */{},
  9481. isSurfaceDisabled: function isSurfaceDisabled() /* boolean */{},
  9482. addClass: function addClass() /* className: string */{},
  9483. removeClass: function removeClass() /* className: string */{},
  9484. containsEventTarget: function containsEventTarget() /* target: !EventTarget */{},
  9485. registerInteractionHandler: function registerInteractionHandler() /* evtType: string, handler: EventListener */{},
  9486. deregisterInteractionHandler: function deregisterInteractionHandler() /* evtType: string, handler: EventListener */{},
  9487. registerDocumentInteractionHandler: function registerDocumentInteractionHandler() /* evtType: string, handler: EventListener */{},
  9488. deregisterDocumentInteractionHandler: function deregisterDocumentInteractionHandler() /* evtType: string, handler: EventListener */{},
  9489. registerResizeHandler: function registerResizeHandler() /* handler: EventListener */{},
  9490. deregisterResizeHandler: function deregisterResizeHandler() /* handler: EventListener */{},
  9491. updateCssVariable: function updateCssVariable() /* varName: string, value: string */{},
  9492. computeBoundingRect: function computeBoundingRect() /* ClientRect */{},
  9493. getWindowPageOffset: function getWindowPageOffset() /* {x: number, y: number} */{}
  9494. };
  9495. }
  9496. }]);
  9497. function MDCRippleFoundation(adapter) {
  9498. _classCallCheck(this, MDCRippleFoundation);
  9499. /** @private {number} */
  9500. var _this = _possibleConstructorReturn(this, (MDCRippleFoundation.__proto__ || Object.getPrototypeOf(MDCRippleFoundation)).call(this, _extends(MDCRippleFoundation.defaultAdapter, adapter)));
  9501. _this.layoutFrame_ = 0;
  9502. /** @private {!ClientRect} */
  9503. _this.frame_ = /** @type {!ClientRect} */{ width: 0, height: 0 };
  9504. /** @private {!ActivationStateType} */
  9505. _this.activationState_ = _this.defaultActivationState_();
  9506. /** @private {number} */
  9507. _this.initialSize_ = 0;
  9508. /** @private {number} */
  9509. _this.maxRadius_ = 0;
  9510. /** @private {function(!Event)} */
  9511. _this.activateHandler_ = function (e) {
  9512. return _this.activate_(e);
  9513. };
  9514. /** @private {function(!Event=)} */
  9515. _this.deactivateHandler_ = function () {
  9516. return _this.deactivate_();
  9517. };
  9518. /** @private {function(!Event=)} */
  9519. _this.focusHandler_ = function () {
  9520. return _this.handleFocus();
  9521. };
  9522. /** @private {function(!Event=)} */
  9523. _this.blurHandler_ = function () {
  9524. return _this.handleBlur();
  9525. };
  9526. /** @private {!Function} */
  9527. _this.resizeHandler_ = function () {
  9528. return _this.layout();
  9529. };
  9530. /** @private {{left: number, top:number}} */
  9531. _this.unboundedCoords_ = {
  9532. left: 0,
  9533. top: 0
  9534. };
  9535. /** @private {number} */
  9536. _this.fgScale_ = 0;
  9537. /** @private {number} */
  9538. _this.activationTimer_ = 0;
  9539. /** @private {number} */
  9540. _this.fgDeactivationRemovalTimer_ = 0;
  9541. /** @private {boolean} */
  9542. _this.activationAnimationHasEnded_ = false;
  9543. /** @private {!Function} */
  9544. _this.activationTimerCallback_ = function () {
  9545. _this.activationAnimationHasEnded_ = true;
  9546. _this.runDeactivationUXLogicIfReady_();
  9547. };
  9548. /** @private {!Event|undefined} */
  9549. _this.previousActivationEvent_;
  9550. return _this;
  9551. }
  9552. /**
  9553. * We compute this property so that we are not querying information about the client
  9554. * until the point in time where the foundation requests it. This prevents scenarios where
  9555. * client-side feature-detection may happen too early, such as when components are rendered on the server
  9556. * and then initialized at mount time on the client.
  9557. * @return {boolean}
  9558. * @private
  9559. */
  9560. _createClass(MDCRippleFoundation, [{
  9561. key: 'supportsPressRipple_',
  9562. value: function supportsPressRipple_() {
  9563. return this.adapter_.browserSupportsCssVars();
  9564. }
  9565. /**
  9566. * @return {!ActivationStateType}
  9567. */
  9568. }, {
  9569. key: 'defaultActivationState_',
  9570. value: function defaultActivationState_() {
  9571. return {
  9572. isActivated: false,
  9573. hasDeactivationUXRun: false,
  9574. wasActivatedByPointer: false,
  9575. wasElementMadeActive: false,
  9576. activationEvent: undefined,
  9577. isProgrammatic: false
  9578. };
  9579. }
  9580. /** @override */
  9581. }, {
  9582. key: 'init',
  9583. value: function init() {
  9584. var _this2 = this;
  9585. var supportsPressRipple = this.supportsPressRipple_();
  9586. this.registerRootHandlers_(supportsPressRipple);
  9587. if (supportsPressRipple) {
  9588. var _MDCRippleFoundation$ = MDCRippleFoundation.cssClasses,
  9589. ROOT = _MDCRippleFoundation$.ROOT,
  9590. UNBOUNDED = _MDCRippleFoundation$.UNBOUNDED;
  9591. requestAnimationFrame(function () {
  9592. _this2.adapter_.addClass(ROOT);
  9593. if (_this2.adapter_.isUnbounded()) {
  9594. _this2.adapter_.addClass(UNBOUNDED);
  9595. // Unbounded ripples need layout logic applied immediately to set coordinates for both shade and ripple
  9596. _this2.layoutInternal_();
  9597. }
  9598. });
  9599. }
  9600. }
  9601. /** @override */
  9602. }, {
  9603. key: 'destroy',
  9604. value: function destroy() {
  9605. var _this3 = this;
  9606. if (this.supportsPressRipple_()) {
  9607. if (this.activationTimer_) {
  9608. clearTimeout(this.activationTimer_);
  9609. this.activationTimer_ = 0;
  9610. this.adapter_.removeClass(MDCRippleFoundation.cssClasses.FG_ACTIVATION);
  9611. }
  9612. if (this.fgDeactivationRemovalTimer_) {
  9613. clearTimeout(this.fgDeactivationRemovalTimer_);
  9614. this.fgDeactivationRemovalTimer_ = 0;
  9615. this.adapter_.removeClass(MDCRippleFoundation.cssClasses.FG_DEACTIVATION);
  9616. }
  9617. var _MDCRippleFoundation$2 = MDCRippleFoundation.cssClasses,
  9618. ROOT = _MDCRippleFoundation$2.ROOT,
  9619. UNBOUNDED = _MDCRippleFoundation$2.UNBOUNDED;
  9620. requestAnimationFrame(function () {
  9621. _this3.adapter_.removeClass(ROOT);
  9622. _this3.adapter_.removeClass(UNBOUNDED);
  9623. _this3.removeCssVars_();
  9624. });
  9625. }
  9626. this.deregisterRootHandlers_();
  9627. this.deregisterDeactivationHandlers_();
  9628. }
  9629. /**
  9630. * @param {boolean} supportsPressRipple Passed from init to save a redundant function call
  9631. * @private
  9632. */
  9633. }, {
  9634. key: 'registerRootHandlers_',
  9635. value: function registerRootHandlers_(supportsPressRipple) {
  9636. var _this4 = this;
  9637. if (supportsPressRipple) {
  9638. ACTIVATION_EVENT_TYPES.forEach(function (type) {
  9639. _this4.adapter_.registerInteractionHandler(type, _this4.activateHandler_);
  9640. });
  9641. if (this.adapter_.isUnbounded()) {
  9642. this.adapter_.registerResizeHandler(this.resizeHandler_);
  9643. }
  9644. }
  9645. this.adapter_.registerInteractionHandler('focus', this.focusHandler_);
  9646. this.adapter_.registerInteractionHandler('blur', this.blurHandler_);
  9647. }
  9648. /**
  9649. * @param {!Event} e
  9650. * @private
  9651. */
  9652. }, {
  9653. key: 'registerDeactivationHandlers_',
  9654. value: function registerDeactivationHandlers_(e) {
  9655. var _this5 = this;
  9656. if (e.type === 'keydown') {
  9657. this.adapter_.registerInteractionHandler('keyup', this.deactivateHandler_);
  9658. } else {
  9659. POINTER_DEACTIVATION_EVENT_TYPES.forEach(function (type) {
  9660. _this5.adapter_.registerDocumentInteractionHandler(type, _this5.deactivateHandler_);
  9661. });
  9662. }
  9663. }
  9664. /** @private */
  9665. }, {
  9666. key: 'deregisterRootHandlers_',
  9667. value: function deregisterRootHandlers_() {
  9668. var _this6 = this;
  9669. ACTIVATION_EVENT_TYPES.forEach(function (type) {
  9670. _this6.adapter_.deregisterInteractionHandler(type, _this6.activateHandler_);
  9671. });
  9672. this.adapter_.deregisterInteractionHandler('focus', this.focusHandler_);
  9673. this.adapter_.deregisterInteractionHandler('blur', this.blurHandler_);
  9674. if (this.adapter_.isUnbounded()) {
  9675. this.adapter_.deregisterResizeHandler(this.resizeHandler_);
  9676. }
  9677. }
  9678. /** @private */
  9679. }, {
  9680. key: 'deregisterDeactivationHandlers_',
  9681. value: function deregisterDeactivationHandlers_() {
  9682. var _this7 = this;
  9683. this.adapter_.deregisterInteractionHandler('keyup', this.deactivateHandler_);
  9684. POINTER_DEACTIVATION_EVENT_TYPES.forEach(function (type) {
  9685. _this7.adapter_.deregisterDocumentInteractionHandler(type, _this7.deactivateHandler_);
  9686. });
  9687. }
  9688. /** @private */
  9689. }, {
  9690. key: 'removeCssVars_',
  9691. value: function removeCssVars_() {
  9692. var _this8 = this;
  9693. var strings = MDCRippleFoundation.strings;
  9694. Object.keys(strings).forEach(function (k) {
  9695. if (k.indexOf('VAR_') === 0) {
  9696. _this8.adapter_.updateCssVariable(strings[k], null);
  9697. }
  9698. });
  9699. }
  9700. /**
  9701. * @param {!Event=} e
  9702. * @private
  9703. */
  9704. }, {
  9705. key: 'activate_',
  9706. value: function activate_(e) {
  9707. var _this9 = this;
  9708. if (this.adapter_.isSurfaceDisabled()) {
  9709. return;
  9710. }
  9711. var activationState = this.activationState_;
  9712. if (activationState.isActivated) {
  9713. return;
  9714. }
  9715. // Avoid reacting to follow-on events fired by touch device after an already-processed user interaction
  9716. var previousActivationEvent = this.previousActivationEvent_;
  9717. var isSameInteraction = previousActivationEvent && e !== undefined && previousActivationEvent.type !== e.type;
  9718. if (isSameInteraction) {
  9719. return;
  9720. }
  9721. activationState.isActivated = true;
  9722. activationState.isProgrammatic = e === undefined;
  9723. activationState.activationEvent = e;
  9724. activationState.wasActivatedByPointer = activationState.isProgrammatic ? false : e !== undefined && (e.type === 'mousedown' || e.type === 'touchstart' || e.type === 'pointerdown');
  9725. var hasActivatedChild = e !== undefined && activatedTargets.length > 0 && activatedTargets.some(function (target) {
  9726. return _this9.adapter_.containsEventTarget(target);
  9727. });
  9728. if (hasActivatedChild) {
  9729. // Immediately reset activation state, while preserving logic that prevents touch follow-on events
  9730. this.resetActivationState_();
  9731. return;
  9732. }
  9733. if (e !== undefined) {
  9734. activatedTargets.push( /** @type {!EventTarget} */e.target);
  9735. this.registerDeactivationHandlers_(e);
  9736. }
  9737. activationState.wasElementMadeActive = this.checkElementMadeActive_(e);
  9738. if (activationState.wasElementMadeActive) {
  9739. this.animateActivation_();
  9740. }
  9741. requestAnimationFrame(function () {
  9742. // Reset array on next frame after the current event has had a chance to bubble to prevent ancestor ripples
  9743. activatedTargets = [];
  9744. if (!activationState.wasElementMadeActive && e !== undefined && (e.key === ' ' || e.keyCode === 32)) {
  9745. // If space was pressed, try again within an rAF call to detect :active, because different UAs report
  9746. // active states inconsistently when they're called within event handling code:
  9747. // - https://bugs.chromium.org/p/chromium/issues/detail?id=635971
  9748. // - https://bugzilla.mozilla.org/show_bug.cgi?id=1293741
  9749. // We try first outside rAF to support Edge, which does not exhibit this problem, but will crash if a CSS
  9750. // variable is set within a rAF callback for a submit button interaction (#2241).
  9751. activationState.wasElementMadeActive = _this9.checkElementMadeActive_(e);
  9752. if (activationState.wasElementMadeActive) {
  9753. _this9.animateActivation_();
  9754. }
  9755. }
  9756. if (!activationState.wasElementMadeActive) {
  9757. // Reset activation state immediately if element was not made active.
  9758. _this9.activationState_ = _this9.defaultActivationState_();
  9759. }
  9760. });
  9761. }
  9762. /**
  9763. * @param {!Event=} e
  9764. * @private
  9765. */
  9766. }, {
  9767. key: 'checkElementMadeActive_',
  9768. value: function checkElementMadeActive_(e) {
  9769. return e !== undefined && e.type === 'keydown' ? this.adapter_.isSurfaceActive() : true;
  9770. }
  9771. /**
  9772. * @param {!Event=} event Optional event containing position information.
  9773. */
  9774. }, {
  9775. key: 'activate',
  9776. value: function activate(event) {
  9777. this.activate_(event);
  9778. }
  9779. /** @private */
  9780. }, {
  9781. key: 'animateActivation_',
  9782. value: function animateActivation_() {
  9783. var _this10 = this;
  9784. var _MDCRippleFoundation$3 = MDCRippleFoundation.strings,
  9785. VAR_FG_TRANSLATE_START = _MDCRippleFoundation$3.VAR_FG_TRANSLATE_START,
  9786. VAR_FG_TRANSLATE_END = _MDCRippleFoundation$3.VAR_FG_TRANSLATE_END;
  9787. var _MDCRippleFoundation$4 = MDCRippleFoundation.cssClasses,
  9788. FG_DEACTIVATION = _MDCRippleFoundation$4.FG_DEACTIVATION,
  9789. FG_ACTIVATION = _MDCRippleFoundation$4.FG_ACTIVATION;
  9790. var DEACTIVATION_TIMEOUT_MS = MDCRippleFoundation.numbers.DEACTIVATION_TIMEOUT_MS;
  9791. this.layoutInternal_();
  9792. var translateStart = '';
  9793. var translateEnd = '';
  9794. if (!this.adapter_.isUnbounded()) {
  9795. var _getFgTranslationCoor = this.getFgTranslationCoordinates_(),
  9796. startPoint = _getFgTranslationCoor.startPoint,
  9797. endPoint = _getFgTranslationCoor.endPoint;
  9798. translateStart = startPoint.x + 'px, ' + startPoint.y + 'px';
  9799. translateEnd = endPoint.x + 'px, ' + endPoint.y + 'px';
  9800. }
  9801. this.adapter_.updateCssVariable(VAR_FG_TRANSLATE_START, translateStart);
  9802. this.adapter_.updateCssVariable(VAR_FG_TRANSLATE_END, translateEnd);
  9803. // Cancel any ongoing activation/deactivation animations
  9804. clearTimeout(this.activationTimer_);
  9805. clearTimeout(this.fgDeactivationRemovalTimer_);
  9806. this.rmBoundedActivationClasses_();
  9807. this.adapter_.removeClass(FG_DEACTIVATION);
  9808. // Force layout in order to re-trigger the animation.
  9809. this.adapter_.computeBoundingRect();
  9810. this.adapter_.addClass(FG_ACTIVATION);
  9811. this.activationTimer_ = setTimeout(function () {
  9812. return _this10.activationTimerCallback_();
  9813. }, DEACTIVATION_TIMEOUT_MS);
  9814. }
  9815. /**
  9816. * @private
  9817. * @return {{startPoint: PointType, endPoint: PointType}}
  9818. */
  9819. }, {
  9820. key: 'getFgTranslationCoordinates_',
  9821. value: function getFgTranslationCoordinates_() {
  9822. var _activationState_ = this.activationState_,
  9823. activationEvent = _activationState_.activationEvent,
  9824. wasActivatedByPointer = _activationState_.wasActivatedByPointer;
  9825. var startPoint = void 0;
  9826. if (wasActivatedByPointer) {
  9827. startPoint = Object(__WEBPACK_IMPORTED_MODULE_3__util__["getNormalizedEventCoords"])(
  9828. /** @type {!Event} */activationEvent, this.adapter_.getWindowPageOffset(), this.adapter_.computeBoundingRect());
  9829. } else {
  9830. startPoint = {
  9831. x: this.frame_.width / 2,
  9832. y: this.frame_.height / 2
  9833. };
  9834. }
  9835. // Center the element around the start point.
  9836. startPoint = {
  9837. x: startPoint.x - this.initialSize_ / 2,
  9838. y: startPoint.y - this.initialSize_ / 2
  9839. };
  9840. var endPoint = {
  9841. x: this.frame_.width / 2 - this.initialSize_ / 2,
  9842. y: this.frame_.height / 2 - this.initialSize_ / 2
  9843. };
  9844. return { startPoint: startPoint, endPoint: endPoint };
  9845. }
  9846. /** @private */
  9847. }, {
  9848. key: 'runDeactivationUXLogicIfReady_',
  9849. value: function runDeactivationUXLogicIfReady_() {
  9850. var _this11 = this;
  9851. // This method is called both when a pointing device is released, and when the activation animation ends.
  9852. // The deactivation animation should only run after both of those occur.
  9853. var FG_DEACTIVATION = MDCRippleFoundation.cssClasses.FG_DEACTIVATION;
  9854. var _activationState_2 = this.activationState_,
  9855. hasDeactivationUXRun = _activationState_2.hasDeactivationUXRun,
  9856. isActivated = _activationState_2.isActivated;
  9857. var activationHasEnded = hasDeactivationUXRun || !isActivated;
  9858. if (activationHasEnded && this.activationAnimationHasEnded_) {
  9859. this.rmBoundedActivationClasses_();
  9860. this.adapter_.addClass(FG_DEACTIVATION);
  9861. this.fgDeactivationRemovalTimer_ = setTimeout(function () {
  9862. _this11.adapter_.removeClass(FG_DEACTIVATION);
  9863. }, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].FG_DEACTIVATION_MS);
  9864. }
  9865. }
  9866. /** @private */
  9867. }, {
  9868. key: 'rmBoundedActivationClasses_',
  9869. value: function rmBoundedActivationClasses_() {
  9870. var FG_ACTIVATION = MDCRippleFoundation.cssClasses.FG_ACTIVATION;
  9871. this.adapter_.removeClass(FG_ACTIVATION);
  9872. this.activationAnimationHasEnded_ = false;
  9873. this.adapter_.computeBoundingRect();
  9874. }
  9875. }, {
  9876. key: 'resetActivationState_',
  9877. value: function resetActivationState_() {
  9878. var _this12 = this;
  9879. this.previousActivationEvent_ = this.activationState_.activationEvent;
  9880. this.activationState_ = this.defaultActivationState_();
  9881. // Touch devices may fire additional events for the same interaction within a short time.
  9882. // Store the previous event until it's safe to assume that subsequent events are for new interactions.
  9883. setTimeout(function () {
  9884. return _this12.previousActivationEvent_ = undefined;
  9885. }, MDCRippleFoundation.numbers.TAP_DELAY_MS);
  9886. }
  9887. /**
  9888. * @private
  9889. */
  9890. }, {
  9891. key: 'deactivate_',
  9892. value: function deactivate_() {
  9893. var _this13 = this;
  9894. var activationState = this.activationState_;
  9895. // This can happen in scenarios such as when you have a keyup event that blurs the element.
  9896. if (!activationState.isActivated) {
  9897. return;
  9898. }
  9899. var state = /** @type {!ActivationStateType} */_extends({}, activationState);
  9900. if (activationState.isProgrammatic) {
  9901. requestAnimationFrame(function () {
  9902. return _this13.animateDeactivation_(state);
  9903. });
  9904. this.resetActivationState_();
  9905. } else {
  9906. this.deregisterDeactivationHandlers_();
  9907. requestAnimationFrame(function () {
  9908. _this13.activationState_.hasDeactivationUXRun = true;
  9909. _this13.animateDeactivation_(state);
  9910. _this13.resetActivationState_();
  9911. });
  9912. }
  9913. }
  9914. }, {
  9915. key: 'deactivate',
  9916. value: function deactivate() {
  9917. this.deactivate_();
  9918. }
  9919. /**
  9920. * @param {!ActivationStateType} options
  9921. * @private
  9922. */
  9923. }, {
  9924. key: 'animateDeactivation_',
  9925. value: function animateDeactivation_(_ref) {
  9926. var wasActivatedByPointer = _ref.wasActivatedByPointer,
  9927. wasElementMadeActive = _ref.wasElementMadeActive;
  9928. if (wasActivatedByPointer || wasElementMadeActive) {
  9929. this.runDeactivationUXLogicIfReady_();
  9930. }
  9931. }
  9932. }, {
  9933. key: 'layout',
  9934. value: function layout() {
  9935. var _this14 = this;
  9936. if (this.layoutFrame_) {
  9937. cancelAnimationFrame(this.layoutFrame_);
  9938. }
  9939. this.layoutFrame_ = requestAnimationFrame(function () {
  9940. _this14.layoutInternal_();
  9941. _this14.layoutFrame_ = 0;
  9942. });
  9943. }
  9944. /** @private */
  9945. }, {
  9946. key: 'layoutInternal_',
  9947. value: function layoutInternal_() {
  9948. var _this15 = this;
  9949. this.frame_ = this.adapter_.computeBoundingRect();
  9950. var maxDim = Math.max(this.frame_.height, this.frame_.width);
  9951. // Surface diameter is treated differently for unbounded vs. bounded ripples.
  9952. // Unbounded ripple diameter is calculated smaller since the surface is expected to already be padded appropriately
  9953. // to extend the hitbox, and the ripple is expected to meet the edges of the padded hitbox (which is typically
  9954. // square). Bounded ripples, on the other hand, are fully expected to expand beyond the surface's longest diameter
  9955. // (calculated based on the diagonal plus a constant padding), and are clipped at the surface's border via
  9956. // `overflow: hidden`.
  9957. var getBoundedRadius = function getBoundedRadius() {
  9958. var hypotenuse = Math.sqrt(Math.pow(_this15.frame_.width, 2) + Math.pow(_this15.frame_.height, 2));
  9959. return hypotenuse + MDCRippleFoundation.numbers.PADDING;
  9960. };
  9961. this.maxRadius_ = this.adapter_.isUnbounded() ? maxDim : getBoundedRadius();
  9962. // Ripple is sized as a fraction of the largest dimension of the surface, then scales up using a CSS scale transform
  9963. this.initialSize_ = Math.floor(maxDim * MDCRippleFoundation.numbers.INITIAL_ORIGIN_SCALE);
  9964. this.fgScale_ = this.maxRadius_ / this.initialSize_;
  9965. this.updateLayoutCssVars_();
  9966. }
  9967. /** @private */
  9968. }, {
  9969. key: 'updateLayoutCssVars_',
  9970. value: function updateLayoutCssVars_() {
  9971. var _MDCRippleFoundation$5 = MDCRippleFoundation.strings,
  9972. VAR_FG_SIZE = _MDCRippleFoundation$5.VAR_FG_SIZE,
  9973. VAR_LEFT = _MDCRippleFoundation$5.VAR_LEFT,
  9974. VAR_TOP = _MDCRippleFoundation$5.VAR_TOP,
  9975. VAR_FG_SCALE = _MDCRippleFoundation$5.VAR_FG_SCALE;
  9976. this.adapter_.updateCssVariable(VAR_FG_SIZE, this.initialSize_ + 'px');
  9977. this.adapter_.updateCssVariable(VAR_FG_SCALE, this.fgScale_);
  9978. if (this.adapter_.isUnbounded()) {
  9979. this.unboundedCoords_ = {
  9980. left: Math.round(this.frame_.width / 2 - this.initialSize_ / 2),
  9981. top: Math.round(this.frame_.height / 2 - this.initialSize_ / 2)
  9982. };
  9983. this.adapter_.updateCssVariable(VAR_LEFT, this.unboundedCoords_.left + 'px');
  9984. this.adapter_.updateCssVariable(VAR_TOP, this.unboundedCoords_.top + 'px');
  9985. }
  9986. }
  9987. /** @param {boolean} unbounded */
  9988. }, {
  9989. key: 'setUnbounded',
  9990. value: function setUnbounded(unbounded) {
  9991. var UNBOUNDED = MDCRippleFoundation.cssClasses.UNBOUNDED;
  9992. if (unbounded) {
  9993. this.adapter_.addClass(UNBOUNDED);
  9994. } else {
  9995. this.adapter_.removeClass(UNBOUNDED);
  9996. }
  9997. }
  9998. }, {
  9999. key: 'handleFocus',
  10000. value: function handleFocus() {
  10001. var _this16 = this;
  10002. requestAnimationFrame(function () {
  10003. return _this16.adapter_.addClass(MDCRippleFoundation.cssClasses.BG_FOCUSED);
  10004. });
  10005. }
  10006. }, {
  10007. key: 'handleBlur',
  10008. value: function handleBlur() {
  10009. var _this17 = this;
  10010. requestAnimationFrame(function () {
  10011. return _this17.adapter_.removeClass(MDCRippleFoundation.cssClasses.BG_FOCUSED);
  10012. });
  10013. }
  10014. }]);
  10015. return MDCRippleFoundation;
  10016. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  10017. /* harmony default export */ __webpack_exports__["a"] = (MDCRippleFoundation);
  10018. /***/ }),
  10019. /* 67 */
  10020. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10021. "use strict";
  10022. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  10023. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; });
  10024. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; });
  10025. /**
  10026. * @license
  10027. * Copyright 2016 Google Inc.
  10028. *
  10029. * Permission is hereby granted, free of charge, to any person obtaining a copy
  10030. * of this software and associated documentation files (the "Software"), to deal
  10031. * in the Software without restriction, including without limitation the rights
  10032. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10033. * copies of the Software, and to permit persons to whom the Software is
  10034. * furnished to do so, subject to the following conditions:
  10035. *
  10036. * The above copyright notice and this permission notice shall be included in
  10037. * all copies or substantial portions of the Software.
  10038. *
  10039. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  10040. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  10041. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  10042. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  10043. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  10044. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  10045. * THE SOFTWARE.
  10046. */
  10047. var cssClasses = {
  10048. // Ripple is a special case where the "root" component is really a "mixin" of sorts,
  10049. // given that it's an 'upgrade' to an existing component. That being said it is the root
  10050. // CSS class that all other CSS classes derive from.
  10051. ROOT: 'mdc-ripple-upgraded',
  10052. UNBOUNDED: 'mdc-ripple-upgraded--unbounded',
  10053. BG_FOCUSED: 'mdc-ripple-upgraded--background-focused',
  10054. FG_ACTIVATION: 'mdc-ripple-upgraded--foreground-activation',
  10055. FG_DEACTIVATION: 'mdc-ripple-upgraded--foreground-deactivation'
  10056. };
  10057. var strings = {
  10058. VAR_LEFT: '--mdc-ripple-left',
  10059. VAR_TOP: '--mdc-ripple-top',
  10060. VAR_FG_SIZE: '--mdc-ripple-fg-size',
  10061. VAR_FG_SCALE: '--mdc-ripple-fg-scale',
  10062. VAR_FG_TRANSLATE_START: '--mdc-ripple-fg-translate-start',
  10063. VAR_FG_TRANSLATE_END: '--mdc-ripple-fg-translate-end'
  10064. };
  10065. var numbers = {
  10066. PADDING: 10,
  10067. INITIAL_ORIGIN_SCALE: 0.6,
  10068. DEACTIVATION_TIMEOUT_MS: 225, // Corresponds to $mdc-ripple-translate-duration (i.e. activation animation duration)
  10069. FG_DEACTIVATION_MS: 150, // Corresponds to $mdc-ripple-fade-out-duration (i.e. deactivation animation duration)
  10070. TAP_DELAY_MS: 300 };
  10071. /***/ }),
  10072. /* 68 */
  10073. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10074. "use strict";
  10075. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  10076. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_selection_control_index__ = __webpack_require__(4);
  10077. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__adapter__ = __webpack_require__(69);
  10078. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__constants__ = __webpack_require__(70);
  10079. 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; };
  10080. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  10081. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  10082. 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; }
  10083. 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; }
  10084. /**
  10085. * @license
  10086. * Copyright 2016 Google Inc.
  10087. *
  10088. * Permission is hereby granted, free of charge, to any person obtaining a copy
  10089. * of this software and associated documentation files (the "Software"), to deal
  10090. * in the Software without restriction, including without limitation the rights
  10091. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10092. * copies of the Software, and to permit persons to whom the Software is
  10093. * furnished to do so, subject to the following conditions:
  10094. *
  10095. * The above copyright notice and this permission notice shall be included in
  10096. * all copies or substantial portions of the Software.
  10097. *
  10098. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  10099. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  10100. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  10101. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  10102. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  10103. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  10104. * THE SOFTWARE.
  10105. */
  10106. /* eslint-disable no-unused-vars */
  10107. /* eslint-enable no-unused-vars */
  10108. /** @const {!Array<string>} */
  10109. var CB_PROTO_PROPS = ['checked', 'indeterminate'];
  10110. /**
  10111. * @extends {MDCFoundation<!MDCCheckboxAdapter>}
  10112. */
  10113. var MDCCheckboxFoundation = function (_MDCFoundation) {
  10114. _inherits(MDCCheckboxFoundation, _MDCFoundation);
  10115. _createClass(MDCCheckboxFoundation, null, [{
  10116. key: 'cssClasses',
  10117. /** @return enum {cssClasses} */
  10118. get: function get() {
  10119. return __WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */];
  10120. }
  10121. /** @return enum {strings} */
  10122. }, {
  10123. key: 'strings',
  10124. get: function get() {
  10125. return __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */];
  10126. }
  10127. /** @return enum {numbers} */
  10128. }, {
  10129. key: 'numbers',
  10130. get: function get() {
  10131. return __WEBPACK_IMPORTED_MODULE_3__constants__["b" /* numbers */];
  10132. }
  10133. /** @return {!MDCCheckboxAdapter} */
  10134. }, {
  10135. key: 'defaultAdapter',
  10136. get: function get() {
  10137. return (/** @type {!MDCCheckboxAdapter} */{
  10138. addClass: function addClass() /* className: string */{},
  10139. removeClass: function removeClass() /* className: string */{},
  10140. setNativeControlAttr: function setNativeControlAttr() /* attr: string, value: string */{},
  10141. removeNativeControlAttr: function removeNativeControlAttr() /* attr: string */{},
  10142. getNativeControl: function getNativeControl() /* !MDCSelectionControlState */{},
  10143. forceLayout: function forceLayout() {},
  10144. isAttachedToDOM: function isAttachedToDOM() /* boolean */{},
  10145. isIndeterminate: function isIndeterminate() /* boolean */{},
  10146. isChecked: function isChecked() /* boolean */{},
  10147. hasNativeControl: function hasNativeControl() /* boolean */{},
  10148. setNativeControlDisabled: function setNativeControlDisabled() /* disabled: boolean */{}
  10149. }
  10150. );
  10151. }
  10152. }]);
  10153. function MDCCheckboxFoundation(adapter) {
  10154. _classCallCheck(this, MDCCheckboxFoundation);
  10155. /** @private {string} */
  10156. var _this = _possibleConstructorReturn(this, (MDCCheckboxFoundation.__proto__ || Object.getPrototypeOf(MDCCheckboxFoundation)).call(this, _extends(MDCCheckboxFoundation.defaultAdapter, adapter)));
  10157. _this.currentCheckState_ = __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].TRANSITION_STATE_INIT;
  10158. /** @private {string} */
  10159. _this.currentAnimationClass_ = '';
  10160. /** @private {number} */
  10161. _this.animEndLatchTimer_ = 0;
  10162. /** @private {boolean} */
  10163. _this.enableAnimationEndHandler_ = false;
  10164. return _this;
  10165. }
  10166. /** @override */
  10167. _createClass(MDCCheckboxFoundation, [{
  10168. key: 'init',
  10169. value: function init() {
  10170. this.currentCheckState_ = this.determineCheckState_();
  10171. this.updateAriaChecked_();
  10172. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].UPGRADED);
  10173. this.installPropertyChangeHooks_();
  10174. }
  10175. /** @override */
  10176. }, {
  10177. key: 'destroy',
  10178. value: function destroy() {
  10179. this.uninstallPropertyChangeHooks_();
  10180. clearTimeout(this.animEndLatchTimer_);
  10181. }
  10182. /** @param {boolean} disabled */
  10183. }, {
  10184. key: 'setDisabled',
  10185. value: function setDisabled(disabled) {
  10186. this.adapter_.setNativeControlDisabled(disabled);
  10187. if (disabled) {
  10188. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].DISABLED);
  10189. } else {
  10190. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].DISABLED);
  10191. }
  10192. }
  10193. /**
  10194. * Handles the animationend event for the checkbox
  10195. */
  10196. }, {
  10197. key: 'handleAnimationEnd',
  10198. value: function handleAnimationEnd() {
  10199. var _this2 = this;
  10200. if (!this.enableAnimationEndHandler_) return;
  10201. clearTimeout(this.animEndLatchTimer_);
  10202. this.animEndLatchTimer_ = setTimeout(function () {
  10203. _this2.adapter_.removeClass(_this2.currentAnimationClass_);
  10204. _this2.enableAnimationEndHandler_ = false;
  10205. }, __WEBPACK_IMPORTED_MODULE_3__constants__["b" /* numbers */].ANIM_END_LATCH_MS);
  10206. }
  10207. /**
  10208. * Handles the change event for the checkbox
  10209. */
  10210. }, {
  10211. key: 'handleChange',
  10212. value: function handleChange() {
  10213. this.transitionCheckState_();
  10214. }
  10215. /** @private */
  10216. }, {
  10217. key: 'installPropertyChangeHooks_',
  10218. value: function installPropertyChangeHooks_() {
  10219. var _this3 = this;
  10220. var nativeCb = this.getNativeControl_();
  10221. var cbProto = Object.getPrototypeOf(nativeCb);
  10222. CB_PROTO_PROPS.forEach(function (controlState) {
  10223. var desc = Object.getOwnPropertyDescriptor(cbProto, controlState);
  10224. // We have to check for this descriptor, since some browsers (Safari) don't support its return.
  10225. // See: https://bugs.webkit.org/show_bug.cgi?id=49739
  10226. if (validDescriptor(desc)) {
  10227. var nativeCbDesc = /** @type {!ObjectPropertyDescriptor} */{
  10228. get: desc.get,
  10229. set: function set(state) {
  10230. desc.set.call(nativeCb, state);
  10231. _this3.transitionCheckState_();
  10232. },
  10233. configurable: desc.configurable,
  10234. enumerable: desc.enumerable
  10235. };
  10236. Object.defineProperty(nativeCb, controlState, nativeCbDesc);
  10237. }
  10238. });
  10239. }
  10240. /** @private */
  10241. }, {
  10242. key: 'uninstallPropertyChangeHooks_',
  10243. value: function uninstallPropertyChangeHooks_() {
  10244. var nativeCb = this.getNativeControl_();
  10245. var cbProto = Object.getPrototypeOf(nativeCb);
  10246. CB_PROTO_PROPS.forEach(function (controlState) {
  10247. var desc = /** @type {!ObjectPropertyDescriptor} */Object.getOwnPropertyDescriptor(cbProto, controlState);
  10248. if (validDescriptor(desc)) {
  10249. Object.defineProperty(nativeCb, controlState, desc);
  10250. }
  10251. });
  10252. }
  10253. /** @private */
  10254. }, {
  10255. key: 'transitionCheckState_',
  10256. value: function transitionCheckState_() {
  10257. if (!this.adapter_.hasNativeControl()) {
  10258. return;
  10259. }
  10260. var oldState = this.currentCheckState_;
  10261. var newState = this.determineCheckState_();
  10262. if (oldState === newState) {
  10263. return;
  10264. }
  10265. this.updateAriaChecked_();
  10266. // Check to ensure that there isn't a previously existing animation class, in case for example
  10267. // the user interacted with the checkbox before the animation was finished.
  10268. if (this.currentAnimationClass_.length > 0) {
  10269. clearTimeout(this.animEndLatchTimer_);
  10270. this.adapter_.forceLayout();
  10271. this.adapter_.removeClass(this.currentAnimationClass_);
  10272. }
  10273. this.currentAnimationClass_ = this.getTransitionAnimationClass_(oldState, newState);
  10274. this.currentCheckState_ = newState;
  10275. // Check for parentNode so that animations are only run when the element is attached
  10276. // to the DOM.
  10277. if (this.adapter_.isAttachedToDOM() && this.currentAnimationClass_.length > 0) {
  10278. this.adapter_.addClass(this.currentAnimationClass_);
  10279. this.enableAnimationEndHandler_ = true;
  10280. }
  10281. }
  10282. /**
  10283. * @return {string}
  10284. * @private
  10285. */
  10286. }, {
  10287. key: 'determineCheckState_',
  10288. value: function determineCheckState_() {
  10289. var TRANSITION_STATE_INDETERMINATE = __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].TRANSITION_STATE_INDETERMINATE,
  10290. TRANSITION_STATE_CHECKED = __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].TRANSITION_STATE_CHECKED,
  10291. TRANSITION_STATE_UNCHECKED = __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].TRANSITION_STATE_UNCHECKED;
  10292. if (this.adapter_.isIndeterminate()) {
  10293. return TRANSITION_STATE_INDETERMINATE;
  10294. }
  10295. return this.adapter_.isChecked() ? TRANSITION_STATE_CHECKED : TRANSITION_STATE_UNCHECKED;
  10296. }
  10297. /**
  10298. * @param {string} oldState
  10299. * @param {string} newState
  10300. * @return {string}
  10301. */
  10302. }, {
  10303. key: 'getTransitionAnimationClass_',
  10304. value: function getTransitionAnimationClass_(oldState, newState) {
  10305. var TRANSITION_STATE_INIT = __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].TRANSITION_STATE_INIT,
  10306. TRANSITION_STATE_CHECKED = __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].TRANSITION_STATE_CHECKED,
  10307. TRANSITION_STATE_UNCHECKED = __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].TRANSITION_STATE_UNCHECKED;
  10308. var _MDCCheckboxFoundatio = MDCCheckboxFoundation.cssClasses,
  10309. ANIM_UNCHECKED_CHECKED = _MDCCheckboxFoundatio.ANIM_UNCHECKED_CHECKED,
  10310. ANIM_UNCHECKED_INDETERMINATE = _MDCCheckboxFoundatio.ANIM_UNCHECKED_INDETERMINATE,
  10311. ANIM_CHECKED_UNCHECKED = _MDCCheckboxFoundatio.ANIM_CHECKED_UNCHECKED,
  10312. ANIM_CHECKED_INDETERMINATE = _MDCCheckboxFoundatio.ANIM_CHECKED_INDETERMINATE,
  10313. ANIM_INDETERMINATE_CHECKED = _MDCCheckboxFoundatio.ANIM_INDETERMINATE_CHECKED,
  10314. ANIM_INDETERMINATE_UNCHECKED = _MDCCheckboxFoundatio.ANIM_INDETERMINATE_UNCHECKED;
  10315. switch (oldState) {
  10316. case TRANSITION_STATE_INIT:
  10317. if (newState === TRANSITION_STATE_UNCHECKED) {
  10318. return '';
  10319. }
  10320. // fallthrough
  10321. case TRANSITION_STATE_UNCHECKED:
  10322. return newState === TRANSITION_STATE_CHECKED ? ANIM_UNCHECKED_CHECKED : ANIM_UNCHECKED_INDETERMINATE;
  10323. case TRANSITION_STATE_CHECKED:
  10324. return newState === TRANSITION_STATE_UNCHECKED ? ANIM_CHECKED_UNCHECKED : ANIM_CHECKED_INDETERMINATE;
  10325. // TRANSITION_STATE_INDETERMINATE
  10326. default:
  10327. return newState === TRANSITION_STATE_CHECKED ? ANIM_INDETERMINATE_CHECKED : ANIM_INDETERMINATE_UNCHECKED;
  10328. }
  10329. }
  10330. }, {
  10331. key: 'updateAriaChecked_',
  10332. value: function updateAriaChecked_() {
  10333. // Ensure aria-checked is set to mixed if checkbox is in indeterminate state.
  10334. if (this.adapter_.isIndeterminate()) {
  10335. this.adapter_.setNativeControlAttr(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].ARIA_CHECKED_ATTR, __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].ARIA_CHECKED_INDETERMINATE_VALUE);
  10336. } else {
  10337. // The on/off state does not need to keep track of aria-checked, since
  10338. // the screenreader uses the checked property on the checkbox element.
  10339. this.adapter_.removeNativeControlAttr(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].ARIA_CHECKED_ATTR);
  10340. }
  10341. }
  10342. /**
  10343. * @return {!MDCSelectionControlState}
  10344. * @private
  10345. */
  10346. }, {
  10347. key: 'getNativeControl_',
  10348. value: function getNativeControl_() {
  10349. return this.adapter_.getNativeControl() || {
  10350. checked: false,
  10351. indeterminate: false,
  10352. disabled: false,
  10353. value: null
  10354. };
  10355. }
  10356. }]);
  10357. return MDCCheckboxFoundation;
  10358. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  10359. /**
  10360. * @param {ObjectPropertyDescriptor|undefined} inputPropDesc
  10361. * @return {boolean}
  10362. */
  10363. function validDescriptor(inputPropDesc) {
  10364. return !!inputPropDesc && typeof inputPropDesc.set === 'function';
  10365. }
  10366. /* harmony default export */ __webpack_exports__["a"] = (MDCCheckboxFoundation);
  10367. /***/ }),
  10368. /* 69 */
  10369. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10370. "use strict";
  10371. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_selection_control_index__ = __webpack_require__(4);
  10372. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  10373. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  10374. /**
  10375. * @license
  10376. * Copyright 2016 Google Inc.
  10377. *
  10378. * Permission is hereby granted, free of charge, to any person obtaining a copy
  10379. * of this software and associated documentation files (the "Software"), to deal
  10380. * in the Software without restriction, including without limitation the rights
  10381. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10382. * copies of the Software, and to permit persons to whom the Software is
  10383. * furnished to do so, subject to the following conditions:
  10384. *
  10385. * The above copyright notice and this permission notice shall be included in
  10386. * all copies or substantial portions of the Software.
  10387. *
  10388. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  10389. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  10390. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  10391. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  10392. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  10393. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  10394. * THE SOFTWARE.
  10395. */
  10396. /* eslint-disable no-unused-vars */
  10397. /* eslint no-unused-vars: [2, {"args": "none"}] */
  10398. /**
  10399. * Adapter for MDC Checkbox. Provides an interface for managing
  10400. * - classes
  10401. * - dom
  10402. * - event handlers
  10403. *
  10404. * Additionally, provides type information for the adapter to the Closure
  10405. * compiler.
  10406. *
  10407. * Implement this adapter for your framework of choice to delegate updates to
  10408. * the component in your framework of choice. See architecture documentation
  10409. * for more details.
  10410. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  10411. *
  10412. * @record
  10413. */
  10414. var MDCCheckboxAdapter = function () {
  10415. function MDCCheckboxAdapter() {
  10416. _classCallCheck(this, MDCCheckboxAdapter);
  10417. }
  10418. _createClass(MDCCheckboxAdapter, [{
  10419. key: 'addClass',
  10420. /** @param {string} className */
  10421. value: function addClass(className) {}
  10422. /** @param {string} className */
  10423. }, {
  10424. key: 'removeClass',
  10425. value: function removeClass(className) {}
  10426. /**
  10427. * Sets an attribute with a given value on the input element.
  10428. * @param {string} attr
  10429. * @param {string} value
  10430. */
  10431. }, {
  10432. key: 'setNativeControlAttr',
  10433. value: function setNativeControlAttr(attr, value) {}
  10434. /**
  10435. * Removes an attribute from the input element.
  10436. * @param {string} attr
  10437. */
  10438. }, {
  10439. key: 'removeNativeControlAttr',
  10440. value: function removeNativeControlAttr(attr) {}
  10441. /** @return {!MDCSelectionControlState} */
  10442. }, {
  10443. key: 'getNativeControl',
  10444. value: function getNativeControl() {}
  10445. }, {
  10446. key: 'forceLayout',
  10447. value: function forceLayout() {}
  10448. /** @return {boolean} */
  10449. }, {
  10450. key: 'isAttachedToDOM',
  10451. value: function isAttachedToDOM() {}
  10452. /** @return {boolean} */
  10453. }, {
  10454. key: 'isIndeterminate',
  10455. value: function isIndeterminate() {}
  10456. /** @return {boolean} */
  10457. }, {
  10458. key: 'isChecked',
  10459. value: function isChecked() {}
  10460. /** @return {boolean} */
  10461. }, {
  10462. key: 'hasNativeControl',
  10463. value: function hasNativeControl() {}
  10464. /** @param {boolean} disabled */
  10465. }, {
  10466. key: 'setNativeControlDisabled',
  10467. value: function setNativeControlDisabled(disabled) {}
  10468. }]);
  10469. return MDCCheckboxAdapter;
  10470. }();
  10471. /* unused harmony default export */ var _unused_webpack_default_export = (MDCCheckboxAdapter);
  10472. /***/ }),
  10473. /* 70 */
  10474. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10475. "use strict";
  10476. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  10477. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; });
  10478. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; });
  10479. /**
  10480. * @license
  10481. * Copyright 2016 Google Inc.
  10482. *
  10483. * Permission is hereby granted, free of charge, to any person obtaining a copy
  10484. * of this software and associated documentation files (the "Software"), to deal
  10485. * in the Software without restriction, including without limitation the rights
  10486. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10487. * copies of the Software, and to permit persons to whom the Software is
  10488. * furnished to do so, subject to the following conditions:
  10489. *
  10490. * The above copyright notice and this permission notice shall be included in
  10491. * all copies or substantial portions of the Software.
  10492. *
  10493. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  10494. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  10495. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  10496. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  10497. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  10498. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  10499. * THE SOFTWARE.
  10500. */
  10501. /** @const {string} */
  10502. var ROOT = 'mdc-checkbox';
  10503. /** @enum {string} */
  10504. var cssClasses = {
  10505. UPGRADED: 'mdc-checkbox--upgraded',
  10506. CHECKED: 'mdc-checkbox--checked',
  10507. INDETERMINATE: 'mdc-checkbox--indeterminate',
  10508. DISABLED: 'mdc-checkbox--disabled',
  10509. ANIM_UNCHECKED_CHECKED: 'mdc-checkbox--anim-unchecked-checked',
  10510. ANIM_UNCHECKED_INDETERMINATE: 'mdc-checkbox--anim-unchecked-indeterminate',
  10511. ANIM_CHECKED_UNCHECKED: 'mdc-checkbox--anim-checked-unchecked',
  10512. ANIM_CHECKED_INDETERMINATE: 'mdc-checkbox--anim-checked-indeterminate',
  10513. ANIM_INDETERMINATE_CHECKED: 'mdc-checkbox--anim-indeterminate-checked',
  10514. ANIM_INDETERMINATE_UNCHECKED: 'mdc-checkbox--anim-indeterminate-unchecked'
  10515. };
  10516. /** @enum {string} */
  10517. var strings = {
  10518. NATIVE_CONTROL_SELECTOR: '.' + ROOT + '__native-control',
  10519. TRANSITION_STATE_INIT: 'init',
  10520. TRANSITION_STATE_CHECKED: 'checked',
  10521. TRANSITION_STATE_UNCHECKED: 'unchecked',
  10522. TRANSITION_STATE_INDETERMINATE: 'indeterminate',
  10523. ARIA_CHECKED_ATTR: 'aria-checked',
  10524. ARIA_CHECKED_INDETERMINATE_VALUE: 'mixed'
  10525. };
  10526. /** @enum {number} */
  10527. var numbers = {
  10528. ANIM_END_LATCH_MS: 250
  10529. };
  10530. /***/ }),
  10531. /* 71 */
  10532. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10533. "use strict";
  10534. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  10535. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__chip_index__ = __webpack_require__(30);
  10536. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__chip_set_index__ = __webpack_require__(72);
  10537. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCChipFoundation", function() { return __WEBPACK_IMPORTED_MODULE_0__chip_index__["b"]; });
  10538. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCChip", function() { return __WEBPACK_IMPORTED_MODULE_0__chip_index__["a"]; });
  10539. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCChipSetFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__chip_set_index__["b"]; });
  10540. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCChipSet", function() { return __WEBPACK_IMPORTED_MODULE_1__chip_set_index__["a"]; });
  10541. /**
  10542. * @license
  10543. * Copyright 2017 Google Inc.
  10544. *
  10545. * Permission is hereby granted, free of charge, to any person obtaining a copy
  10546. * of this software and associated documentation files (the "Software"), to deal
  10547. * in the Software without restriction, including without limitation the rights
  10548. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10549. * copies of the Software, and to permit persons to whom the Software is
  10550. * furnished to do so, subject to the following conditions:
  10551. *
  10552. * The above copyright notice and this permission notice shall be included in
  10553. * all copies or substantial portions of the Software.
  10554. *
  10555. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  10556. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  10557. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  10558. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  10559. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  10560. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  10561. * THE SOFTWARE.
  10562. */
  10563. /***/ }),
  10564. /* 72 */
  10565. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10566. "use strict";
  10567. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCChipSet; });
  10568. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  10569. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(34);
  10570. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(73);
  10571. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__chip_index__ = __webpack_require__(30);
  10572. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  10573. 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; };
  10574. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  10575. 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); } };
  10576. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  10577. 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; }
  10578. 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; }
  10579. /**
  10580. * @license
  10581. * Copyright 2016 Google Inc.
  10582. *
  10583. * Permission is hereby granted, free of charge, to any person obtaining a copy
  10584. * of this software and associated documentation files (the "Software"), to deal
  10585. * in the Software without restriction, including without limitation the rights
  10586. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10587. * copies of the Software, and to permit persons to whom the Software is
  10588. * furnished to do so, subject to the following conditions:
  10589. *
  10590. * The above copyright notice and this permission notice shall be included in
  10591. * all copies or substantial portions of the Software.
  10592. *
  10593. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  10594. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  10595. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  10596. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  10597. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  10598. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  10599. * THE SOFTWARE.
  10600. */
  10601. var idCounter = 0;
  10602. /**
  10603. * @extends {MDCComponent<!MDCChipSetFoundation>}
  10604. * @final
  10605. */
  10606. var MDCChipSet = function (_MDCComponent) {
  10607. _inherits(MDCChipSet, _MDCComponent);
  10608. /**
  10609. * @param {...?} args
  10610. */
  10611. function MDCChipSet() {
  10612. var _ref;
  10613. _classCallCheck(this, MDCChipSet);
  10614. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  10615. args[_key] = arguments[_key];
  10616. }
  10617. /** @type {!Array<!MDCChip>} */
  10618. var _this = _possibleConstructorReturn(this, (_ref = MDCChipSet.__proto__ || Object.getPrototypeOf(MDCChipSet)).call.apply(_ref, [this].concat(args)));
  10619. _this.chips;
  10620. /** @private {(function(!Element): !MDCChip)} */
  10621. _this.chipFactory_;
  10622. /** @private {?function(?Event): undefined} */
  10623. _this.handleChipInteraction_;
  10624. /** @private {?function(?Event): undefined} */
  10625. _this.handleChipSelection_;
  10626. /** @private {?function(?Event): undefined} */
  10627. _this.handleChipRemoval_;
  10628. return _this;
  10629. }
  10630. /**
  10631. * @param {!Element} root
  10632. * @return {!MDCChipSet}
  10633. */
  10634. _createClass(MDCChipSet, [{
  10635. key: 'initialize',
  10636. /**
  10637. * @param {(function(!Element): !MDCChip)=} chipFactory A function which
  10638. * creates a new MDCChip.
  10639. */
  10640. value: function initialize() {
  10641. var chipFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (el) {
  10642. return new __WEBPACK_IMPORTED_MODULE_3__chip_index__["a" /* MDCChip */](el);
  10643. };
  10644. this.chipFactory_ = chipFactory;
  10645. this.chips = this.instantiateChips_(this.chipFactory_);
  10646. }
  10647. }, {
  10648. key: 'initialSyncWithDOM',
  10649. value: function initialSyncWithDOM() {
  10650. var _this2 = this;
  10651. this.chips.forEach(function (chip) {
  10652. if (chip.selected) {
  10653. _this2.foundation_.select(chip.id);
  10654. }
  10655. });
  10656. this.handleChipInteraction_ = function (evt) {
  10657. return _this2.foundation_.handleChipInteraction(evt.detail.chipId);
  10658. };
  10659. this.handleChipSelection_ = function (evt) {
  10660. return _this2.foundation_.handleChipSelection(evt.detail.chipId, evt.detail.selected);
  10661. };
  10662. this.handleChipRemoval_ = function (evt) {
  10663. return _this2.foundation_.handleChipRemoval(evt.detail.chipId);
  10664. };
  10665. this.root_.addEventListener(__WEBPACK_IMPORTED_MODULE_3__chip_index__["b" /* MDCChipFoundation */].strings.INTERACTION_EVENT, this.handleChipInteraction_);
  10666. this.root_.addEventListener(__WEBPACK_IMPORTED_MODULE_3__chip_index__["b" /* MDCChipFoundation */].strings.SELECTION_EVENT, this.handleChipSelection_);
  10667. this.root_.addEventListener(__WEBPACK_IMPORTED_MODULE_3__chip_index__["b" /* MDCChipFoundation */].strings.REMOVAL_EVENT, this.handleChipRemoval_);
  10668. }
  10669. }, {
  10670. key: 'destroy',
  10671. value: function destroy() {
  10672. this.chips.forEach(function (chip) {
  10673. chip.destroy();
  10674. });
  10675. this.root_.removeEventListener(__WEBPACK_IMPORTED_MODULE_3__chip_index__["b" /* MDCChipFoundation */].strings.INTERACTION_EVENT, this.handleChipInteraction_);
  10676. this.root_.removeEventListener(__WEBPACK_IMPORTED_MODULE_3__chip_index__["b" /* MDCChipFoundation */].strings.SELECTION_EVENT, this.handleChipSelection_);
  10677. this.root_.removeEventListener(__WEBPACK_IMPORTED_MODULE_3__chip_index__["b" /* MDCChipFoundation */].strings.REMOVAL_EVENT, this.handleChipRemoval_);
  10678. _get(MDCChipSet.prototype.__proto__ || Object.getPrototypeOf(MDCChipSet.prototype), 'destroy', this).call(this);
  10679. }
  10680. /**
  10681. * Adds a new chip object to the chip set from the given chip element.
  10682. * @param {!Element} chipEl
  10683. */
  10684. }, {
  10685. key: 'addChip',
  10686. value: function addChip(chipEl) {
  10687. chipEl.id = chipEl.id || 'mdc-chip-' + ++idCounter;
  10688. this.chips.push(this.chipFactory_(chipEl));
  10689. }
  10690. /**
  10691. * Returns an array of the IDs of all selected chips.
  10692. * @return {!Array<string>}
  10693. */
  10694. }, {
  10695. key: 'getDefaultFoundation',
  10696. /**
  10697. * @return {!MDCChipSetFoundation}
  10698. */
  10699. value: function getDefaultFoundation() {
  10700. var _this3 = this;
  10701. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]( /** @type {!MDCChipSetAdapter} */_extends({
  10702. hasClass: function hasClass(className) {
  10703. return _this3.root_.classList.contains(className);
  10704. },
  10705. removeChip: function removeChip(chipId) {
  10706. var index = _this3.findChipIndex_(chipId);
  10707. if (index >= 0) {
  10708. _this3.chips[index].destroy();
  10709. _this3.chips.splice(index, 1);
  10710. }
  10711. },
  10712. setSelected: function setSelected(chipId, selected) {
  10713. var index = _this3.findChipIndex_(chipId);
  10714. if (index >= 0) {
  10715. _this3.chips[index].selected = selected;
  10716. }
  10717. }
  10718. }));
  10719. }
  10720. /**
  10721. * Instantiates chip components on all of the chip set's child chip elements.
  10722. * @param {(function(!Element): !MDCChip)} chipFactory
  10723. * @return {!Array<!MDCChip>}
  10724. */
  10725. }, {
  10726. key: 'instantiateChips_',
  10727. value: function instantiateChips_(chipFactory) {
  10728. var chipElements = [].slice.call(this.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.CHIP_SELECTOR));
  10729. return chipElements.map(function (el) {
  10730. el.id = el.id || 'mdc-chip-' + ++idCounter;
  10731. return chipFactory(el);
  10732. });
  10733. }
  10734. /**
  10735. * Returns the index of the chip with the given id, or -1 if the chip does not exist.
  10736. * @param {string} chipId
  10737. * @return {number}
  10738. */
  10739. }, {
  10740. key: 'findChipIndex_',
  10741. value: function findChipIndex_(chipId) {
  10742. for (var i = 0; i < this.chips.length; i++) {
  10743. if (this.chips[i].id === chipId) {
  10744. return i;
  10745. }
  10746. }
  10747. return -1;
  10748. }
  10749. }, {
  10750. key: 'selectedChipIds',
  10751. get: function get() {
  10752. return this.foundation_.getSelectedChipIds();
  10753. }
  10754. }], [{
  10755. key: 'attachTo',
  10756. value: function attachTo(root) {
  10757. return new MDCChipSet(root);
  10758. }
  10759. }]);
  10760. return MDCChipSet;
  10761. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  10762. /***/ }),
  10763. /* 73 */
  10764. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10765. "use strict";
  10766. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  10767. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(34);
  10768. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__chip_foundation__ = __webpack_require__(32);
  10769. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__constants__ = __webpack_require__(74);
  10770. 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; };
  10771. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  10772. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  10773. 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; }
  10774. 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; }
  10775. /**
  10776. * @license
  10777. * Copyright 2017 Google Inc.
  10778. *
  10779. * Permission is hereby granted, free of charge, to any person obtaining a copy
  10780. * of this software and associated documentation files (the "Software"), to deal
  10781. * in the Software without restriction, including without limitation the rights
  10782. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10783. * copies of the Software, and to permit persons to whom the Software is
  10784. * furnished to do so, subject to the following conditions:
  10785. *
  10786. * The above copyright notice and this permission notice shall be included in
  10787. * all copies or substantial portions of the Software.
  10788. *
  10789. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  10790. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  10791. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  10792. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  10793. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  10794. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  10795. * THE SOFTWARE.
  10796. */
  10797. // eslint-disable-next-line no-unused-vars
  10798. /**
  10799. * @extends {MDCFoundation<!MDCChipSetAdapter>}
  10800. * @final
  10801. */
  10802. var MDCChipSetFoundation = function (_MDCFoundation) {
  10803. _inherits(MDCChipSetFoundation, _MDCFoundation);
  10804. _createClass(MDCChipSetFoundation, null, [{
  10805. key: 'strings',
  10806. /** @return enum {string} */
  10807. get: function get() {
  10808. return __WEBPACK_IMPORTED_MODULE_3__constants__["b" /* strings */];
  10809. }
  10810. /** @return enum {string} */
  10811. }, {
  10812. key: 'cssClasses',
  10813. get: function get() {
  10814. return __WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */];
  10815. }
  10816. /**
  10817. * {@see MDCChipSetAdapter} for typing information on parameters and return
  10818. * types.
  10819. * @return {!MDCChipSetAdapter}
  10820. */
  10821. }, {
  10822. key: 'defaultAdapter',
  10823. get: function get() {
  10824. return (/** @type {!MDCChipSetAdapter} */{
  10825. hasClass: function hasClass() {},
  10826. removeChip: function removeChip() {},
  10827. setSelected: function setSelected() {}
  10828. }
  10829. );
  10830. }
  10831. /**
  10832. * @param {!MDCChipSetAdapter} adapter
  10833. */
  10834. }]);
  10835. function MDCChipSetFoundation(adapter) {
  10836. _classCallCheck(this, MDCChipSetFoundation);
  10837. /**
  10838. * The ids of the selected chips in the set. Only used for choice chip set or filter chip set.
  10839. * @private {!Array<string>}
  10840. */
  10841. var _this = _possibleConstructorReturn(this, (MDCChipSetFoundation.__proto__ || Object.getPrototypeOf(MDCChipSetFoundation)).call(this, _extends(MDCChipSetFoundation.defaultAdapter, adapter)));
  10842. _this.selectedChipIds_ = [];
  10843. return _this;
  10844. }
  10845. /**
  10846. * Returns an array of the IDs of all selected chips.
  10847. * @return {!Array<string>}
  10848. */
  10849. _createClass(MDCChipSetFoundation, [{
  10850. key: 'getSelectedChipIds',
  10851. value: function getSelectedChipIds() {
  10852. return this.selectedChipIds_;
  10853. }
  10854. /**
  10855. * Toggles selection of the chip with the given id.
  10856. * @private
  10857. * @param {string} chipId
  10858. */
  10859. }, {
  10860. key: 'toggleSelect_',
  10861. value: function toggleSelect_(chipId) {
  10862. if (this.selectedChipIds_.indexOf(chipId) >= 0) {
  10863. this.deselect_(chipId);
  10864. } else {
  10865. this.select(chipId);
  10866. }
  10867. }
  10868. /**
  10869. * Selects the chip with the given id. Deselects all other chips if the chip set is of the choice variant.
  10870. * @param {string} chipId
  10871. */
  10872. }, {
  10873. key: 'select',
  10874. value: function select(chipId) {
  10875. if (this.selectedChipIds_.indexOf(chipId) >= 0) {
  10876. return;
  10877. }
  10878. if (this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].CHOICE) && this.selectedChipIds_.length > 0) {
  10879. var previouslySelectedChip = this.selectedChipIds_[0];
  10880. this.selectedChipIds_.length = 0;
  10881. this.adapter_.setSelected(previouslySelectedChip, false);
  10882. }
  10883. this.selectedChipIds_.push(chipId);
  10884. this.adapter_.setSelected(chipId, true);
  10885. }
  10886. /**
  10887. * Deselects the chip with the given id.
  10888. * @private
  10889. * @param {string} chipId
  10890. */
  10891. }, {
  10892. key: 'deselect_',
  10893. value: function deselect_(chipId) {
  10894. var index = this.selectedChipIds_.indexOf(chipId);
  10895. if (index >= 0) {
  10896. this.selectedChipIds_.splice(index, 1);
  10897. this.adapter_.setSelected(chipId, false);
  10898. }
  10899. }
  10900. /**
  10901. * Handles a chip interaction event
  10902. * @param {string} chipId
  10903. */
  10904. }, {
  10905. key: 'handleChipInteraction',
  10906. value: function handleChipInteraction(chipId) {
  10907. if (this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].CHOICE) || this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].FILTER)) {
  10908. this.toggleSelect_(chipId);
  10909. }
  10910. }
  10911. /**
  10912. * Handles a chip selection event, used to handle discrepancy when selection state is set directly on the Chip.
  10913. * @param {string} chipId
  10914. * @param {boolean} selected
  10915. */
  10916. }, {
  10917. key: 'handleChipSelection',
  10918. value: function handleChipSelection(chipId, selected) {
  10919. var chipIsSelected = this.selectedChipIds_.indexOf(chipId) >= 0;
  10920. if (selected && !chipIsSelected) {
  10921. this.select(chipId);
  10922. } else if (!selected && chipIsSelected) {
  10923. this.deselect_(chipId);
  10924. }
  10925. }
  10926. /**
  10927. * Handles the event when a chip is removed.
  10928. * @param {string} chipId
  10929. */
  10930. }, {
  10931. key: 'handleChipRemoval',
  10932. value: function handleChipRemoval(chipId) {
  10933. this.deselect_(chipId);
  10934. this.adapter_.removeChip(chipId);
  10935. }
  10936. }]);
  10937. return MDCChipSetFoundation;
  10938. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  10939. /* harmony default export */ __webpack_exports__["a"] = (MDCChipSetFoundation);
  10940. /***/ }),
  10941. /* 74 */
  10942. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10943. "use strict";
  10944. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  10945. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  10946. /**
  10947. * @license
  10948. * Copyright 2016 Google Inc.
  10949. *
  10950. * Permission is hereby granted, free of charge, to any person obtaining a copy
  10951. * of this software and associated documentation files (the "Software"), to deal
  10952. * in the Software without restriction, including without limitation the rights
  10953. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10954. * copies of the Software, and to permit persons to whom the Software is
  10955. * furnished to do so, subject to the following conditions:
  10956. *
  10957. * The above copyright notice and this permission notice shall be included in
  10958. * all copies or substantial portions of the Software.
  10959. *
  10960. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  10961. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  10962. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  10963. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  10964. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  10965. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  10966. * THE SOFTWARE.
  10967. */
  10968. /** @enum {string} */
  10969. var strings = {
  10970. CHIP_SELECTOR: '.mdc-chip'
  10971. };
  10972. /** @enum {string} */
  10973. var cssClasses = {
  10974. CHOICE: 'mdc-chip-set--choice',
  10975. FILTER: 'mdc-chip-set--filter'
  10976. };
  10977. /***/ }),
  10978. /* 75 */
  10979. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10980. "use strict";
  10981. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  10982. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCDialog", function() { return MDCDialog; });
  10983. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_index__ = __webpack_require__(3);
  10984. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__ = __webpack_require__(2);
  10985. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(76);
  10986. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util__ = __webpack_require__(79);
  10987. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__material_dom_ponyfill__ = __webpack_require__(13);
  10988. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_focus_trap__ = __webpack_require__(35);
  10989. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_focus_trap___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_focus_trap__);
  10990. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCDialogFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  10991. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "util", function() { return __WEBPACK_IMPORTED_MODULE_3__util__; });
  10992. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  10993. 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); } };
  10994. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  10995. 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; }
  10996. 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; }
  10997. /**
  10998. * @license
  10999. * Copyright 2017 Google Inc.
  11000. *
  11001. * Permission is hereby granted, free of charge, to any person obtaining a copy
  11002. * of this software and associated documentation files (the "Software"), to deal
  11003. * in the Software without restriction, including without limitation the rights
  11004. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  11005. * copies of the Software, and to permit persons to whom the Software is
  11006. * furnished to do so, subject to the following conditions:
  11007. *
  11008. * The above copyright notice and this permission notice shall be included in
  11009. * all copies or substantial portions of the Software.
  11010. *
  11011. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  11012. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  11013. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  11014. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  11015. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  11016. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  11017. * THE SOFTWARE.
  11018. */
  11019. var strings = __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings;
  11020. var MDCDialog = function (_MDCComponent) {
  11021. _inherits(MDCDialog, _MDCComponent);
  11022. function MDCDialog() {
  11023. var _ref;
  11024. _classCallCheck(this, MDCDialog);
  11025. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  11026. args[_key] = arguments[_key];
  11027. }
  11028. /**
  11029. * @type {!Array<!MDCRipple>}
  11030. * @private
  11031. */
  11032. var _this = _possibleConstructorReturn(this, (_ref = MDCDialog.__proto__ || Object.getPrototypeOf(MDCDialog)).call.apply(_ref, [this].concat(args)));
  11033. _this.buttonRipples_;
  11034. /** @private {!Array<!Element>} */
  11035. _this.buttons_;
  11036. /** @private {?Element} */
  11037. _this.defaultButton_;
  11038. /** @private {!Element} */
  11039. _this.container_;
  11040. /** @private {?Element} */
  11041. _this.content_;
  11042. /** @private {?Element} */
  11043. _this.initialFocusEl_;
  11044. /** @private {!Function} */
  11045. _this.focusTrapFactory_;
  11046. /** @private {!FocusTrapInstance} */
  11047. _this.focusTrap_;
  11048. /** @private {!Function} */
  11049. _this.handleInteraction_;
  11050. /** @private {!Function} */
  11051. _this.handleDocumentKeydown_;
  11052. /** @private {!Function} */
  11053. _this.handleOpening_;
  11054. /** @private {!Function} */
  11055. _this.handleClosing_;
  11056. /** @private {Function} */
  11057. _this.layout_;
  11058. return _this;
  11059. }
  11060. _createClass(MDCDialog, [{
  11061. key: 'initialize',
  11062. value: function initialize() {
  11063. var focusTrapFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : __WEBPACK_IMPORTED_MODULE_5_focus_trap___default.a;
  11064. var initialFocusEl = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
  11065. this.container_ = /** @type {!Element} */this.root_.querySelector(strings.CONTAINER_SELECTOR);
  11066. this.content_ = this.root_.querySelector(strings.CONTENT_SELECTOR);
  11067. this.buttons_ = [].slice.call(this.root_.querySelectorAll(strings.BUTTON_SELECTOR));
  11068. this.defaultButton_ = this.root_.querySelector(strings.DEFAULT_BUTTON_SELECTOR);
  11069. this.buttonRipples_ = [];
  11070. this.focusTrapFactory_ = focusTrapFactory;
  11071. this.initialFocusEl_ = initialFocusEl;
  11072. for (var i = 0, buttonEl; buttonEl = this.buttons_[i]; i++) {
  11073. this.buttonRipples_.push(new __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRipple"](buttonEl));
  11074. }
  11075. }
  11076. }, {
  11077. key: 'initialSyncWithDOM',
  11078. value: function initialSyncWithDOM() {
  11079. var _this2 = this;
  11080. this.focusTrap_ = __WEBPACK_IMPORTED_MODULE_3__util__["createFocusTrapInstance"](this.container_, this.focusTrapFactory_, this.initialFocusEl_);
  11081. this.handleInteraction_ = this.foundation_.handleInteraction.bind(this.foundation_);
  11082. this.handleDocumentKeydown_ = this.foundation_.handleDocumentKeydown.bind(this.foundation_);
  11083. this.layout_ = this.layout.bind(this);
  11084. var LAYOUT_EVENTS = ['resize', 'orientationchange'];
  11085. this.handleOpening_ = function () {
  11086. LAYOUT_EVENTS.forEach(function (type) {
  11087. return window.addEventListener(type, _this2.layout_);
  11088. });
  11089. document.addEventListener('keydown', _this2.handleDocumentKeydown_);
  11090. };
  11091. this.handleClosing_ = function () {
  11092. LAYOUT_EVENTS.forEach(function (type) {
  11093. return window.removeEventListener(type, _this2.layout_);
  11094. });
  11095. document.removeEventListener('keydown', _this2.handleDocumentKeydown_);
  11096. };
  11097. this.listen('click', this.handleInteraction_);
  11098. this.listen('keydown', this.handleInteraction_);
  11099. this.listen(strings.OPENING_EVENT, this.handleOpening_);
  11100. this.listen(strings.CLOSING_EVENT, this.handleClosing_);
  11101. }
  11102. }, {
  11103. key: 'destroy',
  11104. value: function destroy() {
  11105. this.unlisten('click', this.handleInteraction_);
  11106. this.unlisten('keydown', this.handleInteraction_);
  11107. this.unlisten(strings.OPENING_EVENT, this.handleOpening_);
  11108. this.unlisten(strings.CLOSING_EVENT, this.handleClosing_);
  11109. this.handleClosing_();
  11110. this.buttonRipples_.forEach(function (ripple) {
  11111. return ripple.destroy();
  11112. });
  11113. _get(MDCDialog.prototype.__proto__ || Object.getPrototypeOf(MDCDialog.prototype), 'destroy', this).call(this);
  11114. }
  11115. }, {
  11116. key: 'layout',
  11117. value: function layout() {
  11118. this.foundation_.layout();
  11119. }
  11120. }, {
  11121. key: 'open',
  11122. value: function open() {
  11123. this.foundation_.open();
  11124. }
  11125. /**
  11126. * @param {string=} action
  11127. */
  11128. }, {
  11129. key: 'close',
  11130. value: function close() {
  11131. var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  11132. this.foundation_.close(action);
  11133. }
  11134. }, {
  11135. key: 'getDefaultFoundation',
  11136. value: function getDefaultFoundation() {
  11137. var _this3 = this;
  11138. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]({
  11139. addClass: function addClass(className) {
  11140. return _this3.root_.classList.add(className);
  11141. },
  11142. removeClass: function removeClass(className) {
  11143. return _this3.root_.classList.remove(className);
  11144. },
  11145. hasClass: function hasClass(className) {
  11146. return _this3.root_.classList.contains(className);
  11147. },
  11148. addBodyClass: function addBodyClass(className) {
  11149. return document.body.classList.add(className);
  11150. },
  11151. removeBodyClass: function removeBodyClass(className) {
  11152. return document.body.classList.remove(className);
  11153. },
  11154. eventTargetMatches: function eventTargetMatches(target, selector) {
  11155. return Object(__WEBPACK_IMPORTED_MODULE_4__material_dom_ponyfill__["matches"])(target, selector);
  11156. },
  11157. trapFocus: function trapFocus() {
  11158. return _this3.focusTrap_.activate();
  11159. },
  11160. releaseFocus: function releaseFocus() {
  11161. return _this3.focusTrap_.deactivate();
  11162. },
  11163. isContentScrollable: function isContentScrollable() {
  11164. return !!_this3.content_ && __WEBPACK_IMPORTED_MODULE_3__util__["isScrollable"]( /** @type {!Element} */_this3.content_);
  11165. },
  11166. areButtonsStacked: function areButtonsStacked() {
  11167. return __WEBPACK_IMPORTED_MODULE_3__util__["areTopsMisaligned"](_this3.buttons_);
  11168. },
  11169. getActionFromEvent: function getActionFromEvent(event) {
  11170. var element = Object(__WEBPACK_IMPORTED_MODULE_4__material_dom_ponyfill__["closest"])(event.target, '[' + strings.ACTION_ATTRIBUTE + ']');
  11171. return element && element.getAttribute(strings.ACTION_ATTRIBUTE);
  11172. },
  11173. clickDefaultButton: function clickDefaultButton() {
  11174. if (_this3.defaultButton_) {
  11175. _this3.defaultButton_.click();
  11176. }
  11177. },
  11178. reverseButtons: function reverseButtons() {
  11179. _this3.buttons_.reverse();
  11180. _this3.buttons_.forEach(function (button) {
  11181. return button.parentElement.appendChild(button);
  11182. });
  11183. },
  11184. notifyOpening: function notifyOpening() {
  11185. return _this3.emit(strings.OPENING_EVENT, {});
  11186. },
  11187. notifyOpened: function notifyOpened() {
  11188. return _this3.emit(strings.OPENED_EVENT, {});
  11189. },
  11190. notifyClosing: function notifyClosing(action) {
  11191. return _this3.emit(strings.CLOSING_EVENT, action ? { action: action } : {});
  11192. },
  11193. notifyClosed: function notifyClosed(action) {
  11194. return _this3.emit(strings.CLOSED_EVENT, action ? { action: action } : {});
  11195. }
  11196. });
  11197. }
  11198. }, {
  11199. key: 'isOpen',
  11200. get: function get() {
  11201. return this.foundation_.isOpen();
  11202. }
  11203. }, {
  11204. key: 'escapeKeyAction',
  11205. get: function get() {
  11206. return this.foundation_.getEscapeKeyAction();
  11207. },
  11208. set: function set(action) {
  11209. this.foundation_.setEscapeKeyAction(action);
  11210. }
  11211. }, {
  11212. key: 'scrimClickAction',
  11213. get: function get() {
  11214. return this.foundation_.getScrimClickAction();
  11215. },
  11216. set: function set(action) {
  11217. this.foundation_.setScrimClickAction(action);
  11218. }
  11219. }, {
  11220. key: 'autoStackButtons',
  11221. get: function get() {
  11222. return this.foundation_.getAutoStackButtons();
  11223. },
  11224. set: function set(autoStack) {
  11225. this.foundation_.setAutoStackButtons(autoStack);
  11226. }
  11227. }], [{
  11228. key: 'attachTo',
  11229. value: function attachTo(root) {
  11230. return new MDCDialog(root);
  11231. }
  11232. }]);
  11233. return MDCDialog;
  11234. }(__WEBPACK_IMPORTED_MODULE_0__material_base_index__["MDCComponent"]);
  11235. /***/ }),
  11236. /* 76 */
  11237. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11238. "use strict";
  11239. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_index__ = __webpack_require__(3);
  11240. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(77);
  11241. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(78);
  11242. 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; };
  11243. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  11244. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11245. 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; }
  11246. 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; }
  11247. /**
  11248. * @license
  11249. * Copyright 2017 Google Inc.
  11250. *
  11251. * Permission is hereby granted, free of charge, to any person obtaining a copy
  11252. * of this software and associated documentation files (the "Software"), to deal
  11253. * in the Software without restriction, including without limitation the rights
  11254. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  11255. * copies of the Software, and to permit persons to whom the Software is
  11256. * furnished to do so, subject to the following conditions:
  11257. *
  11258. * The above copyright notice and this permission notice shall be included in
  11259. * all copies or substantial portions of the Software.
  11260. *
  11261. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  11262. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  11263. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  11264. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  11265. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  11266. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  11267. * THE SOFTWARE.
  11268. */
  11269. var MDCDialogFoundation = function (_MDCFoundation) {
  11270. _inherits(MDCDialogFoundation, _MDCFoundation);
  11271. _createClass(MDCDialogFoundation, null, [{
  11272. key: 'cssClasses',
  11273. get: function get() {
  11274. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  11275. }
  11276. }, {
  11277. key: 'strings',
  11278. get: function get() {
  11279. return __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */];
  11280. }
  11281. }, {
  11282. key: 'numbers',
  11283. get: function get() {
  11284. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */];
  11285. }
  11286. }, {
  11287. key: 'defaultAdapter',
  11288. get: function get() {
  11289. return (/** @type {!MDCDialogAdapter} */{
  11290. addClass: function addClass() /* className: string */{},
  11291. removeClass: function removeClass() /* className: string */{},
  11292. hasClass: function hasClass() /* className: string */{},
  11293. addBodyClass: function addBodyClass() /* className: string */{},
  11294. removeBodyClass: function removeBodyClass() /* className: string */{},
  11295. eventTargetMatches: function eventTargetMatches() /* target: !EventTarget, selector: string */{},
  11296. trapFocus: function trapFocus() {},
  11297. releaseFocus: function releaseFocus() {},
  11298. isContentScrollable: function isContentScrollable() {},
  11299. areButtonsStacked: function areButtonsStacked() {},
  11300. getActionFromEvent: function getActionFromEvent() /* event: !Event */{},
  11301. clickDefaultButton: function clickDefaultButton() {},
  11302. reverseButtons: function reverseButtons() {},
  11303. notifyOpening: function notifyOpening() {},
  11304. notifyOpened: function notifyOpened() {},
  11305. notifyClosing: function notifyClosing() /* action: ?string */{},
  11306. notifyClosed: function notifyClosed() /* action: ?string */{}
  11307. }
  11308. );
  11309. }
  11310. /**
  11311. * @param {!MDCDialogAdapter=} adapter
  11312. */
  11313. }]);
  11314. function MDCDialogFoundation(adapter) {
  11315. _classCallCheck(this, MDCDialogFoundation);
  11316. /** @private {boolean} */
  11317. var _this = _possibleConstructorReturn(this, (MDCDialogFoundation.__proto__ || Object.getPrototypeOf(MDCDialogFoundation)).call(this, _extends(MDCDialogFoundation.defaultAdapter, adapter)));
  11318. _this.isOpen_ = false;
  11319. /** @private {number} */
  11320. _this.animationFrame_ = 0;
  11321. /** @private {number} */
  11322. _this.animationTimer_ = 0;
  11323. /** @private {number} */
  11324. _this.layoutFrame_ = 0;
  11325. /** @private {string} */
  11326. _this.escapeKeyAction_ = __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].CLOSE_ACTION;
  11327. /** @private {string} */
  11328. _this.scrimClickAction_ = __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].CLOSE_ACTION;
  11329. /** @private {boolean} */
  11330. _this.autoStackButtons_ = true;
  11331. /** @private {boolean} */
  11332. _this.areButtonsStacked_ = false;
  11333. return _this;
  11334. }
  11335. _createClass(MDCDialogFoundation, [{
  11336. key: 'init',
  11337. value: function init() {
  11338. if (this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].STACKED)) {
  11339. this.setAutoStackButtons(false);
  11340. }
  11341. }
  11342. }, {
  11343. key: 'destroy',
  11344. value: function destroy() {
  11345. if (this.isOpen_) {
  11346. this.close(__WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].DESTROY_ACTION);
  11347. }
  11348. if (this.animationFrame_) {
  11349. cancelAnimationFrame(this.animationFrame_);
  11350. }
  11351. if (this.animationTimer_) {
  11352. clearTimeout(this.animationTimer_);
  11353. this.handleAnimationTimerEnd_();
  11354. }
  11355. if (this.layoutFrame_) {
  11356. cancelAnimationFrame(this.layoutFrame_);
  11357. this.layoutFrame_ = 0;
  11358. }
  11359. }
  11360. }, {
  11361. key: 'open',
  11362. value: function open() {
  11363. var _this2 = this;
  11364. this.isOpen_ = true;
  11365. this.adapter_.notifyOpening();
  11366. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].OPENING);
  11367. // Wait a frame once display is no longer "none", to establish basis for animation
  11368. this.runNextAnimationFrame_(function () {
  11369. _this2.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].OPEN);
  11370. _this2.adapter_.addBodyClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SCROLL_LOCK);
  11371. _this2.layout();
  11372. _this2.animationTimer_ = setTimeout(function () {
  11373. _this2.handleAnimationTimerEnd_();
  11374. _this2.adapter_.trapFocus();
  11375. _this2.adapter_.notifyOpened();
  11376. }, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].DIALOG_ANIMATION_OPEN_TIME_MS);
  11377. });
  11378. }
  11379. /**
  11380. * @param {string=} action
  11381. */
  11382. }, {
  11383. key: 'close',
  11384. value: function close() {
  11385. var _this3 = this;
  11386. var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  11387. if (!this.isOpen_) {
  11388. // Avoid redundant close calls (and events), e.g. from keydown on elements that inherently emit click
  11389. return;
  11390. }
  11391. this.isOpen_ = false;
  11392. this.adapter_.notifyClosing(action);
  11393. this.adapter_.releaseFocus();
  11394. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CLOSING);
  11395. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].OPEN);
  11396. this.adapter_.removeBodyClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SCROLL_LOCK);
  11397. clearTimeout(this.animationTimer_);
  11398. this.animationTimer_ = setTimeout(function () {
  11399. _this3.handleAnimationTimerEnd_();
  11400. _this3.adapter_.notifyClosed(action);
  11401. }, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].DIALOG_ANIMATION_CLOSE_TIME_MS);
  11402. }
  11403. }, {
  11404. key: 'isOpen',
  11405. value: function isOpen() {
  11406. return this.isOpen_;
  11407. }
  11408. /** @return {string} */
  11409. }, {
  11410. key: 'getEscapeKeyAction',
  11411. value: function getEscapeKeyAction() {
  11412. return this.escapeKeyAction_;
  11413. }
  11414. /** @param {string} action */
  11415. }, {
  11416. key: 'setEscapeKeyAction',
  11417. value: function setEscapeKeyAction(action) {
  11418. this.escapeKeyAction_ = action;
  11419. }
  11420. /** @return {string} */
  11421. }, {
  11422. key: 'getScrimClickAction',
  11423. value: function getScrimClickAction() {
  11424. return this.scrimClickAction_;
  11425. }
  11426. /** @param {string} action */
  11427. }, {
  11428. key: 'setScrimClickAction',
  11429. value: function setScrimClickAction(action) {
  11430. this.scrimClickAction_ = action;
  11431. }
  11432. /** @return {boolean} */
  11433. }, {
  11434. key: 'getAutoStackButtons',
  11435. value: function getAutoStackButtons() {
  11436. return this.autoStackButtons_;
  11437. }
  11438. /** @param {boolean} autoStack */
  11439. }, {
  11440. key: 'setAutoStackButtons',
  11441. value: function setAutoStackButtons(autoStack) {
  11442. this.autoStackButtons_ = autoStack;
  11443. }
  11444. }, {
  11445. key: 'layout',
  11446. value: function layout() {
  11447. var _this4 = this;
  11448. if (this.layoutFrame_) {
  11449. cancelAnimationFrame(this.layoutFrame_);
  11450. }
  11451. this.layoutFrame_ = requestAnimationFrame(function () {
  11452. _this4.layoutInternal_();
  11453. _this4.layoutFrame_ = 0;
  11454. });
  11455. }
  11456. }, {
  11457. key: 'layoutInternal_',
  11458. value: function layoutInternal_() {
  11459. if (this.autoStackButtons_) {
  11460. this.detectStackedButtons_();
  11461. }
  11462. this.detectScrollableContent_();
  11463. }
  11464. /** @private */
  11465. }, {
  11466. key: 'detectStackedButtons_',
  11467. value: function detectStackedButtons_() {
  11468. // Remove the class first to let us measure the buttons' natural positions.
  11469. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].STACKED);
  11470. var areButtonsStacked = this.adapter_.areButtonsStacked();
  11471. if (areButtonsStacked) {
  11472. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].STACKED);
  11473. }
  11474. if (areButtonsStacked !== this.areButtonsStacked_) {
  11475. this.adapter_.reverseButtons();
  11476. this.areButtonsStacked_ = areButtonsStacked;
  11477. }
  11478. }
  11479. /** @private */
  11480. }, {
  11481. key: 'detectScrollableContent_',
  11482. value: function detectScrollableContent_() {
  11483. // Remove the class first to let us measure the natural height of the content.
  11484. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SCROLLABLE);
  11485. if (this.adapter_.isContentScrollable()) {
  11486. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SCROLLABLE);
  11487. }
  11488. }
  11489. /**
  11490. * @param {!Event} evt
  11491. * @private
  11492. */
  11493. }, {
  11494. key: 'handleInteraction',
  11495. value: function handleInteraction(evt) {
  11496. var isClick = evt.type === 'click';
  11497. var isEnter = evt.key === 'Enter' || evt.keyCode === 13;
  11498. // Check for scrim click first since it doesn't require querying ancestors
  11499. if (isClick && this.adapter_.eventTargetMatches(evt.target, __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].SCRIM_SELECTOR) && this.scrimClickAction_ !== '') {
  11500. this.close(this.scrimClickAction_);
  11501. } else if (isClick || evt.key === 'Space' || evt.keyCode === 32 || isEnter) {
  11502. var action = this.adapter_.getActionFromEvent(evt);
  11503. if (action) {
  11504. this.close(action);
  11505. } else if (isEnter && !this.adapter_.eventTargetMatches(evt.target, __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].SUPPRESS_DEFAULT_PRESS_SELECTOR)) {
  11506. this.adapter_.clickDefaultButton();
  11507. }
  11508. }
  11509. }
  11510. /**
  11511. * @param {!KeyboardEvent} evt
  11512. * @private
  11513. */
  11514. }, {
  11515. key: 'handleDocumentKeydown',
  11516. value: function handleDocumentKeydown(evt) {
  11517. if ((evt.key === 'Escape' || evt.keyCode === 27) && this.escapeKeyAction_ !== '') {
  11518. this.close(this.escapeKeyAction_);
  11519. }
  11520. }
  11521. /** @private */
  11522. }, {
  11523. key: 'handleAnimationTimerEnd_',
  11524. value: function handleAnimationTimerEnd_() {
  11525. this.animationTimer_ = 0;
  11526. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].OPENING);
  11527. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CLOSING);
  11528. }
  11529. /**
  11530. * Runs the given logic on the next animation frame, using setTimeout to factor in Firefox reflow behavior.
  11531. * @param {Function} callback
  11532. * @private
  11533. */
  11534. }, {
  11535. key: 'runNextAnimationFrame_',
  11536. value: function runNextAnimationFrame_(callback) {
  11537. var _this5 = this;
  11538. cancelAnimationFrame(this.animationFrame_);
  11539. this.animationFrame_ = requestAnimationFrame(function () {
  11540. _this5.animationFrame_ = 0;
  11541. clearTimeout(_this5.animationTimer_);
  11542. _this5.animationTimer_ = setTimeout(callback, 0);
  11543. });
  11544. }
  11545. }]);
  11546. return MDCDialogFoundation;
  11547. }(__WEBPACK_IMPORTED_MODULE_0__material_base_index__["MDCFoundation"]);
  11548. /* harmony default export */ __webpack_exports__["a"] = (MDCDialogFoundation);
  11549. /***/ }),
  11550. /* 77 */
  11551. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11552. "use strict";
  11553. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  11554. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11555. /**
  11556. * @license
  11557. * Copyright 2018 Google Inc.
  11558. *
  11559. * Permission is hereby granted, free of charge, to any person obtaining a copy
  11560. * of this software and associated documentation files (the "Software"), to deal
  11561. * in the Software without restriction, including without limitation the rights
  11562. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  11563. * copies of the Software, and to permit persons to whom the Software is
  11564. * furnished to do so, subject to the following conditions:
  11565. *
  11566. * The above copyright notice and this permission notice shall be included in
  11567. * all copies or substantial portions of the Software.
  11568. *
  11569. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  11570. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  11571. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  11572. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  11573. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  11574. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  11575. * THE SOFTWARE.
  11576. */
  11577. /* eslint no-unused-vars: [2, {"args": "none"}] */
  11578. /**
  11579. * Adapter for MDC Dialog. Provides an interface for managing:
  11580. * - CSS classes
  11581. * - DOM
  11582. * - Event handlers
  11583. *
  11584. * Additionally, provides type information for the adapter to the Closure
  11585. * compiler.
  11586. *
  11587. * Implement this adapter for your framework of choice to delegate updates to
  11588. * the component in your framework of choice. See architecture documentation
  11589. * for more details.
  11590. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  11591. *
  11592. * @record
  11593. */
  11594. var MDCDialogAdapter = function () {
  11595. function MDCDialogAdapter() {
  11596. _classCallCheck(this, MDCDialogAdapter);
  11597. }
  11598. _createClass(MDCDialogAdapter, [{
  11599. key: "addClass",
  11600. /** @param {string} className */
  11601. value: function addClass(className) {}
  11602. /** @param {string} className */
  11603. }, {
  11604. key: "removeClass",
  11605. value: function removeClass(className) {}
  11606. /**
  11607. * @param {string} className
  11608. * @return {boolean}
  11609. */
  11610. }, {
  11611. key: "hasClass",
  11612. value: function hasClass(className) {}
  11613. /** @param {string} className */
  11614. }, {
  11615. key: "addBodyClass",
  11616. value: function addBodyClass(className) {}
  11617. /** @param {string} className */
  11618. }, {
  11619. key: "removeBodyClass",
  11620. value: function removeBodyClass(className) {}
  11621. /**
  11622. * @param {!EventTarget} target
  11623. * @param {string} selector
  11624. * @return {boolean}
  11625. */
  11626. }, {
  11627. key: "eventTargetMatches",
  11628. value: function eventTargetMatches(target, selector) {}
  11629. }, {
  11630. key: "trapFocus",
  11631. value: function trapFocus() {}
  11632. }, {
  11633. key: "releaseFocus",
  11634. value: function releaseFocus() {}
  11635. /** @return {boolean} */
  11636. }, {
  11637. key: "isContentScrollable",
  11638. value: function isContentScrollable() {}
  11639. /** @return {boolean} */
  11640. }, {
  11641. key: "areButtonsStacked",
  11642. value: function areButtonsStacked() {}
  11643. /**
  11644. * @param {!Event} event
  11645. * @return {?string}
  11646. */
  11647. }, {
  11648. key: "getActionFromEvent",
  11649. value: function getActionFromEvent(event) {}
  11650. }, {
  11651. key: "clickDefaultButton",
  11652. value: function clickDefaultButton() {}
  11653. }, {
  11654. key: "reverseButtons",
  11655. value: function reverseButtons() {}
  11656. }, {
  11657. key: "notifyOpening",
  11658. value: function notifyOpening() {}
  11659. }, {
  11660. key: "notifyOpened",
  11661. value: function notifyOpened() {}
  11662. /**
  11663. * @param {string} action
  11664. */
  11665. }, {
  11666. key: "notifyClosing",
  11667. value: function notifyClosing(action) {}
  11668. /**
  11669. * @param {string} action
  11670. */
  11671. }, {
  11672. key: "notifyClosed",
  11673. value: function notifyClosed(action) {}
  11674. }]);
  11675. return MDCDialogAdapter;
  11676. }();
  11677. /* unused harmony default export */ var _unused_webpack_default_export = (MDCDialogAdapter);
  11678. /***/ }),
  11679. /* 78 */
  11680. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11681. "use strict";
  11682. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  11683. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; });
  11684. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; });
  11685. /**
  11686. * @license
  11687. * Copyright 2016 Google Inc.
  11688. *
  11689. * Permission is hereby granted, free of charge, to any person obtaining a copy
  11690. * of this software and associated documentation files (the "Software"), to deal
  11691. * in the Software without restriction, including without limitation the rights
  11692. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  11693. * copies of the Software, and to permit persons to whom the Software is
  11694. * furnished to do so, subject to the following conditions:
  11695. *
  11696. * The above copyright notice and this permission notice shall be included in
  11697. * all copies or substantial portions of the Software.
  11698. *
  11699. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  11700. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  11701. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  11702. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  11703. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  11704. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  11705. * THE SOFTWARE.
  11706. */
  11707. var cssClasses = {
  11708. OPEN: 'mdc-dialog--open',
  11709. OPENING: 'mdc-dialog--opening',
  11710. CLOSING: 'mdc-dialog--closing',
  11711. SCROLLABLE: 'mdc-dialog--scrollable',
  11712. STACKED: 'mdc-dialog--stacked',
  11713. SCROLL_LOCK: 'mdc-dialog-scroll-lock'
  11714. };
  11715. var strings = {
  11716. SCRIM_SELECTOR: '.mdc-dialog__scrim',
  11717. CONTAINER_SELECTOR: '.mdc-dialog__container',
  11718. SURFACE_SELECTOR: '.mdc-dialog__surface',
  11719. CONTENT_SELECTOR: '.mdc-dialog__content',
  11720. BUTTON_SELECTOR: '.mdc-dialog__button',
  11721. DEFAULT_BUTTON_SELECTOR: '.mdc-dialog__button--default',
  11722. SUPPRESS_DEFAULT_PRESS_SELECTOR: ['textarea', '.mdc-menu .mdc-list-item'].join(', '),
  11723. OPENING_EVENT: 'MDCDialog:opening',
  11724. OPENED_EVENT: 'MDCDialog:opened',
  11725. CLOSING_EVENT: 'MDCDialog:closing',
  11726. CLOSED_EVENT: 'MDCDialog:closed',
  11727. ACTION_ATTRIBUTE: 'data-mdc-dialog-action',
  11728. CLOSE_ACTION: 'close',
  11729. DESTROY_ACTION: 'destroy'
  11730. };
  11731. var numbers = {
  11732. DIALOG_ANIMATION_OPEN_TIME_MS: 150,
  11733. DIALOG_ANIMATION_CLOSE_TIME_MS: 75
  11734. };
  11735. /***/ }),
  11736. /* 79 */
  11737. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11738. "use strict";
  11739. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  11740. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFocusTrapInstance", function() { return createFocusTrapInstance; });
  11741. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isScrollable", function() { return isScrollable; });
  11742. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "areTopsMisaligned", function() { return areTopsMisaligned; });
  11743. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_focus_trap__ = __webpack_require__(35);
  11744. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_focus_trap___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_focus_trap__);
  11745. /**
  11746. * @license
  11747. * Copyright 2016 Google Inc.
  11748. *
  11749. * Permission is hereby granted, free of charge, to any person obtaining a copy
  11750. * of this software and associated documentation files (the "Software"), to deal
  11751. * in the Software without restriction, including without limitation the rights
  11752. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  11753. * copies of the Software, and to permit persons to whom the Software is
  11754. * furnished to do so, subject to the following conditions:
  11755. *
  11756. * The above copyright notice and this permission notice shall be included in
  11757. * all copies or substantial portions of the Software.
  11758. *
  11759. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  11760. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  11761. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  11762. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  11763. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  11764. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  11765. * THE SOFTWARE.
  11766. */
  11767. /**
  11768. * @param {!Element} surfaceEl
  11769. * @param {?Element=} initialFocusEl
  11770. * @param {function(!Element, !FocusTrapCreateOptions): !FocusTrapInstance} focusTrapFactory
  11771. * @return {!FocusTrapInstance}
  11772. */
  11773. function createFocusTrapInstance(surfaceEl) {
  11774. var focusTrapFactory = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : __WEBPACK_IMPORTED_MODULE_0_focus_trap___default.a;
  11775. var initialFocusEl = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  11776. return focusTrapFactory(surfaceEl, {
  11777. initialFocus: initialFocusEl,
  11778. escapeDeactivates: false, // Dialog foundation handles escape key
  11779. clickOutsideDeactivates: true });
  11780. }
  11781. /**
  11782. * @param {!Element} el
  11783. * @return {boolean}
  11784. */
  11785. function isScrollable(el) {
  11786. return el.scrollHeight > el.offsetHeight;
  11787. }
  11788. /**
  11789. * @param {!Array<!Element>|!NodeList} els
  11790. * @return {boolean}
  11791. */
  11792. function areTopsMisaligned(els) {
  11793. var tops = new Set();
  11794. [].forEach.call(els, function (el) {
  11795. return tops.add(el.offsetTop);
  11796. });
  11797. return tops.size > 1;
  11798. }
  11799. /***/ }),
  11800. /* 80 */
  11801. /***/ (function(module, exports) {
  11802. module.exports = function(el) {
  11803. var basicTabbables = [];
  11804. var orderedTabbables = [];
  11805. // A node is "available" if
  11806. // - it's computed style
  11807. var isUnavailable = createIsUnavailable();
  11808. var candidateSelectors = [
  11809. 'input',
  11810. 'select',
  11811. 'a[href]',
  11812. 'textarea',
  11813. 'button',
  11814. '[tabindex]',
  11815. ];
  11816. var candidates = el.querySelectorAll(candidateSelectors);
  11817. var candidate, candidateIndex;
  11818. for (var i = 0, l = candidates.length; i < l; i++) {
  11819. candidate = candidates[i];
  11820. candidateIndex = parseInt(candidate.getAttribute('tabindex'), 10) || candidate.tabIndex;
  11821. if (
  11822. candidateIndex < 0
  11823. || (candidate.tagName === 'INPUT' && candidate.type === 'hidden')
  11824. || candidate.disabled
  11825. || isUnavailable(candidate)
  11826. ) {
  11827. continue;
  11828. }
  11829. if (candidateIndex === 0) {
  11830. basicTabbables.push(candidate);
  11831. } else {
  11832. orderedTabbables.push({
  11833. tabIndex: candidateIndex,
  11834. node: candidate,
  11835. });
  11836. }
  11837. }
  11838. var tabbableNodes = orderedTabbables
  11839. .sort(function(a, b) {
  11840. return a.tabIndex - b.tabIndex;
  11841. })
  11842. .map(function(a) {
  11843. return a.node
  11844. });
  11845. Array.prototype.push.apply(tabbableNodes, basicTabbables);
  11846. return tabbableNodes;
  11847. }
  11848. function createIsUnavailable() {
  11849. // Node cache must be refreshed on every check, in case
  11850. // the content of the element has changed
  11851. var isOffCache = [];
  11852. // "off" means `display: none;`, as opposed to "hidden",
  11853. // which means `visibility: hidden;`. getComputedStyle
  11854. // accurately reflects visiblity in context but not
  11855. // "off" state, so we need to recursively check parents.
  11856. function isOff(node, nodeComputedStyle) {
  11857. if (node === document.documentElement) return false;
  11858. // Find the cached node (Array.prototype.find not available in IE9)
  11859. for (var i = 0, length = isOffCache.length; i < length; i++) {
  11860. if (isOffCache[i][0] === node) return isOffCache[i][1];
  11861. }
  11862. nodeComputedStyle = nodeComputedStyle || window.getComputedStyle(node);
  11863. var result = false;
  11864. if (nodeComputedStyle.display === 'none') {
  11865. result = true;
  11866. } else if (node.parentNode) {
  11867. result = isOff(node.parentNode);
  11868. }
  11869. isOffCache.push([node, result]);
  11870. return result;
  11871. }
  11872. return function isUnavailable(node) {
  11873. if (node === document.documentElement) return false;
  11874. var computedStyle = window.getComputedStyle(node);
  11875. if (isOff(node, computedStyle)) return true;
  11876. return computedStyle.visibility === 'hidden';
  11877. }
  11878. }
  11879. /***/ }),
  11880. /* 81 */
  11881. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11882. "use strict";
  11883. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  11884. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__ponyfill__ = __webpack_require__(13);
  11885. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "ponyfill", function() { return __WEBPACK_IMPORTED_MODULE_0__ponyfill__; });
  11886. /**
  11887. * @license
  11888. * Copyright 2018 Google Inc.
  11889. *
  11890. * Permission is hereby granted, free of charge, to any person obtaining a copy
  11891. * of this software and associated documentation files (the "Software"), to deal
  11892. * in the Software without restriction, including without limitation the rights
  11893. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  11894. * copies of the Software, and to permit persons to whom the Software is
  11895. * furnished to do so, subject to the following conditions:
  11896. *
  11897. * The above copyright notice and this permission notice shall be included in
  11898. * all copies or substantial portions of the Software.
  11899. *
  11900. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  11901. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  11902. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  11903. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  11904. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  11905. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  11906. * THE SOFTWARE.
  11907. */
  11908. /***/ }),
  11909. /* 82 */
  11910. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11911. "use strict";
  11912. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  11913. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCDrawer", function() { return MDCDrawer; });
  11914. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_index__ = __webpack_require__(3);
  11915. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__dismissible_foundation__ = __webpack_require__(36);
  11916. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__modal_foundation__ = __webpack_require__(83);
  11917. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__adapter__ = __webpack_require__(14);
  11918. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__material_list_index__ = __webpack_require__(15);
  11919. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__material_list_foundation__ = __webpack_require__(16);
  11920. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__constants__ = __webpack_require__(37);
  11921. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__util__ = __webpack_require__(84);
  11922. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_focus_trap__ = __webpack_require__(40);
  11923. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_focus_trap___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_focus_trap__);
  11924. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCDismissibleDrawerFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__dismissible_foundation__["a"]; });
  11925. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCModalDrawerFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__modal_foundation__["a"]; });
  11926. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "util", function() { return __WEBPACK_IMPORTED_MODULE_7__util__; });
  11927. 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; };
  11928. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  11929. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11930. 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; }
  11931. 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; }
  11932. /**
  11933. * @license
  11934. * Copyright 2016 Google Inc.
  11935. *
  11936. * Permission is hereby granted, free of charge, to any person obtaining a copy
  11937. * of this software and associated documentation files (the "Software"), to deal
  11938. * in the Software without restriction, including without limitation the rights
  11939. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  11940. * copies of the Software, and to permit persons to whom the Software is
  11941. * furnished to do so, subject to the following conditions:
  11942. *
  11943. * The above copyright notice and this permission notice shall be included in
  11944. * all copies or substantial portions of the Software.
  11945. *
  11946. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  11947. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  11948. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  11949. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  11950. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  11951. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  11952. * THE SOFTWARE.
  11953. */
  11954. /**
  11955. * @extends {MDCComponent<!MDCDismissibleDrawerFoundation>}
  11956. * @final
  11957. */
  11958. var MDCDrawer = function (_MDCComponent) {
  11959. _inherits(MDCDrawer, _MDCComponent);
  11960. /**
  11961. * @param {...?} args
  11962. */
  11963. function MDCDrawer() {
  11964. var _ref;
  11965. _classCallCheck(this, MDCDrawer);
  11966. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  11967. args[_key] = arguments[_key];
  11968. }
  11969. /** @private {!Element} */
  11970. var _this = _possibleConstructorReturn(this, (_ref = MDCDrawer.__proto__ || Object.getPrototypeOf(MDCDrawer)).call.apply(_ref, [this].concat(args)));
  11971. _this.previousFocus_;
  11972. /** @private {!Function} */
  11973. _this.handleKeydown_;
  11974. /** @private {!Function} */
  11975. _this.handleTransitionEnd_;
  11976. /** @private {!Function} */
  11977. _this.focusTrapFactory_;
  11978. /** @private {!FocusTrapInstance} */
  11979. _this.focusTrap_;
  11980. /** @private {?Element} */
  11981. _this.scrim_;
  11982. /** @private {?Function} */
  11983. _this.handleScrimClick_;
  11984. /** @private {?MDCList} */
  11985. _this.list_;
  11986. return _this;
  11987. }
  11988. /**
  11989. * @param {!Element} root
  11990. * @return {!MDCDrawer}
  11991. */
  11992. _createClass(MDCDrawer, [{
  11993. key: 'initialize',
  11994. value: function initialize() {
  11995. var focusTrapFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : __WEBPACK_IMPORTED_MODULE_8_focus_trap___default.a;
  11996. var listFactory = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (el) {
  11997. return new __WEBPACK_IMPORTED_MODULE_4__material_list_index__["MDCList"](el);
  11998. };
  11999. var listEl = /** @type {!Element} */this.root_.querySelector('.' + __WEBPACK_IMPORTED_MODULE_5__material_list_foundation__["a" /* default */].cssClasses.ROOT);
  12000. if (listEl) {
  12001. this.list_ = listFactory(listEl);
  12002. this.list_.wrapFocus = true;
  12003. }
  12004. this.focusTrapFactory_ = focusTrapFactory;
  12005. }
  12006. }, {
  12007. key: 'initialSyncWithDOM',
  12008. value: function initialSyncWithDOM() {
  12009. var _this2 = this;
  12010. var MODAL = __WEBPACK_IMPORTED_MODULE_1__dismissible_foundation__["a" /* default */].cssClasses.MODAL;
  12011. if (this.root_.classList.contains(MODAL)) {
  12012. var SCRIM_SELECTOR = __WEBPACK_IMPORTED_MODULE_1__dismissible_foundation__["a" /* default */].strings.SCRIM_SELECTOR;
  12013. this.scrim_ = /** @type {!Element} */this.root_.parentElement.querySelector(SCRIM_SELECTOR);
  12014. this.handleScrimClick_ = function () {
  12015. return (/** @type {!MDCModalDrawerFoundation} */_this2.foundation_.handleScrimClick()
  12016. );
  12017. };
  12018. this.scrim_.addEventListener('click', this.handleScrimClick_);
  12019. this.focusTrap_ = __WEBPACK_IMPORTED_MODULE_7__util__["createFocusTrapInstance"](this.root_, this.focusTrapFactory_);
  12020. }
  12021. this.handleKeydown_ = function (evt) {
  12022. return _this2.foundation_.handleKeydown(evt);
  12023. };
  12024. this.handleTransitionEnd_ = function (evt) {
  12025. return _this2.foundation_.handleTransitionEnd(evt);
  12026. };
  12027. this.root_.addEventListener('keydown', this.handleKeydown_);
  12028. this.root_.addEventListener('transitionend', this.handleTransitionEnd_);
  12029. }
  12030. }, {
  12031. key: 'destroy',
  12032. value: function destroy() {
  12033. this.root_.removeEventListener('keydown', this.handleKeydown_);
  12034. this.root_.removeEventListener('transitionend', this.handleTransitionEnd_);
  12035. if (this.list_) {
  12036. this.list_.destroy();
  12037. }
  12038. var MODAL = __WEBPACK_IMPORTED_MODULE_1__dismissible_foundation__["a" /* default */].cssClasses.MODAL;
  12039. if (this.root_.classList.contains(MODAL)) {
  12040. this.scrim_.removeEventListener('click', /** @type {!Function} */this.handleScrimClick_);
  12041. // Ensure drawer is closed to hide scrim and release focus
  12042. this.open = false;
  12043. }
  12044. }
  12045. }, {
  12046. key: 'getDefaultFoundation',
  12047. value: function getDefaultFoundation() {
  12048. var _this3 = this;
  12049. /** @type {!MDCDrawerAdapter} */
  12050. var adapter = /** @type {!MDCDrawerAdapter} */_extends({
  12051. addClass: function addClass(className) {
  12052. return _this3.root_.classList.add(className);
  12053. },
  12054. removeClass: function removeClass(className) {
  12055. return _this3.root_.classList.remove(className);
  12056. },
  12057. hasClass: function hasClass(className) {
  12058. return _this3.root_.classList.contains(className);
  12059. },
  12060. elementHasClass: function elementHasClass(element, className) {
  12061. return element.classList.contains(className);
  12062. },
  12063. saveFocus: function saveFocus() {
  12064. _this3.previousFocus_ = document.activeElement;
  12065. },
  12066. restoreFocus: function restoreFocus() {
  12067. var previousFocus = _this3.previousFocus_ && _this3.previousFocus_.focus;
  12068. if (_this3.root_.contains(document.activeElement) && previousFocus) {
  12069. _this3.previousFocus_.focus();
  12070. }
  12071. },
  12072. focusActiveNavigationItem: function focusActiveNavigationItem() {
  12073. var activeNavItemEl = _this3.root_.querySelector('.' + __WEBPACK_IMPORTED_MODULE_5__material_list_foundation__["a" /* default */].cssClasses.LIST_ITEM_ACTIVATED_CLASS);
  12074. if (activeNavItemEl) {
  12075. activeNavItemEl.focus();
  12076. }
  12077. },
  12078. notifyClose: function notifyClose() {
  12079. return _this3.emit(__WEBPACK_IMPORTED_MODULE_6__constants__["b" /* strings */].CLOSE_EVENT, {}, true /* shouldBubble */);
  12080. },
  12081. notifyOpen: function notifyOpen() {
  12082. return _this3.emit(__WEBPACK_IMPORTED_MODULE_6__constants__["b" /* strings */].OPEN_EVENT, {}, true /* shouldBubble */);
  12083. },
  12084. trapFocus: function trapFocus() {
  12085. return _this3.focusTrap_.activate();
  12086. },
  12087. releaseFocus: function releaseFocus() {
  12088. return _this3.focusTrap_.deactivate();
  12089. }
  12090. });
  12091. var _MDCDismissibleDrawer = __WEBPACK_IMPORTED_MODULE_1__dismissible_foundation__["a" /* default */].cssClasses,
  12092. DISMISSIBLE = _MDCDismissibleDrawer.DISMISSIBLE,
  12093. MODAL = _MDCDismissibleDrawer.MODAL;
  12094. if (this.root_.classList.contains(DISMISSIBLE)) {
  12095. return new __WEBPACK_IMPORTED_MODULE_1__dismissible_foundation__["a" /* default */](adapter);
  12096. } else if (this.root_.classList.contains(MODAL)) {
  12097. return new __WEBPACK_IMPORTED_MODULE_2__modal_foundation__["a" /* default */](adapter);
  12098. } else {
  12099. throw new Error('MDCDrawer: Failed to instantiate component. Supported variants are ' + DISMISSIBLE + ' and ' + MODAL + '.');
  12100. }
  12101. }
  12102. }, {
  12103. key: 'open',
  12104. /**
  12105. * Returns true if drawer is in the open position.
  12106. * @return {boolean}
  12107. */
  12108. get: function get() {
  12109. return this.foundation_.isOpen();
  12110. }
  12111. /**
  12112. * Toggles the drawer open and closed.
  12113. * @param {boolean} isOpen
  12114. */
  12115. ,
  12116. set: function set(isOpen) {
  12117. if (isOpen) {
  12118. this.foundation_.open();
  12119. } else {
  12120. this.foundation_.close();
  12121. }
  12122. }
  12123. }], [{
  12124. key: 'attachTo',
  12125. value: function attachTo(root) {
  12126. return new MDCDrawer(root);
  12127. }
  12128. }]);
  12129. return MDCDrawer;
  12130. }(__WEBPACK_IMPORTED_MODULE_0__material_base_index__["MDCComponent"]);
  12131. /***/ }),
  12132. /* 83 */
  12133. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12134. "use strict";
  12135. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__adapter__ = __webpack_require__(14);
  12136. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__dismissible_foundation__ = __webpack_require__(36);
  12137. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  12138. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  12139. 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; }
  12140. 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; }
  12141. /**
  12142. * @license
  12143. * Copyright 2018 Google Inc.
  12144. *
  12145. * Permission is hereby granted, free of charge, to any person obtaining a copy
  12146. * of this software and associated documentation files (the "Software"), to deal
  12147. * in the Software without restriction, including without limitation the rights
  12148. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  12149. * copies of the Software, and to permit persons to whom the Software is
  12150. * furnished to do so, subject to the following conditions:
  12151. *
  12152. * The above copyright notice and this permission notice shall be included in
  12153. * all copies or substantial portions of the Software.
  12154. *
  12155. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  12156. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  12157. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  12158. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  12159. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  12160. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  12161. * THE SOFTWARE.
  12162. */
  12163. /**
  12164. * @extends {MDCDismissibleDrawerFoundation}
  12165. */
  12166. var MDCModalDrawerFoundation = function (_MDCDismissibleDrawer) {
  12167. _inherits(MDCModalDrawerFoundation, _MDCDismissibleDrawer);
  12168. function MDCModalDrawerFoundation() {
  12169. _classCallCheck(this, MDCModalDrawerFoundation);
  12170. return _possibleConstructorReturn(this, (MDCModalDrawerFoundation.__proto__ || Object.getPrototypeOf(MDCModalDrawerFoundation)).apply(this, arguments));
  12171. }
  12172. _createClass(MDCModalDrawerFoundation, [{
  12173. key: 'opened',
  12174. /**
  12175. * Called when drawer finishes open animation.
  12176. * @override
  12177. */
  12178. value: function opened() {
  12179. this.adapter_.trapFocus();
  12180. }
  12181. /**
  12182. * Called when drawer finishes close animation.
  12183. * @override
  12184. */
  12185. }, {
  12186. key: 'closed',
  12187. value: function closed() {
  12188. this.adapter_.releaseFocus();
  12189. }
  12190. /**
  12191. * Handles click event on scrim.
  12192. */
  12193. }, {
  12194. key: 'handleScrimClick',
  12195. value: function handleScrimClick() {
  12196. this.close();
  12197. }
  12198. }]);
  12199. return MDCModalDrawerFoundation;
  12200. }(__WEBPACK_IMPORTED_MODULE_1__dismissible_foundation__["a" /* default */]);
  12201. /* harmony default export */ __webpack_exports__["a"] = (MDCModalDrawerFoundation);
  12202. /***/ }),
  12203. /* 84 */
  12204. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12205. "use strict";
  12206. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  12207. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFocusTrapInstance", function() { return createFocusTrapInstance; });
  12208. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_focus_trap__ = __webpack_require__(40);
  12209. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_focus_trap___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_focus_trap__);
  12210. /**
  12211. * @license
  12212. * Copyright 2016 Google Inc.
  12213. *
  12214. * Permission is hereby granted, free of charge, to any person obtaining a copy
  12215. * of this software and associated documentation files (the "Software"), to deal
  12216. * in the Software without restriction, including without limitation the rights
  12217. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  12218. * copies of the Software, and to permit persons to whom the Software is
  12219. * furnished to do so, subject to the following conditions:
  12220. *
  12221. * The above copyright notice and this permission notice shall be included in
  12222. * all copies or substantial portions of the Software.
  12223. *
  12224. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  12225. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  12226. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  12227. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  12228. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  12229. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  12230. * THE SOFTWARE.
  12231. */
  12232. /**
  12233. * @param {!Element} surfaceEl
  12234. * @param {!Function} focusTrapFactory
  12235. * @return {!FocusTrapInstance}
  12236. */
  12237. function createFocusTrapInstance(surfaceEl) {
  12238. var focusTrapFactory = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : __WEBPACK_IMPORTED_MODULE_0_focus_trap___default.a;
  12239. return focusTrapFactory(surfaceEl, {
  12240. clickOutsideDeactivates: true,
  12241. initialFocus: false, // Navigation drawer handles focusing on active nav item.
  12242. escapeDeactivates: false, // Navigation drawer handles ESC.
  12243. returnFocusOnDeactivate: false });
  12244. }
  12245. /***/ }),
  12246. /* 85 */
  12247. /***/ (function(module, exports) {
  12248. var candidateSelectors = [
  12249. 'input',
  12250. 'select',
  12251. 'textarea',
  12252. 'a[href]',
  12253. 'button',
  12254. '[tabindex]',
  12255. 'audio[controls]',
  12256. 'video[controls]',
  12257. '[contenteditable]:not([contenteditable="false"])',
  12258. ];
  12259. var candidateSelector = candidateSelectors.join(',');
  12260. var matches = Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
  12261. function tabbable(el, options) {
  12262. options = options || {};
  12263. var elementDocument = el.ownerDocument || el;
  12264. var regularTabbables = [];
  12265. var orderedTabbables = [];
  12266. var untouchabilityChecker = new UntouchabilityChecker(elementDocument);
  12267. var candidates = el.querySelectorAll(candidateSelector);
  12268. if (options.includeContainer) {
  12269. if (matches.call(el, candidateSelector)) {
  12270. candidates = Array.prototype.slice.apply(candidates);
  12271. candidates.unshift(el);
  12272. }
  12273. }
  12274. var i, candidate, candidateTabindex;
  12275. for (i = 0; i < candidates.length; i++) {
  12276. candidate = candidates[i];
  12277. if (!isNodeMatchingSelectorTabbable(candidate, untouchabilityChecker)) continue;
  12278. candidateTabindex = getTabindex(candidate);
  12279. if (candidateTabindex === 0) {
  12280. regularTabbables.push(candidate);
  12281. } else {
  12282. orderedTabbables.push({
  12283. documentOrder: i,
  12284. tabIndex: candidateTabindex,
  12285. node: candidate,
  12286. });
  12287. }
  12288. }
  12289. var tabbableNodes = orderedTabbables
  12290. .sort(sortOrderedTabbables)
  12291. .map(function(a) { return a.node })
  12292. .concat(regularTabbables);
  12293. return tabbableNodes;
  12294. }
  12295. tabbable.isTabbable = isTabbable;
  12296. tabbable.isFocusable = isFocusable;
  12297. function isNodeMatchingSelectorTabbable(node, untouchabilityChecker) {
  12298. if (
  12299. !isNodeMatchingSelectorFocusable(node, untouchabilityChecker)
  12300. || isNonTabbableRadio(node)
  12301. || getTabindex(node) < 0
  12302. ) {
  12303. return false;
  12304. }
  12305. return true;
  12306. }
  12307. function isTabbable(node, untouchabilityChecker) {
  12308. if (!node) throw new Error('No node provided');
  12309. if (matches.call(node, candidateSelector) === false) return false;
  12310. return isNodeMatchingSelectorTabbable(node, untouchabilityChecker);
  12311. }
  12312. function isNodeMatchingSelectorFocusable(node, untouchabilityChecker) {
  12313. untouchabilityChecker = untouchabilityChecker || new UntouchabilityChecker(node.ownerDocument || node);
  12314. if (
  12315. node.disabled
  12316. || isHiddenInput(node)
  12317. || untouchabilityChecker.isUntouchable(node)
  12318. ) {
  12319. return false;
  12320. }
  12321. return true;
  12322. }
  12323. var focusableCandidateSelector = candidateSelectors.concat('iframe').join(',');
  12324. function isFocusable(node, untouchabilityChecker) {
  12325. if (!node) throw new Error('No node provided');
  12326. if (matches.call(node, focusableCandidateSelector) === false) return false;
  12327. return isNodeMatchingSelectorFocusable(node, untouchabilityChecker);
  12328. }
  12329. function getTabindex(node) {
  12330. var tabindexAttr = parseInt(node.getAttribute('tabindex'), 10);
  12331. if (!isNaN(tabindexAttr)) return tabindexAttr;
  12332. // Browsers do not return `tabIndex` correctly for contentEditable nodes;
  12333. // so if they don't have a tabindex attribute specifically set, assume it's 0.
  12334. if (isContentEditable(node)) return 0;
  12335. return node.tabIndex;
  12336. }
  12337. function sortOrderedTabbables(a, b) {
  12338. return a.tabIndex === b.tabIndex ? a.documentOrder - b.documentOrder : a.tabIndex - b.tabIndex;
  12339. }
  12340. // Array.prototype.find not available in IE.
  12341. function find(list, predicate) {
  12342. for (var i = 0, length = list.length; i < length; i++) {
  12343. if (predicate(list[i])) return list[i];
  12344. }
  12345. }
  12346. function isContentEditable(node) {
  12347. return node.contentEditable === 'true';
  12348. }
  12349. function isInput(node) {
  12350. return node.tagName === 'INPUT';
  12351. }
  12352. function isHiddenInput(node) {
  12353. return isInput(node) && node.type === 'hidden';
  12354. }
  12355. function isRadio(node) {
  12356. return isInput(node) && node.type === 'radio';
  12357. }
  12358. function isNonTabbableRadio(node) {
  12359. return isRadio(node) && !isTabbableRadio(node);
  12360. }
  12361. function getCheckedRadio(nodes) {
  12362. for (var i = 0; i < nodes.length; i++) {
  12363. if (nodes[i].checked) {
  12364. return nodes[i];
  12365. }
  12366. }
  12367. }
  12368. function isTabbableRadio(node) {
  12369. if (!node.name) return true;
  12370. // This won't account for the edge case where you have radio groups with the same
  12371. // in separate forms on the same page.
  12372. var radioSet = node.ownerDocument.querySelectorAll('input[type="radio"][name="' + node.name + '"]');
  12373. var checked = getCheckedRadio(radioSet);
  12374. return !checked || checked === node;
  12375. }
  12376. // An element is "untouchable" if *it or one of its ancestors* has
  12377. // `visibility: hidden` or `display: none`.
  12378. function UntouchabilityChecker(elementDocument) {
  12379. this.doc = elementDocument;
  12380. // Node cache must be refreshed on every check, in case
  12381. // the content of the element has changed. The cache contains tuples
  12382. // mapping nodes to their boolean result.
  12383. this.cache = [];
  12384. }
  12385. // getComputedStyle accurately reflects `visibility: hidden` of ancestors
  12386. // but not `display: none`, so we need to recursively check parents.
  12387. UntouchabilityChecker.prototype.hasDisplayNone = function hasDisplayNone(node, nodeComputedStyle) {
  12388. if (node === this.doc.documentElement) return false;
  12389. // Search for a cached result.
  12390. var cached = find(this.cache, function(item) {
  12391. return item === node;
  12392. });
  12393. if (cached) return cached[1];
  12394. nodeComputedStyle = nodeComputedStyle || this.doc.defaultView.getComputedStyle(node);
  12395. var result = false;
  12396. if (nodeComputedStyle.display === 'none') {
  12397. result = true;
  12398. } else if (node.parentNode) {
  12399. result = this.hasDisplayNone(node.parentNode);
  12400. }
  12401. this.cache.push([node, result]);
  12402. return result;
  12403. }
  12404. UntouchabilityChecker.prototype.isUntouchable = function isUntouchable(node) {
  12405. if (node === this.doc.documentElement) return false;
  12406. var computedStyle = this.doc.defaultView.getComputedStyle(node);
  12407. if (this.hasDisplayNone(node, computedStyle)) return true;
  12408. return computedStyle.visibility === 'hidden';
  12409. }
  12410. module.exports = tabbable;
  12411. /***/ }),
  12412. /* 86 */
  12413. /***/ (function(module, exports) {
  12414. module.exports = extend
  12415. var hasOwnProperty = Object.prototype.hasOwnProperty;
  12416. function extend() {
  12417. var target = {}
  12418. for (var i = 0; i < arguments.length; i++) {
  12419. var source = arguments[i]
  12420. for (var key in source) {
  12421. if (hasOwnProperty.call(source, key)) {
  12422. target[key] = source[key]
  12423. }
  12424. }
  12425. }
  12426. return target
  12427. }
  12428. /***/ }),
  12429. /* 87 */
  12430. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12431. "use strict";
  12432. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  12433. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(41);
  12434. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(88);
  12435. 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; };
  12436. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  12437. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  12438. 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; }
  12439. 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; }
  12440. /**
  12441. * @license
  12442. * Copyright 2016 Google Inc.
  12443. *
  12444. * Permission is hereby granted, free of charge, to any person obtaining a copy
  12445. * of this software and associated documentation files (the "Software"), to deal
  12446. * in the Software without restriction, including without limitation the rights
  12447. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  12448. * copies of the Software, and to permit persons to whom the Software is
  12449. * furnished to do so, subject to the following conditions:
  12450. *
  12451. * The above copyright notice and this permission notice shall be included in
  12452. * all copies or substantial portions of the Software.
  12453. *
  12454. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  12455. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  12456. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  12457. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  12458. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  12459. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  12460. * THE SOFTWARE.
  12461. */
  12462. /**
  12463. * @extends {MDCFoundation<!MDCFloatingLabelAdapter>}
  12464. * @final
  12465. */
  12466. var MDCFloatingLabelFoundation = function (_MDCFoundation) {
  12467. _inherits(MDCFloatingLabelFoundation, _MDCFoundation);
  12468. _createClass(MDCFloatingLabelFoundation, null, [{
  12469. key: 'cssClasses',
  12470. /** @return enum {string} */
  12471. get: function get() {
  12472. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  12473. }
  12474. /**
  12475. * {@see MDCFloatingLabelAdapter} for typing information on parameters and return
  12476. * types.
  12477. * @return {!MDCFloatingLabelAdapter}
  12478. */
  12479. }, {
  12480. key: 'defaultAdapter',
  12481. get: function get() {
  12482. return (/** @type {!MDCFloatingLabelAdapter} */{
  12483. addClass: function addClass() {},
  12484. removeClass: function removeClass() {},
  12485. getWidth: function getWidth() {},
  12486. registerInteractionHandler: function registerInteractionHandler() {},
  12487. deregisterInteractionHandler: function deregisterInteractionHandler() {}
  12488. }
  12489. );
  12490. }
  12491. /**
  12492. * @param {!MDCFloatingLabelAdapter} adapter
  12493. */
  12494. }]);
  12495. function MDCFloatingLabelFoundation(adapter) {
  12496. _classCallCheck(this, MDCFloatingLabelFoundation);
  12497. /** @private {function(!Event): undefined} */
  12498. var _this = _possibleConstructorReturn(this, (MDCFloatingLabelFoundation.__proto__ || Object.getPrototypeOf(MDCFloatingLabelFoundation)).call(this, _extends(MDCFloatingLabelFoundation.defaultAdapter, adapter)));
  12499. _this.shakeAnimationEndHandler_ = function () {
  12500. return _this.handleShakeAnimationEnd_();
  12501. };
  12502. return _this;
  12503. }
  12504. _createClass(MDCFloatingLabelFoundation, [{
  12505. key: 'init',
  12506. value: function init() {
  12507. this.adapter_.registerInteractionHandler('animationend', this.shakeAnimationEndHandler_);
  12508. }
  12509. }, {
  12510. key: 'destroy',
  12511. value: function destroy() {
  12512. this.adapter_.deregisterInteractionHandler('animationend', this.shakeAnimationEndHandler_);
  12513. }
  12514. /**
  12515. * Returns the width of the label element.
  12516. * @return {number}
  12517. */
  12518. }, {
  12519. key: 'getWidth',
  12520. value: function getWidth() {
  12521. return this.adapter_.getWidth();
  12522. }
  12523. /**
  12524. * Styles the label to produce the label shake for errors.
  12525. * @param {boolean} shouldShake adds shake class if true,
  12526. * otherwise removes shake class.
  12527. */
  12528. }, {
  12529. key: 'shake',
  12530. value: function shake(shouldShake) {
  12531. var LABEL_SHAKE = MDCFloatingLabelFoundation.cssClasses.LABEL_SHAKE;
  12532. if (shouldShake) {
  12533. this.adapter_.addClass(LABEL_SHAKE);
  12534. } else {
  12535. this.adapter_.removeClass(LABEL_SHAKE);
  12536. }
  12537. }
  12538. /**
  12539. * Styles the label to float or dock.
  12540. * @param {boolean} shouldFloat adds float class if true, otherwise remove
  12541. * float and shake class to dock label.
  12542. */
  12543. }, {
  12544. key: 'float',
  12545. value: function float(shouldFloat) {
  12546. var _MDCFloatingLabelFoun = MDCFloatingLabelFoundation.cssClasses,
  12547. LABEL_FLOAT_ABOVE = _MDCFloatingLabelFoun.LABEL_FLOAT_ABOVE,
  12548. LABEL_SHAKE = _MDCFloatingLabelFoun.LABEL_SHAKE;
  12549. if (shouldFloat) {
  12550. this.adapter_.addClass(LABEL_FLOAT_ABOVE);
  12551. } else {
  12552. this.adapter_.removeClass(LABEL_FLOAT_ABOVE);
  12553. this.adapter_.removeClass(LABEL_SHAKE);
  12554. }
  12555. }
  12556. /**
  12557. * Handles an interaction event on the root element.
  12558. */
  12559. }, {
  12560. key: 'handleShakeAnimationEnd_',
  12561. value: function handleShakeAnimationEnd_() {
  12562. var LABEL_SHAKE = MDCFloatingLabelFoundation.cssClasses.LABEL_SHAKE;
  12563. this.adapter_.removeClass(LABEL_SHAKE);
  12564. }
  12565. }]);
  12566. return MDCFloatingLabelFoundation;
  12567. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  12568. /* harmony default export */ __webpack_exports__["a"] = (MDCFloatingLabelFoundation);
  12569. /***/ }),
  12570. /* 88 */
  12571. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12572. "use strict";
  12573. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  12574. /**
  12575. * @license
  12576. * Copyright 2016 Google Inc.
  12577. *
  12578. * Permission is hereby granted, free of charge, to any person obtaining a copy
  12579. * of this software and associated documentation files (the "Software"), to deal
  12580. * in the Software without restriction, including without limitation the rights
  12581. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  12582. * copies of the Software, and to permit persons to whom the Software is
  12583. * furnished to do so, subject to the following conditions:
  12584. *
  12585. * The above copyright notice and this permission notice shall be included in
  12586. * all copies or substantial portions of the Software.
  12587. *
  12588. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  12589. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  12590. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  12591. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  12592. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  12593. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  12594. * THE SOFTWARE.
  12595. */
  12596. /** @enum {string} */
  12597. var cssClasses = {
  12598. LABEL_FLOAT_ABOVE: 'mdc-floating-label--float-above',
  12599. LABEL_SHAKE: 'mdc-floating-label--shake'
  12600. };
  12601. /***/ }),
  12602. /* 89 */
  12603. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12604. "use strict";
  12605. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  12606. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCFormField", function() { return MDCFormField; });
  12607. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  12608. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(90);
  12609. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_selection_control_index__ = __webpack_require__(4);
  12610. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCFormFieldFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__foundation__["a"]; });
  12611. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  12612. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  12613. 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; }
  12614. 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; }
  12615. /**
  12616. * @license
  12617. * Copyright 2017 Google Inc.
  12618. *
  12619. * Permission is hereby granted, free of charge, to any person obtaining a copy
  12620. * of this software and associated documentation files (the "Software"), to deal
  12621. * in the Software without restriction, including without limitation the rights
  12622. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  12623. * copies of the Software, and to permit persons to whom the Software is
  12624. * furnished to do so, subject to the following conditions:
  12625. *
  12626. * The above copyright notice and this permission notice shall be included in
  12627. * all copies or substantial portions of the Software.
  12628. *
  12629. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  12630. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  12631. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  12632. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  12633. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  12634. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  12635. * THE SOFTWARE.
  12636. */
  12637. /* eslint-disable no-unused-vars */
  12638. /* eslint-enable no-unused-vars */
  12639. /**
  12640. * @extends MDCComponent<!MDCFormFieldFoundation>
  12641. */
  12642. var MDCFormField = function (_MDCComponent) {
  12643. _inherits(MDCFormField, _MDCComponent);
  12644. _createClass(MDCFormField, [{
  12645. key: 'input',
  12646. /** @param {?MDCSelectionControl} input */
  12647. set: function set(input) {
  12648. this.input_ = input;
  12649. }
  12650. /** @return {?MDCSelectionControl} */
  12651. ,
  12652. get: function get() {
  12653. return this.input_;
  12654. }
  12655. }], [{
  12656. key: 'attachTo',
  12657. value: function attachTo(root) {
  12658. return new MDCFormField(root);
  12659. }
  12660. }]);
  12661. function MDCFormField() {
  12662. var _ref;
  12663. _classCallCheck(this, MDCFormField);
  12664. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  12665. args[_key] = arguments[_key];
  12666. }
  12667. /** @private {?MDCSelectionControl} */
  12668. var _this = _possibleConstructorReturn(this, (_ref = MDCFormField.__proto__ || Object.getPrototypeOf(MDCFormField)).call.apply(_ref, [this].concat(args)));
  12669. _this.input_;
  12670. return _this;
  12671. }
  12672. /**
  12673. * @return {!Element}
  12674. * @private
  12675. */
  12676. _createClass(MDCFormField, [{
  12677. key: 'getDefaultFoundation',
  12678. /** @return {!MDCFormFieldFoundation} */
  12679. value: function getDefaultFoundation() {
  12680. var _this2 = this;
  12681. return new __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]({
  12682. registerInteractionHandler: function registerInteractionHandler(type, handler) {
  12683. return _this2.label_.addEventListener(type, handler);
  12684. },
  12685. deregisterInteractionHandler: function deregisterInteractionHandler(type, handler) {
  12686. return _this2.label_.removeEventListener(type, handler);
  12687. },
  12688. activateInputRipple: function activateInputRipple() {
  12689. if (_this2.input_ && _this2.input_.ripple) {
  12690. _this2.input_.ripple.activate();
  12691. }
  12692. },
  12693. deactivateInputRipple: function deactivateInputRipple() {
  12694. if (_this2.input_ && _this2.input_.ripple) {
  12695. _this2.input_.ripple.deactivate();
  12696. }
  12697. }
  12698. });
  12699. }
  12700. }, {
  12701. key: 'label_',
  12702. get: function get() {
  12703. var LABEL_SELECTOR = __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.LABEL_SELECTOR;
  12704. return (/** @type {!Element} */this.root_.querySelector(LABEL_SELECTOR)
  12705. );
  12706. }
  12707. }]);
  12708. return MDCFormField;
  12709. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  12710. /***/ }),
  12711. /* 90 */
  12712. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12713. "use strict";
  12714. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  12715. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(91);
  12716. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(92);
  12717. 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; };
  12718. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  12719. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  12720. 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; }
  12721. 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; }
  12722. /**
  12723. * @license
  12724. * Copyright 2017 Google Inc.
  12725. *
  12726. * Permission is hereby granted, free of charge, to any person obtaining a copy
  12727. * of this software and associated documentation files (the "Software"), to deal
  12728. * in the Software without restriction, including without limitation the rights
  12729. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  12730. * copies of the Software, and to permit persons to whom the Software is
  12731. * furnished to do so, subject to the following conditions:
  12732. *
  12733. * The above copyright notice and this permission notice shall be included in
  12734. * all copies or substantial portions of the Software.
  12735. *
  12736. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  12737. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  12738. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  12739. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  12740. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  12741. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  12742. * THE SOFTWARE.
  12743. */
  12744. /**
  12745. * @extends {MDCFoundation<!MDCFormFieldAdapter>}
  12746. */
  12747. var MDCFormFieldFoundation = function (_MDCFoundation) {
  12748. _inherits(MDCFormFieldFoundation, _MDCFoundation);
  12749. _createClass(MDCFormFieldFoundation, null, [{
  12750. key: 'cssClasses',
  12751. /** @return enum {cssClasses} */
  12752. get: function get() {
  12753. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  12754. }
  12755. /** @return enum {strings} */
  12756. }, {
  12757. key: 'strings',
  12758. get: function get() {
  12759. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  12760. }
  12761. /** @return {!MDCFormFieldAdapter} */
  12762. }, {
  12763. key: 'defaultAdapter',
  12764. get: function get() {
  12765. return {
  12766. registerInteractionHandler: function registerInteractionHandler() /* type: string, handler: EventListener */{},
  12767. deregisterInteractionHandler: function deregisterInteractionHandler() /* type: string, handler: EventListener */{},
  12768. activateInputRipple: function activateInputRipple() {},
  12769. deactivateInputRipple: function deactivateInputRipple() {}
  12770. };
  12771. }
  12772. }]);
  12773. function MDCFormFieldFoundation(adapter) {
  12774. _classCallCheck(this, MDCFormFieldFoundation);
  12775. /** @private {!EventListener} */
  12776. var _this = _possibleConstructorReturn(this, (MDCFormFieldFoundation.__proto__ || Object.getPrototypeOf(MDCFormFieldFoundation)).call(this, _extends(MDCFormFieldFoundation.defaultAdapter, adapter)));
  12777. _this.clickHandler_ = /** @type {!EventListener} */function () {
  12778. return _this.handleClick_();
  12779. };
  12780. return _this;
  12781. }
  12782. _createClass(MDCFormFieldFoundation, [{
  12783. key: 'init',
  12784. value: function init() {
  12785. this.adapter_.registerInteractionHandler('click', this.clickHandler_);
  12786. }
  12787. }, {
  12788. key: 'destroy',
  12789. value: function destroy() {
  12790. this.adapter_.deregisterInteractionHandler('click', this.clickHandler_);
  12791. }
  12792. /** @private */
  12793. }, {
  12794. key: 'handleClick_',
  12795. value: function handleClick_() {
  12796. var _this2 = this;
  12797. this.adapter_.activateInputRipple();
  12798. requestAnimationFrame(function () {
  12799. return _this2.adapter_.deactivateInputRipple();
  12800. });
  12801. }
  12802. }]);
  12803. return MDCFormFieldFoundation;
  12804. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  12805. /* harmony default export */ __webpack_exports__["a"] = (MDCFormFieldFoundation);
  12806. /***/ }),
  12807. /* 91 */
  12808. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12809. "use strict";
  12810. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  12811. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  12812. /**
  12813. * @license
  12814. * Copyright 2016 Google Inc.
  12815. *
  12816. * Permission is hereby granted, free of charge, to any person obtaining a copy
  12817. * of this software and associated documentation files (the "Software"), to deal
  12818. * in the Software without restriction, including without limitation the rights
  12819. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  12820. * copies of the Software, and to permit persons to whom the Software is
  12821. * furnished to do so, subject to the following conditions:
  12822. *
  12823. * The above copyright notice and this permission notice shall be included in
  12824. * all copies or substantial portions of the Software.
  12825. *
  12826. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  12827. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  12828. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  12829. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  12830. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  12831. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  12832. * THE SOFTWARE.
  12833. */
  12834. /* eslint no-unused-vars: [2, {"args": "none"}] */
  12835. /**
  12836. * Adapter for MDC Form Field. Provides an interface for managing
  12837. * - event handlers
  12838. * - ripple activation
  12839. *
  12840. * Additionally, provides type information for the adapter to the Closure
  12841. * compiler.
  12842. *
  12843. * Implement this adapter for your framework of choice to delegate updates to
  12844. * the component in your framework of choice. See architecture documentation
  12845. * for more details.
  12846. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  12847. *
  12848. * @record
  12849. */
  12850. var MDCFormFieldAdapter = function () {
  12851. function MDCFormFieldAdapter() {
  12852. _classCallCheck(this, MDCFormFieldAdapter);
  12853. }
  12854. _createClass(MDCFormFieldAdapter, [{
  12855. key: "registerInteractionHandler",
  12856. /**
  12857. * @param {string} type
  12858. * @param {!EventListener} handler
  12859. */
  12860. value: function registerInteractionHandler(type, handler) {}
  12861. /**
  12862. * @param {string} type
  12863. * @param {!EventListener} handler
  12864. */
  12865. }, {
  12866. key: "deregisterInteractionHandler",
  12867. value: function deregisterInteractionHandler(type, handler) {}
  12868. }, {
  12869. key: "activateInputRipple",
  12870. value: function activateInputRipple() {}
  12871. }, {
  12872. key: "deactivateInputRipple",
  12873. value: function deactivateInputRipple() {}
  12874. }]);
  12875. return MDCFormFieldAdapter;
  12876. }();
  12877. /* unused harmony default export */ var _unused_webpack_default_export = (MDCFormFieldAdapter);
  12878. /***/ }),
  12879. /* 92 */
  12880. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12881. "use strict";
  12882. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  12883. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  12884. /**
  12885. * @license
  12886. * Copyright 2017 Google Inc.
  12887. *
  12888. * Permission is hereby granted, free of charge, to any person obtaining a copy
  12889. * of this software and associated documentation files (the "Software"), to deal
  12890. * in the Software without restriction, including without limitation the rights
  12891. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  12892. * copies of the Software, and to permit persons to whom the Software is
  12893. * furnished to do so, subject to the following conditions:
  12894. *
  12895. * The above copyright notice and this permission notice shall be included in
  12896. * all copies or substantial portions of the Software.
  12897. *
  12898. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  12899. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  12900. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  12901. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  12902. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  12903. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  12904. * THE SOFTWARE.
  12905. */
  12906. /** @enum {string} */
  12907. var cssClasses = {
  12908. ROOT: 'mdc-form-field'
  12909. };
  12910. /** @enum {string} */
  12911. var strings = {
  12912. LABEL_SELECTOR: '.mdc-form-field > label'
  12913. };
  12914. /***/ }),
  12915. /* 93 */
  12916. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12917. "use strict";
  12918. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  12919. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCGridList", function() { return MDCGridList; });
  12920. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_index__ = __webpack_require__(3);
  12921. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(94);
  12922. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCGridListFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__foundation__["a"]; });
  12923. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  12924. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  12925. 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; }
  12926. 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; }
  12927. /**
  12928. * @license
  12929. * Copyright 2016 Google Inc.
  12930. *
  12931. * Permission is hereby granted, free of charge, to any person obtaining a copy
  12932. * of this software and associated documentation files (the "Software"), to deal
  12933. * in the Software without restriction, including without limitation the rights
  12934. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  12935. * copies of the Software, and to permit persons to whom the Software is
  12936. * furnished to do so, subject to the following conditions:
  12937. *
  12938. * The above copyright notice and this permission notice shall be included in
  12939. * all copies or substantial portions of the Software.
  12940. *
  12941. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  12942. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  12943. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  12944. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  12945. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  12946. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  12947. * THE SOFTWARE.
  12948. */
  12949. var MDCGridList = function (_MDCComponent) {
  12950. _inherits(MDCGridList, _MDCComponent);
  12951. function MDCGridList() {
  12952. _classCallCheck(this, MDCGridList);
  12953. return _possibleConstructorReturn(this, (MDCGridList.__proto__ || Object.getPrototypeOf(MDCGridList)).apply(this, arguments));
  12954. }
  12955. _createClass(MDCGridList, [{
  12956. key: 'getDefaultFoundation',
  12957. value: function getDefaultFoundation() {
  12958. var _this2 = this;
  12959. return new __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]({
  12960. getOffsetWidth: function getOffsetWidth() {
  12961. return _this2.root_.offsetWidth;
  12962. },
  12963. getNumberOfTiles: function getNumberOfTiles() {
  12964. return _this2.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.TILE_SELECTOR).length;
  12965. },
  12966. getOffsetWidthForTileAtIndex: function getOffsetWidthForTileAtIndex(index) {
  12967. return _this2.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.TILE_SELECTOR)[index].offsetWidth;
  12968. },
  12969. setStyleForTilesElement: function setStyleForTilesElement(property, value) {
  12970. _this2.root_.querySelector(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.TILES_SELECTOR).style[property] = value;
  12971. },
  12972. registerResizeHandler: function registerResizeHandler(handler) {
  12973. return window.addEventListener('resize', handler);
  12974. },
  12975. deregisterResizeHandler: function deregisterResizeHandler(handler) {
  12976. return window.removeEventListener('resize', handler);
  12977. }
  12978. });
  12979. }
  12980. }], [{
  12981. key: 'attachTo',
  12982. value: function attachTo(root) {
  12983. return new MDCGridList(root);
  12984. }
  12985. }]);
  12986. return MDCGridList;
  12987. }(__WEBPACK_IMPORTED_MODULE_0__material_base_index__["MDCComponent"]);
  12988. /***/ }),
  12989. /* 94 */
  12990. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12991. "use strict";
  12992. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_index__ = __webpack_require__(3);
  12993. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(95);
  12994. 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; };
  12995. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  12996. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  12997. 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; }
  12998. 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; }
  12999. /**
  13000. * @license
  13001. * Copyright 2016 Google Inc.
  13002. *
  13003. * Permission is hereby granted, free of charge, to any person obtaining a copy
  13004. * of this software and associated documentation files (the "Software"), to deal
  13005. * in the Software without restriction, including without limitation the rights
  13006. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  13007. * copies of the Software, and to permit persons to whom the Software is
  13008. * furnished to do so, subject to the following conditions:
  13009. *
  13010. * The above copyright notice and this permission notice shall be included in
  13011. * all copies or substantial portions of the Software.
  13012. *
  13013. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13014. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  13015. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  13016. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  13017. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  13018. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  13019. * THE SOFTWARE.
  13020. */
  13021. var MDCGridListFoundation = function (_MDCFoundation) {
  13022. _inherits(MDCGridListFoundation, _MDCFoundation);
  13023. _createClass(MDCGridListFoundation, null, [{
  13024. key: 'strings',
  13025. get: function get() {
  13026. return __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* strings */];
  13027. }
  13028. }, {
  13029. key: 'defaultAdapter',
  13030. get: function get() {
  13031. return {
  13032. getOffsetWidth: function getOffsetWidth() {
  13033. return (/* number */0
  13034. );
  13035. },
  13036. getNumberOfTiles: function getNumberOfTiles() {
  13037. return (/* number */0
  13038. );
  13039. },
  13040. getOffsetWidthForTileAtIndex: function getOffsetWidthForTileAtIndex() {
  13041. return (/* index: number */ /* number */0
  13042. );
  13043. },
  13044. setStyleForTilesElement: function setStyleForTilesElement() /* property: string, value: string */{},
  13045. registerResizeHandler: function registerResizeHandler() /* handler: EventListener */{},
  13046. deregisterResizeHandler: function deregisterResizeHandler() /* handler: EventListener */{}
  13047. };
  13048. }
  13049. }]);
  13050. function MDCGridListFoundation(adapter) {
  13051. _classCallCheck(this, MDCGridListFoundation);
  13052. var _this = _possibleConstructorReturn(this, (MDCGridListFoundation.__proto__ || Object.getPrototypeOf(MDCGridListFoundation)).call(this, _extends(MDCGridListFoundation.defaultAdapter, adapter)));
  13053. _this.resizeHandler_ = function () {
  13054. return _this.alignCenter();
  13055. };
  13056. _this.resizeFrame_ = 0;
  13057. return _this;
  13058. }
  13059. _createClass(MDCGridListFoundation, [{
  13060. key: 'init',
  13061. value: function init() {
  13062. this.alignCenter();
  13063. this.adapter_.registerResizeHandler(this.resizeHandler_);
  13064. }
  13065. }, {
  13066. key: 'destroy',
  13067. value: function destroy() {
  13068. this.adapter_.deregisterResizeHandler(this.resizeHandler_);
  13069. }
  13070. }, {
  13071. key: 'alignCenter',
  13072. value: function alignCenter() {
  13073. var _this2 = this;
  13074. if (this.resizeFrame_ !== 0) {
  13075. cancelAnimationFrame(this.resizeFrame_);
  13076. }
  13077. this.resizeFrame_ = requestAnimationFrame(function () {
  13078. _this2.alignCenter_();
  13079. _this2.resizeFrame_ = 0;
  13080. });
  13081. }
  13082. }, {
  13083. key: 'alignCenter_',
  13084. value: function alignCenter_() {
  13085. if (this.adapter_.getNumberOfTiles() == 0) {
  13086. return;
  13087. }
  13088. var gridWidth = this.adapter_.getOffsetWidth();
  13089. var itemWidth = this.adapter_.getOffsetWidthForTileAtIndex(0);
  13090. var tilesWidth = itemWidth * Math.floor(gridWidth / itemWidth);
  13091. this.adapter_.setStyleForTilesElement('width', tilesWidth + 'px');
  13092. }
  13093. }]);
  13094. return MDCGridListFoundation;
  13095. }(__WEBPACK_IMPORTED_MODULE_0__material_base_index__["MDCFoundation"]);
  13096. /* harmony default export */ __webpack_exports__["a"] = (MDCGridListFoundation);
  13097. /***/ }),
  13098. /* 95 */
  13099. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13100. "use strict";
  13101. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return strings; });
  13102. /**
  13103. * @license
  13104. * Copyright 2016 Google Inc.
  13105. *
  13106. * Permission is hereby granted, free of charge, to any person obtaining a copy
  13107. * of this software and associated documentation files (the "Software"), to deal
  13108. * in the Software without restriction, including without limitation the rights
  13109. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  13110. * copies of the Software, and to permit persons to whom the Software is
  13111. * furnished to do so, subject to the following conditions:
  13112. *
  13113. * The above copyright notice and this permission notice shall be included in
  13114. * all copies or substantial portions of the Software.
  13115. *
  13116. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13117. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  13118. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  13119. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  13120. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  13121. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  13122. * THE SOFTWARE.
  13123. */
  13124. var strings = {
  13125. TILES_SELECTOR: '.mdc-grid-list__tiles',
  13126. TILE_SELECTOR: '.mdc-grid-tile'
  13127. };
  13128. /***/ }),
  13129. /* 96 */
  13130. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13131. "use strict";
  13132. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  13133. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCIconButtonToggle", function() { return MDCIconButtonToggle; });
  13134. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  13135. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(97);
  13136. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_ripple_index__ = __webpack_require__(2);
  13137. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCIconButtonToggleFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__foundation__["a"]; });
  13138. 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); } };
  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 2018 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 {MDCComponent<!MDCIconButtonToggleFoundation>}
  13167. */
  13168. var MDCIconButtonToggle = function (_MDCComponent) {
  13169. _inherits(MDCIconButtonToggle, _MDCComponent);
  13170. _createClass(MDCIconButtonToggle, null, [{
  13171. key: 'attachTo',
  13172. value: function attachTo(root) {
  13173. return new MDCIconButtonToggle(root);
  13174. }
  13175. }]);
  13176. function MDCIconButtonToggle() {
  13177. var _ref;
  13178. _classCallCheck(this, MDCIconButtonToggle);
  13179. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  13180. args[_key] = arguments[_key];
  13181. }
  13182. /** @private {!MDCRipple} */
  13183. var _this = _possibleConstructorReturn(this, (_ref = MDCIconButtonToggle.__proto__ || Object.getPrototypeOf(MDCIconButtonToggle)).call.apply(_ref, [this].concat(args)));
  13184. _this.ripple_ = _this.initRipple_();
  13185. /** @private {!Function} */
  13186. _this.handleClick_;
  13187. return _this;
  13188. }
  13189. /**
  13190. * @return {!MDCRipple}
  13191. * @private
  13192. */
  13193. _createClass(MDCIconButtonToggle, [{
  13194. key: 'initRipple_',
  13195. value: function initRipple_() {
  13196. var ripple = new __WEBPACK_IMPORTED_MODULE_2__material_ripple_index__["MDCRipple"](this.root_);
  13197. ripple.unbounded = true;
  13198. return ripple;
  13199. }
  13200. }, {
  13201. key: 'destroy',
  13202. value: function destroy() {
  13203. this.root_.removeEventListener('click', this.handleClick_);
  13204. this.ripple_.destroy();
  13205. _get(MDCIconButtonToggle.prototype.__proto__ || Object.getPrototypeOf(MDCIconButtonToggle.prototype), 'destroy', this).call(this);
  13206. }
  13207. /** @return {!MDCIconButtonToggleFoundation} */
  13208. }, {
  13209. key: 'getDefaultFoundation',
  13210. value: function getDefaultFoundation() {
  13211. var _this2 = this;
  13212. return new __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]({
  13213. addClass: function addClass(className) {
  13214. return _this2.root_.classList.add(className);
  13215. },
  13216. removeClass: function removeClass(className) {
  13217. return _this2.root_.classList.remove(className);
  13218. },
  13219. hasClass: function hasClass(className) {
  13220. return _this2.root_.classList.contains(className);
  13221. },
  13222. setAttr: function setAttr(attrName, attrValue) {
  13223. return _this2.root_.setAttribute(attrName, attrValue);
  13224. },
  13225. notifyChange: function notifyChange(evtData) {
  13226. return _this2.emit(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.CHANGE_EVENT, evtData);
  13227. }
  13228. });
  13229. }
  13230. }, {
  13231. key: 'initialSyncWithDOM',
  13232. value: function initialSyncWithDOM() {
  13233. this.handleClick_ = this.foundation_.handleClick.bind(this.foundation_);
  13234. this.root_.addEventListener('click', this.handleClick_);
  13235. }
  13236. /** @return {!MDCRipple} */
  13237. }, {
  13238. key: 'ripple',
  13239. get: function get() {
  13240. return this.ripple_;
  13241. }
  13242. /** @return {boolean} */
  13243. }, {
  13244. key: 'on',
  13245. get: function get() {
  13246. return this.foundation_.isOn();
  13247. }
  13248. /** @param {boolean} isOn */
  13249. ,
  13250. set: function set(isOn) {
  13251. this.foundation_.toggle(isOn);
  13252. }
  13253. }]);
  13254. return MDCIconButtonToggle;
  13255. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  13256. /***/ }),
  13257. /* 97 */
  13258. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13259. "use strict";
  13260. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  13261. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(98);
  13262. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(99);
  13263. 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; };
  13264. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  13265. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13266. 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; }
  13267. 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; }
  13268. /**
  13269. * @license
  13270. * Copyright 2018 Google Inc.
  13271. *
  13272. * Permission is hereby granted, free of charge, to any person obtaining a copy
  13273. * of this software and associated documentation files (the "Software"), to deal
  13274. * in the Software without restriction, including without limitation the rights
  13275. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  13276. * copies of the Software, and to permit persons to whom the Software is
  13277. * furnished to do so, subject to the following conditions:
  13278. *
  13279. * The above copyright notice and this permission notice shall be included in
  13280. * all copies or substantial portions of the Software.
  13281. *
  13282. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13283. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  13284. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  13285. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  13286. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  13287. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  13288. * THE SOFTWARE.
  13289. */
  13290. /* eslint-disable no-unused-vars */
  13291. /**
  13292. * @extends {MDCFoundation<!MDCIconButtonToggleAdapter>}
  13293. */
  13294. var MDCIconButtonToggleFoundation = function (_MDCFoundation) {
  13295. _inherits(MDCIconButtonToggleFoundation, _MDCFoundation);
  13296. _createClass(MDCIconButtonToggleFoundation, null, [{
  13297. key: 'cssClasses',
  13298. get: function get() {
  13299. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  13300. }
  13301. }, {
  13302. key: 'strings',
  13303. get: function get() {
  13304. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  13305. }
  13306. }, {
  13307. key: 'defaultAdapter',
  13308. get: function get() {
  13309. return {
  13310. addClass: function addClass() {},
  13311. removeClass: function removeClass() {},
  13312. hasClass: function hasClass() {},
  13313. setAttr: function setAttr() {},
  13314. notifyChange: function notifyChange() {}
  13315. };
  13316. }
  13317. }]);
  13318. function MDCIconButtonToggleFoundation(adapter) {
  13319. _classCallCheck(this, MDCIconButtonToggleFoundation);
  13320. /** @private {boolean} */
  13321. var _this = _possibleConstructorReturn(this, (MDCIconButtonToggleFoundation.__proto__ || Object.getPrototypeOf(MDCIconButtonToggleFoundation)).call(this, _extends(MDCIconButtonToggleFoundation.defaultAdapter, adapter)));
  13322. _this.disabled_ = false;
  13323. return _this;
  13324. }
  13325. _createClass(MDCIconButtonToggleFoundation, [{
  13326. key: 'init',
  13327. value: function init() {
  13328. this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_PRESSED, '' + this.isOn());
  13329. }
  13330. }, {
  13331. key: 'handleClick',
  13332. value: function handleClick() {
  13333. this.toggle();
  13334. this.adapter_.notifyChange( /** @type {!IconButtonToggleEvent} */{ isOn: this.isOn() });
  13335. }
  13336. /** @return {boolean} */
  13337. }, {
  13338. key: 'isOn',
  13339. value: function isOn() {
  13340. return this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ICON_BUTTON_ON);
  13341. }
  13342. /** @param {boolean=} isOn */
  13343. }, {
  13344. key: 'toggle',
  13345. value: function toggle() {
  13346. var isOn = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !this.isOn();
  13347. if (isOn) {
  13348. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ICON_BUTTON_ON);
  13349. } else {
  13350. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ICON_BUTTON_ON);
  13351. }
  13352. this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_PRESSED, '' + isOn);
  13353. }
  13354. }]);
  13355. return MDCIconButtonToggleFoundation;
  13356. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  13357. /** @record */
  13358. var IconButtonToggleState = function IconButtonToggleState() {
  13359. _classCallCheck(this, IconButtonToggleState);
  13360. };
  13361. /* harmony default export */ __webpack_exports__["a"] = (MDCIconButtonToggleFoundation);
  13362. /***/ }),
  13363. /* 98 */
  13364. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13365. "use strict";
  13366. /* unused harmony export MDCIconButtonToggleAdapter */
  13367. /* unused harmony export IconButtonToggleEvent */
  13368. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  13369. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13370. /**
  13371. * @license
  13372. * Copyright 2018 Google Inc.
  13373. *
  13374. * Permission is hereby granted, free of charge, to any person obtaining a copy
  13375. * of this software and associated documentation files (the "Software"), to deal
  13376. * in the Software without restriction, including without limitation the rights
  13377. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  13378. * copies of the Software, and to permit persons to whom the Software is
  13379. * furnished to do so, subject to the following conditions:
  13380. *
  13381. * The above copyright notice and this permission notice shall be included in
  13382. * all copies or substantial portions of the Software.
  13383. *
  13384. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13385. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  13386. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  13387. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  13388. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  13389. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  13390. * THE SOFTWARE.
  13391. */
  13392. /* eslint no-unused-vars: [2, {"args": "none"}] */
  13393. /**
  13394. * Adapter for MDC Icon Button Toggle. Provides an interface for managing
  13395. * - classes
  13396. * - dom
  13397. * - inner text
  13398. * - event handlers
  13399. * - event dispatch
  13400. *
  13401. * Additionally, provides type information for the adapter to the Closure
  13402. * compiler.
  13403. *
  13404. * Implement this adapter for your framework of choice to delegate updates to
  13405. * the component in your framework of choice. See architecture documentation
  13406. * for more details.
  13407. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  13408. *
  13409. * @record
  13410. */
  13411. var MDCIconButtonToggleAdapter = function () {
  13412. function MDCIconButtonToggleAdapter() {
  13413. _classCallCheck(this, MDCIconButtonToggleAdapter);
  13414. }
  13415. _createClass(MDCIconButtonToggleAdapter, [{
  13416. key: "addClass",
  13417. /** @param {string} className */
  13418. value: function addClass(className) {}
  13419. /** @param {string} className */
  13420. }, {
  13421. key: "removeClass",
  13422. value: function removeClass(className) {}
  13423. /**
  13424. * @param {string} className
  13425. * @return {boolean}
  13426. * */
  13427. }, {
  13428. key: "hasClass",
  13429. value: function hasClass(className) {}
  13430. /**
  13431. * @param {string} attrName
  13432. * @param {string} attrValue
  13433. */
  13434. }, {
  13435. key: "setAttr",
  13436. value: function setAttr(attrName, attrValue) {}
  13437. /** @param {!IconButtonToggleEvent} evtData */
  13438. }, {
  13439. key: "notifyChange",
  13440. value: function notifyChange(evtData) {}
  13441. }]);
  13442. return MDCIconButtonToggleAdapter;
  13443. }();
  13444. /**
  13445. * @typedef {{
  13446. * isOn: boolean,
  13447. * }}
  13448. */
  13449. var IconButtonToggleEvent = void 0;
  13450. /***/ }),
  13451. /* 99 */
  13452. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13453. "use strict";
  13454. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  13455. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  13456. /**
  13457. * @license
  13458. * Copyright 2018 Google Inc.
  13459. *
  13460. * Permission is hereby granted, free of charge, to any person obtaining a copy
  13461. * of this software and associated documentation files (the "Software"), to deal
  13462. * in the Software without restriction, including without limitation the rights
  13463. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  13464. * copies of the Software, and to permit persons to whom the Software is
  13465. * furnished to do so, subject to the following conditions:
  13466. *
  13467. * The above copyright notice and this permission notice shall be included in
  13468. * all copies or substantial portions of the Software.
  13469. *
  13470. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13471. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  13472. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  13473. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  13474. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  13475. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  13476. * THE SOFTWARE.
  13477. */
  13478. /** @enum {string} */
  13479. var cssClasses = {
  13480. ROOT: 'mdc-icon-button',
  13481. ICON_BUTTON_ON: 'mdc-icon-button--on'
  13482. };
  13483. /** @enum {string} */
  13484. var strings = {
  13485. ARIA_PRESSED: 'aria-pressed',
  13486. CHANGE_EVENT: 'MDCIconButtonToggle:change'
  13487. };
  13488. /***/ }),
  13489. /* 100 */
  13490. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13491. "use strict";
  13492. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  13493. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCIconToggle", function() { return MDCIconToggle; });
  13494. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  13495. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(101);
  13496. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_ripple_index__ = __webpack_require__(2);
  13497. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCIconToggleFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__foundation__["a"]; });
  13498. 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; };
  13499. 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); } };
  13500. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  13501. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13502. 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; }
  13503. 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; }
  13504. /**
  13505. * @license
  13506. * Copyright 2016 Google Inc.
  13507. *
  13508. * Permission is hereby granted, free of charge, to any person obtaining a copy
  13509. * of this software and associated documentation files (the "Software"), to deal
  13510. * in the Software without restriction, including without limitation the rights
  13511. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  13512. * copies of the Software, and to permit persons to whom the Software is
  13513. * furnished to do so, subject to the following conditions:
  13514. *
  13515. * The above copyright notice and this permission notice shall be included in
  13516. * all copies or substantial portions of the Software.
  13517. *
  13518. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13519. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  13520. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  13521. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  13522. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  13523. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  13524. * THE SOFTWARE.
  13525. */
  13526. /**
  13527. * @extends {MDCComponent<!MDCIconToggleFoundation>}
  13528. */
  13529. var MDCIconToggle = function (_MDCComponent) {
  13530. _inherits(MDCIconToggle, _MDCComponent);
  13531. _createClass(MDCIconToggle, null, [{
  13532. key: 'attachTo',
  13533. value: function attachTo(root) {
  13534. return new MDCIconToggle(root);
  13535. }
  13536. }]);
  13537. function MDCIconToggle() {
  13538. var _ref;
  13539. _classCallCheck(this, MDCIconToggle);
  13540. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  13541. args[_key] = arguments[_key];
  13542. }
  13543. /** @private {!MDCRipple} */
  13544. var _this = _possibleConstructorReturn(this, (_ref = MDCIconToggle.__proto__ || Object.getPrototypeOf(MDCIconToggle)).call.apply(_ref, [this].concat(args)));
  13545. _this.ripple_ = _this.initRipple_();
  13546. return _this;
  13547. }
  13548. /** @return {!Element} */
  13549. _createClass(MDCIconToggle, [{
  13550. key: 'initRipple_',
  13551. /**
  13552. * @return {!MDCRipple}
  13553. * @private
  13554. */
  13555. value: function initRipple_() {
  13556. var _this2 = this;
  13557. var adapter = _extends(__WEBPACK_IMPORTED_MODULE_2__material_ripple_index__["MDCRipple"].createAdapter(this), {
  13558. isUnbounded: function isUnbounded() {
  13559. return true;
  13560. },
  13561. isSurfaceActive: function isSurfaceActive() {
  13562. return _this2.foundation_.isKeyboardActivated();
  13563. }
  13564. });
  13565. var foundation = new __WEBPACK_IMPORTED_MODULE_2__material_ripple_index__["MDCRippleFoundation"](adapter);
  13566. return new __WEBPACK_IMPORTED_MODULE_2__material_ripple_index__["MDCRipple"](this.root_, foundation);
  13567. }
  13568. }, {
  13569. key: 'destroy',
  13570. value: function destroy() {
  13571. this.ripple_.destroy();
  13572. _get(MDCIconToggle.prototype.__proto__ || Object.getPrototypeOf(MDCIconToggle.prototype), 'destroy', this).call(this);
  13573. }
  13574. /** @return {!MDCIconToggleFoundation} */
  13575. }, {
  13576. key: 'getDefaultFoundation',
  13577. value: function getDefaultFoundation() {
  13578. var _this3 = this;
  13579. return new __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]({
  13580. addClass: function addClass(className) {
  13581. return _this3.iconEl_.classList.add(className);
  13582. },
  13583. removeClass: function removeClass(className) {
  13584. return _this3.iconEl_.classList.remove(className);
  13585. },
  13586. registerInteractionHandler: function registerInteractionHandler(type, handler) {
  13587. return _this3.root_.addEventListener(type, handler);
  13588. },
  13589. deregisterInteractionHandler: function deregisterInteractionHandler(type, handler) {
  13590. return _this3.root_.removeEventListener(type, handler);
  13591. },
  13592. setText: function setText(text) {
  13593. return _this3.iconEl_.textContent = text;
  13594. },
  13595. getTabIndex: function getTabIndex() {
  13596. return (/* number */_this3.root_.tabIndex
  13597. );
  13598. },
  13599. setTabIndex: function setTabIndex(tabIndex) {
  13600. return _this3.root_.tabIndex = tabIndex;
  13601. },
  13602. getAttr: function getAttr(name, value) {
  13603. return _this3.root_.getAttribute(name, value);
  13604. },
  13605. setAttr: function setAttr(name, value) {
  13606. return _this3.root_.setAttribute(name, value);
  13607. },
  13608. rmAttr: function rmAttr(name) {
  13609. return _this3.root_.removeAttribute(name);
  13610. },
  13611. notifyChange: function notifyChange(evtData) {
  13612. return _this3.emit(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.CHANGE_EVENT, evtData);
  13613. }
  13614. });
  13615. }
  13616. }, {
  13617. key: 'initialSyncWithDOM',
  13618. value: function initialSyncWithDOM() {
  13619. this.on = this.root_.getAttribute(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.ARIA_PRESSED) === 'true';
  13620. this.disabled = this.root_.getAttribute(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.ARIA_DISABLED) === 'true';
  13621. }
  13622. /** @return {!MDCRipple} */
  13623. }, {
  13624. key: 'refreshToggleData',
  13625. value: function refreshToggleData() {
  13626. this.foundation_.refreshToggleData();
  13627. }
  13628. }, {
  13629. key: 'iconEl_',
  13630. get: function get() {
  13631. var sel = this.root_.dataset['iconInnerSelector'];
  13632. return sel ?
  13633. /** @type {!Element} */this.root_.querySelector(sel) : this.root_;
  13634. }
  13635. }, {
  13636. key: 'ripple',
  13637. get: function get() {
  13638. return this.ripple_;
  13639. }
  13640. /** @return {boolean} */
  13641. }, {
  13642. key: 'on',
  13643. get: function get() {
  13644. return this.foundation_.isOn();
  13645. }
  13646. /** @param {boolean} isOn */
  13647. ,
  13648. set: function set(isOn) {
  13649. this.foundation_.toggle(isOn);
  13650. }
  13651. /** @return {boolean} */
  13652. }, {
  13653. key: 'disabled',
  13654. get: function get() {
  13655. return this.foundation_.isDisabled();
  13656. }
  13657. /** @param {boolean} isDisabled */
  13658. ,
  13659. set: function set(isDisabled) {
  13660. this.foundation_.setDisabled(isDisabled);
  13661. }
  13662. }]);
  13663. return MDCIconToggle;
  13664. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  13665. /***/ }),
  13666. /* 101 */
  13667. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13668. "use strict";
  13669. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  13670. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(102);
  13671. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(103);
  13672. 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; };
  13673. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  13674. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13675. 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; }
  13676. 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; }
  13677. /**
  13678. * @license
  13679. * Copyright 2016 Google Inc.
  13680. *
  13681. * Permission is hereby granted, free of charge, to any person obtaining a copy
  13682. * of this software and associated documentation files (the "Software"), to deal
  13683. * in the Software without restriction, including without limitation the rights
  13684. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  13685. * copies of the Software, and to permit persons to whom the Software is
  13686. * furnished to do so, subject to the following conditions:
  13687. *
  13688. * The above copyright notice and this permission notice shall be included in
  13689. * all copies or substantial portions of the Software.
  13690. *
  13691. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13692. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  13693. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  13694. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  13695. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  13696. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  13697. * THE SOFTWARE.
  13698. */
  13699. /* eslint-disable no-unused-vars */
  13700. /**
  13701. * @extends {MDCFoundation<!MDCIconToggleAdapter>}
  13702. */
  13703. var MDCIconToggleFoundation = function (_MDCFoundation) {
  13704. _inherits(MDCIconToggleFoundation, _MDCFoundation);
  13705. _createClass(MDCIconToggleFoundation, null, [{
  13706. key: 'cssClasses',
  13707. get: function get() {
  13708. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  13709. }
  13710. }, {
  13711. key: 'strings',
  13712. get: function get() {
  13713. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  13714. }
  13715. }, {
  13716. key: 'defaultAdapter',
  13717. get: function get() {
  13718. return {
  13719. addClass: function addClass() /* className: string */{},
  13720. removeClass: function removeClass() /* className: string */{},
  13721. registerInteractionHandler: function registerInteractionHandler() /* type: string, handler: EventListener */{},
  13722. deregisterInteractionHandler: function deregisterInteractionHandler() /* type: string, handler: EventListener */{},
  13723. setText: function setText() /* text: string */{},
  13724. getTabIndex: function getTabIndex() {
  13725. return (/* number */0
  13726. );
  13727. },
  13728. setTabIndex: function setTabIndex() /* tabIndex: number */{},
  13729. getAttr: function getAttr() {
  13730. return (/* name: string */ /* string */''
  13731. );
  13732. },
  13733. setAttr: function setAttr() /* name: string, value: string */{},
  13734. rmAttr: function rmAttr() /* name: string */{},
  13735. notifyChange: function notifyChange() /* evtData: IconToggleEvent */{}
  13736. };
  13737. }
  13738. }]);
  13739. function MDCIconToggleFoundation(adapter) {
  13740. _classCallCheck(this, MDCIconToggleFoundation);
  13741. /** @private {boolean} */
  13742. var _this = _possibleConstructorReturn(this, (MDCIconToggleFoundation.__proto__ || Object.getPrototypeOf(MDCIconToggleFoundation)).call(this, _extends(MDCIconToggleFoundation.defaultAdapter, adapter)));
  13743. _this.on_ = false;
  13744. /** @private {boolean} */
  13745. _this.disabled_ = false;
  13746. /** @private {number} */
  13747. _this.savedTabIndex_ = -1;
  13748. /** @private {?IconToggleState} */
  13749. _this.toggleOnData_ = null;
  13750. /** @private {?IconToggleState} */
  13751. _this.toggleOffData_ = null;
  13752. _this.clickHandler_ = /** @private {!EventListener} */function () {
  13753. return _this.toggleFromEvt_();
  13754. };
  13755. /** @private {boolean} */
  13756. _this.isHandlingKeydown_ = false;
  13757. _this.keydownHandler_ = /** @private {!EventListener} */function ( /** @type {!KeyboardKey} */evt) {
  13758. if (isSpace(evt)) {
  13759. _this.isHandlingKeydown_ = true;
  13760. return evt.preventDefault();
  13761. }
  13762. };
  13763. _this.keyupHandler_ = /** @private {!EventListener} */function ( /** @type {!KeyboardKey} */evt) {
  13764. if (isSpace(evt)) {
  13765. _this.isHandlingKeydown_ = false;
  13766. _this.toggleFromEvt_();
  13767. }
  13768. };
  13769. return _this;
  13770. }
  13771. _createClass(MDCIconToggleFoundation, [{
  13772. key: 'init',
  13773. value: function init() {
  13774. this.refreshToggleData();
  13775. this.savedTabIndex_ = this.adapter_.getTabIndex();
  13776. this.adapter_.registerInteractionHandler('click', this.clickHandler_);
  13777. this.adapter_.registerInteractionHandler('keydown', this.keydownHandler_);
  13778. this.adapter_.registerInteractionHandler('keyup', this.keyupHandler_);
  13779. }
  13780. }, {
  13781. key: 'refreshToggleData',
  13782. value: function refreshToggleData() {
  13783. var _MDCIconToggleFoundat = MDCIconToggleFoundation.strings,
  13784. DATA_TOGGLE_ON = _MDCIconToggleFoundat.DATA_TOGGLE_ON,
  13785. DATA_TOGGLE_OFF = _MDCIconToggleFoundat.DATA_TOGGLE_OFF;
  13786. this.toggleOnData_ = this.parseJsonDataAttr_(DATA_TOGGLE_ON);
  13787. this.toggleOffData_ = this.parseJsonDataAttr_(DATA_TOGGLE_OFF);
  13788. }
  13789. }, {
  13790. key: 'destroy',
  13791. value: function destroy() {
  13792. this.adapter_.deregisterInteractionHandler('click', this.clickHandler_);
  13793. this.adapter_.deregisterInteractionHandler('keydown', this.keydownHandler_);
  13794. this.adapter_.deregisterInteractionHandler('keyup', this.keyupHandler_);
  13795. }
  13796. /** @private */
  13797. }, {
  13798. key: 'toggleFromEvt_',
  13799. value: function toggleFromEvt_() {
  13800. this.toggle();
  13801. var isOn = this.on_;
  13802. this.adapter_.notifyChange( /** @type {!IconToggleEvent} */{ isOn: isOn });
  13803. }
  13804. /** @return {boolean} */
  13805. }, {
  13806. key: 'isOn',
  13807. value: function isOn() {
  13808. return this.on_;
  13809. }
  13810. /** @param {boolean=} isOn */
  13811. }, {
  13812. key: 'toggle',
  13813. value: function toggle() {
  13814. var isOn = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !this.on_;
  13815. this.on_ = isOn;
  13816. var _MDCIconToggleFoundat2 = MDCIconToggleFoundation.strings,
  13817. ARIA_LABEL = _MDCIconToggleFoundat2.ARIA_LABEL,
  13818. ARIA_PRESSED = _MDCIconToggleFoundat2.ARIA_PRESSED;
  13819. if (this.on_) {
  13820. this.adapter_.setAttr(ARIA_PRESSED, 'true');
  13821. } else {
  13822. this.adapter_.setAttr(ARIA_PRESSED, 'false');
  13823. }
  13824. var _ref = this.on_ ? this.toggleOffData_ : this.toggleOnData_,
  13825. classToRemove = _ref.cssClass;
  13826. if (classToRemove) {
  13827. this.adapter_.removeClass(classToRemove);
  13828. }
  13829. var _ref2 = this.on_ ? this.toggleOnData_ : this.toggleOffData_,
  13830. content = _ref2.content,
  13831. label = _ref2.label,
  13832. cssClass = _ref2.cssClass;
  13833. if (cssClass) {
  13834. this.adapter_.addClass(cssClass);
  13835. }
  13836. if (content) {
  13837. this.adapter_.setText(content);
  13838. }
  13839. if (label) {
  13840. this.adapter_.setAttr(ARIA_LABEL, label);
  13841. }
  13842. }
  13843. /**
  13844. * @param {string} dataAttr
  13845. * @return {!IconToggleState}
  13846. */
  13847. }, {
  13848. key: 'parseJsonDataAttr_',
  13849. value: function parseJsonDataAttr_(dataAttr) {
  13850. var val = this.adapter_.getAttr(dataAttr);
  13851. if (!val) {
  13852. return {};
  13853. }
  13854. return (/** @type {!IconToggleState} */JSON.parse(val)
  13855. );
  13856. }
  13857. /** @return {boolean} */
  13858. }, {
  13859. key: 'isDisabled',
  13860. value: function isDisabled() {
  13861. return this.disabled_;
  13862. }
  13863. /** @param {boolean} isDisabled */
  13864. }, {
  13865. key: 'setDisabled',
  13866. value: function setDisabled(isDisabled) {
  13867. this.disabled_ = isDisabled;
  13868. var DISABLED = MDCIconToggleFoundation.cssClasses.DISABLED;
  13869. var ARIA_DISABLED = MDCIconToggleFoundation.strings.ARIA_DISABLED;
  13870. if (this.disabled_) {
  13871. this.savedTabIndex_ = this.adapter_.getTabIndex();
  13872. this.adapter_.setTabIndex(-1);
  13873. this.adapter_.setAttr(ARIA_DISABLED, 'true');
  13874. this.adapter_.addClass(DISABLED);
  13875. } else {
  13876. this.adapter_.setTabIndex(this.savedTabIndex_);
  13877. this.adapter_.rmAttr(ARIA_DISABLED);
  13878. this.adapter_.removeClass(DISABLED);
  13879. }
  13880. }
  13881. /** @return {boolean} */
  13882. }, {
  13883. key: 'isKeyboardActivated',
  13884. value: function isKeyboardActivated() {
  13885. return this.isHandlingKeydown_;
  13886. }
  13887. }]);
  13888. return MDCIconToggleFoundation;
  13889. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  13890. /**
  13891. * @typedef {{
  13892. * key: string,
  13893. * keyCode: number
  13894. * }}
  13895. */
  13896. var KeyboardKey = void 0;
  13897. /**
  13898. * @param {!KeyboardKey} keyboardKey
  13899. * @return {boolean}
  13900. */
  13901. function isSpace(keyboardKey) {
  13902. return keyboardKey.key === 'Space' || keyboardKey.keyCode === 32;
  13903. }
  13904. /** @record */
  13905. var IconToggleState = function IconToggleState() {
  13906. _classCallCheck(this, IconToggleState);
  13907. };
  13908. /**
  13909. * The aria-label value of the icon toggle, or undefined if there is no aria-label.
  13910. * @export {string|undefined}
  13911. */
  13912. IconToggleState.prototype.label;
  13913. /**
  13914. * The text for the icon toggle, or undefined if there is no text.
  13915. * @export {string|undefined}
  13916. */
  13917. IconToggleState.prototype.content;
  13918. /**
  13919. * The CSS class to add to the icon toggle, or undefined if there is no CSS class.
  13920. * @export {string|undefined}
  13921. */
  13922. IconToggleState.prototype.cssClass;
  13923. /* harmony default export */ __webpack_exports__["a"] = (MDCIconToggleFoundation);
  13924. /***/ }),
  13925. /* 102 */
  13926. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13927. "use strict";
  13928. /* unused harmony export MDCIconToggleAdapter */
  13929. /* unused harmony export IconToggleEvent */
  13930. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  13931. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13932. /**
  13933. * @license
  13934. * Copyright 2017 Google Inc.
  13935. *
  13936. * Permission is hereby granted, free of charge, to any person obtaining a copy
  13937. * of this software and associated documentation files (the "Software"), to deal
  13938. * in the Software without restriction, including without limitation the rights
  13939. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  13940. * copies of the Software, and to permit persons to whom the Software is
  13941. * furnished to do so, subject to the following conditions:
  13942. *
  13943. * The above copyright notice and this permission notice shall be included in
  13944. * all copies or substantial portions of the Software.
  13945. *
  13946. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13947. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  13948. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  13949. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  13950. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  13951. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  13952. * THE SOFTWARE.
  13953. */
  13954. /* eslint no-unused-vars: [2, {"args": "none"}] */
  13955. /**
  13956. * Adapter for MDC Icon Toggle. Provides an interface for managing
  13957. * - classes
  13958. * - dom
  13959. * - inner text
  13960. * - event handlers
  13961. * - event dispatch
  13962. *
  13963. * Additionally, provides type information for the adapter to the Closure
  13964. * compiler.
  13965. *
  13966. * Implement this adapter for your framework of choice to delegate updates to
  13967. * the component in your framework of choice. See architecture documentation
  13968. * for more details.
  13969. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  13970. *
  13971. * @record
  13972. */
  13973. var MDCIconToggleAdapter = function () {
  13974. function MDCIconToggleAdapter() {
  13975. _classCallCheck(this, MDCIconToggleAdapter);
  13976. }
  13977. _createClass(MDCIconToggleAdapter, [{
  13978. key: "addClass",
  13979. /** @param {string} className */
  13980. value: function addClass(className) {}
  13981. /** @param {string} className */
  13982. }, {
  13983. key: "removeClass",
  13984. value: function removeClass(className) {}
  13985. /**
  13986. * @param {string} type
  13987. * @param {!EventListener} handler
  13988. */
  13989. }, {
  13990. key: "registerInteractionHandler",
  13991. value: function registerInteractionHandler(type, handler) {}
  13992. /**
  13993. * @param {string} type
  13994. * @param {!EventListener} handler
  13995. */
  13996. }, {
  13997. key: "deregisterInteractionHandler",
  13998. value: function deregisterInteractionHandler(type, handler) {}
  13999. /** @param {string} text */
  14000. }, {
  14001. key: "setText",
  14002. value: function setText(text) {}
  14003. /** @return {number} */
  14004. }, {
  14005. key: "getTabIndex",
  14006. value: function getTabIndex() {}
  14007. /** @param {number} tabIndex */
  14008. }, {
  14009. key: "setTabIndex",
  14010. value: function setTabIndex(tabIndex) {}
  14011. /**
  14012. * @param {string} name
  14013. * @return {string}
  14014. */
  14015. }, {
  14016. key: "getAttr",
  14017. value: function getAttr(name) {}
  14018. /**
  14019. * @param {string} name
  14020. * @param {string} value
  14021. */
  14022. }, {
  14023. key: "setAttr",
  14024. value: function setAttr(name, value) {}
  14025. /** @param {string} name */
  14026. }, {
  14027. key: "rmAttr",
  14028. value: function rmAttr(name) {}
  14029. /** @param {!IconToggleEvent} evtData */
  14030. }, {
  14031. key: "notifyChange",
  14032. value: function notifyChange(evtData) {}
  14033. }]);
  14034. return MDCIconToggleAdapter;
  14035. }();
  14036. /**
  14037. * @typedef {{
  14038. * isOn: boolean,
  14039. * }}
  14040. */
  14041. var IconToggleEvent = void 0;
  14042. /***/ }),
  14043. /* 103 */
  14044. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14045. "use strict";
  14046. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  14047. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  14048. /**
  14049. * @license
  14050. * Copyright 2016 Google Inc.
  14051. *
  14052. * Permission is hereby granted, free of charge, to any person obtaining a copy
  14053. * of this software and associated documentation files (the "Software"), to deal
  14054. * in the Software without restriction, including without limitation the rights
  14055. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  14056. * copies of the Software, and to permit persons to whom the Software is
  14057. * furnished to do so, subject to the following conditions:
  14058. *
  14059. * The above copyright notice and this permission notice shall be included in
  14060. * all copies or substantial portions of the Software.
  14061. *
  14062. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14063. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14064. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  14065. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  14066. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  14067. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  14068. * THE SOFTWARE.
  14069. */
  14070. /** @enum {string} */
  14071. var cssClasses = {
  14072. ROOT: 'mdc-icon-toggle',
  14073. DISABLED: 'mdc-icon-toggle--disabled'
  14074. };
  14075. /** @enum {string} */
  14076. var strings = {
  14077. DATA_TOGGLE_ON: 'data-toggle-on',
  14078. DATA_TOGGLE_OFF: 'data-toggle-off',
  14079. ARIA_PRESSED: 'aria-pressed',
  14080. ARIA_DISABLED: 'aria-disabled',
  14081. ARIA_LABEL: 'aria-label',
  14082. CHANGE_EVENT: 'MDCIconToggle:change'
  14083. };
  14084. /***/ }),
  14085. /* 104 */
  14086. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14087. "use strict";
  14088. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  14089. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCLinearProgress", function() { return MDCLinearProgress; });
  14090. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_index__ = __webpack_require__(3);
  14091. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(105);
  14092. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCLinearProgressFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__foundation__["a"]; });
  14093. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  14094. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  14095. 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; }
  14096. 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; }
  14097. /**
  14098. * @license
  14099. * Copyright 2017 Google Inc.
  14100. *
  14101. * Permission is hereby granted, free of charge, to any person obtaining a copy
  14102. * of this software and associated documentation files (the "Software"), to deal
  14103. * in the Software without restriction, including without limitation the rights
  14104. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  14105. * copies of the Software, and to permit persons to whom the Software is
  14106. * furnished to do so, subject to the following conditions:
  14107. *
  14108. * The above copyright notice and this permission notice shall be included in
  14109. * all copies or substantial portions of the Software.
  14110. *
  14111. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14112. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14113. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  14114. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  14115. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  14116. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  14117. * THE SOFTWARE.
  14118. */
  14119. var MDCLinearProgress = function (_MDCComponent) {
  14120. _inherits(MDCLinearProgress, _MDCComponent);
  14121. function MDCLinearProgress() {
  14122. _classCallCheck(this, MDCLinearProgress);
  14123. return _possibleConstructorReturn(this, (MDCLinearProgress.__proto__ || Object.getPrototypeOf(MDCLinearProgress)).apply(this, arguments));
  14124. }
  14125. _createClass(MDCLinearProgress, [{
  14126. key: 'open',
  14127. value: function open() {
  14128. this.foundation_.open();
  14129. }
  14130. }, {
  14131. key: 'close',
  14132. value: function close() {
  14133. this.foundation_.close();
  14134. }
  14135. }, {
  14136. key: 'getDefaultFoundation',
  14137. value: function getDefaultFoundation() {
  14138. var _this2 = this;
  14139. return new __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]({
  14140. addClass: function addClass(className) {
  14141. return _this2.root_.classList.add(className);
  14142. },
  14143. getPrimaryBar: function getPrimaryBar() {
  14144. return _this2.root_.querySelector(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.PRIMARY_BAR_SELECTOR);
  14145. },
  14146. getBuffer: function getBuffer() {
  14147. return _this2.root_.querySelector(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.BUFFER_SELECTOR);
  14148. },
  14149. hasClass: function hasClass(className) {
  14150. return _this2.root_.classList.contains(className);
  14151. },
  14152. removeClass: function removeClass(className) {
  14153. return _this2.root_.classList.remove(className);
  14154. },
  14155. setStyle: function setStyle(el, styleProperty, value) {
  14156. return el.style[styleProperty] = value;
  14157. }
  14158. });
  14159. }
  14160. }, {
  14161. key: 'determinate',
  14162. set: function set(value) {
  14163. this.foundation_.setDeterminate(value);
  14164. }
  14165. }, {
  14166. key: 'progress',
  14167. set: function set(value) {
  14168. this.foundation_.setProgress(value);
  14169. }
  14170. }, {
  14171. key: 'buffer',
  14172. set: function set(value) {
  14173. this.foundation_.setBuffer(value);
  14174. }
  14175. }, {
  14176. key: 'reverse',
  14177. set: function set(value) {
  14178. this.foundation_.setReverse(value);
  14179. }
  14180. }], [{
  14181. key: 'attachTo',
  14182. value: function attachTo(root) {
  14183. return new MDCLinearProgress(root);
  14184. }
  14185. }]);
  14186. return MDCLinearProgress;
  14187. }(__WEBPACK_IMPORTED_MODULE_0__material_base_index__["MDCComponent"]);
  14188. /***/ }),
  14189. /* 105 */
  14190. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14191. "use strict";
  14192. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_index__ = __webpack_require__(3);
  14193. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_animation_index__ = __webpack_require__(9);
  14194. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(106);
  14195. 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; };
  14196. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  14197. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  14198. 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; }
  14199. 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; }
  14200. /**
  14201. * @license
  14202. * Copyright 2017 Google Inc.
  14203. *
  14204. * Permission is hereby granted, free of charge, to any person obtaining a copy
  14205. * of this software and associated documentation files (the "Software"), to deal
  14206. * in the Software without restriction, including without limitation the rights
  14207. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  14208. * copies of the Software, and to permit persons to whom the Software is
  14209. * furnished to do so, subject to the following conditions:
  14210. *
  14211. * The above copyright notice and this permission notice shall be included in
  14212. * all copies or substantial portions of the Software.
  14213. *
  14214. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14215. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14216. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  14217. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  14218. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  14219. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  14220. * THE SOFTWARE.
  14221. */
  14222. var MDCLinearProgressFoundation = function (_MDCFoundation) {
  14223. _inherits(MDCLinearProgressFoundation, _MDCFoundation);
  14224. _createClass(MDCLinearProgressFoundation, null, [{
  14225. key: 'cssClasses',
  14226. get: function get() {
  14227. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  14228. }
  14229. }, {
  14230. key: 'strings',
  14231. get: function get() {
  14232. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  14233. }
  14234. }, {
  14235. key: 'defaultAdapter',
  14236. get: function get() {
  14237. return {
  14238. addClass: function addClass() /* className: string */{},
  14239. getPrimaryBar: function getPrimaryBar() /* el: Element */{},
  14240. getBuffer: function getBuffer() /* el: Element */{},
  14241. hasClass: function hasClass() {
  14242. return (/* className: string */false
  14243. );
  14244. },
  14245. removeClass: function removeClass() /* className: string */{},
  14246. setStyle: function setStyle() /* el: Element, styleProperty: string, value: string */{}
  14247. };
  14248. }
  14249. }]);
  14250. function MDCLinearProgressFoundation(adapter) {
  14251. _classCallCheck(this, MDCLinearProgressFoundation);
  14252. return _possibleConstructorReturn(this, (MDCLinearProgressFoundation.__proto__ || Object.getPrototypeOf(MDCLinearProgressFoundation)).call(this, _extends(MDCLinearProgressFoundation.defaultAdapter, adapter)));
  14253. }
  14254. _createClass(MDCLinearProgressFoundation, [{
  14255. key: 'init',
  14256. value: function init() {
  14257. this.determinate_ = !this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].INDETERMINATE_CLASS);
  14258. this.reverse_ = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].REVERSED_CLASS);
  14259. this.progress_ = 0;
  14260. }
  14261. }, {
  14262. key: 'setDeterminate',
  14263. value: function setDeterminate(isDeterminate) {
  14264. this.determinate_ = isDeterminate;
  14265. if (this.determinate_) {
  14266. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].INDETERMINATE_CLASS);
  14267. this.setScale_(this.adapter_.getPrimaryBar(), this.progress_);
  14268. } else {
  14269. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].INDETERMINATE_CLASS);
  14270. this.setScale_(this.adapter_.getPrimaryBar(), 1);
  14271. this.setScale_(this.adapter_.getBuffer(), 1);
  14272. }
  14273. }
  14274. }, {
  14275. key: 'setProgress',
  14276. value: function setProgress(value) {
  14277. this.progress_ = value;
  14278. if (this.determinate_) {
  14279. this.setScale_(this.adapter_.getPrimaryBar(), value);
  14280. }
  14281. }
  14282. }, {
  14283. key: 'setBuffer',
  14284. value: function setBuffer(value) {
  14285. if (this.determinate_) {
  14286. this.setScale_(this.adapter_.getBuffer(), value);
  14287. }
  14288. }
  14289. }, {
  14290. key: 'setReverse',
  14291. value: function setReverse(isReversed) {
  14292. this.reverse_ = isReversed;
  14293. if (this.reverse_) {
  14294. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].REVERSED_CLASS);
  14295. } else {
  14296. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].REVERSED_CLASS);
  14297. }
  14298. }
  14299. }, {
  14300. key: 'open',
  14301. value: function open() {
  14302. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CLOSED_CLASS);
  14303. }
  14304. }, {
  14305. key: 'close',
  14306. value: function close() {
  14307. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CLOSED_CLASS);
  14308. }
  14309. }, {
  14310. key: 'setScale_',
  14311. value: function setScale_(el, scaleValue) {
  14312. var _this2 = this;
  14313. var value = 'scaleX(' + scaleValue + ')';
  14314. __WEBPACK_IMPORTED_MODULE_1__material_animation_index__["c" /* transformStyleProperties */].forEach(function (transformStyleProperty) {
  14315. _this2.adapter_.setStyle(el, transformStyleProperty, value);
  14316. });
  14317. }
  14318. }]);
  14319. return MDCLinearProgressFoundation;
  14320. }(__WEBPACK_IMPORTED_MODULE_0__material_base_index__["MDCFoundation"]);
  14321. /* harmony default export */ __webpack_exports__["a"] = (MDCLinearProgressFoundation);
  14322. /***/ }),
  14323. /* 106 */
  14324. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14325. "use strict";
  14326. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  14327. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  14328. /**
  14329. * @license
  14330. * Copyright 2017 Google Inc.
  14331. *
  14332. * Permission is hereby granted, free of charge, to any person obtaining a copy
  14333. * of this software and associated documentation files (the "Software"), to deal
  14334. * in the Software without restriction, including without limitation the rights
  14335. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  14336. * copies of the Software, and to permit persons to whom the Software is
  14337. * furnished to do so, subject to the following conditions:
  14338. *
  14339. * The above copyright notice and this permission notice shall be included in
  14340. * all copies or substantial portions of the Software.
  14341. *
  14342. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14343. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14344. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  14345. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  14346. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  14347. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  14348. * THE SOFTWARE.
  14349. */
  14350. var cssClasses = {
  14351. CLOSED_CLASS: 'mdc-linear-progress--closed',
  14352. INDETERMINATE_CLASS: 'mdc-linear-progress--indeterminate',
  14353. REVERSED_CLASS: 'mdc-linear-progress--reversed'
  14354. };
  14355. var strings = {
  14356. PRIMARY_BAR_SELECTOR: '.mdc-linear-progress__primary-bar',
  14357. BUFFER_SELECTOR: '.mdc-linear-progress__buffer'
  14358. };
  14359. /***/ }),
  14360. /* 107 */
  14361. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14362. "use strict";
  14363. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  14364. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(42);
  14365. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(108);
  14366. 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; };
  14367. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  14368. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  14369. 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; }
  14370. 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; }
  14371. /**
  14372. * @license
  14373. * Copyright 2018 Google Inc.
  14374. *
  14375. * Permission is hereby granted, free of charge, to any person obtaining a copy
  14376. * of this software and associated documentation files (the "Software"), to deal
  14377. * in the Software without restriction, including without limitation the rights
  14378. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  14379. * copies of the Software, and to permit persons to whom the Software is
  14380. * furnished to do so, subject to the following conditions:
  14381. *
  14382. * The above copyright notice and this permission notice shall be included in
  14383. * all copies or substantial portions of the Software.
  14384. *
  14385. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14386. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14387. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  14388. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  14389. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  14390. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  14391. * THE SOFTWARE.
  14392. */
  14393. /**
  14394. * @extends {MDCFoundation<!MDCLineRippleAdapter>}
  14395. * @final
  14396. */
  14397. var MDCLineRippleFoundation = function (_MDCFoundation) {
  14398. _inherits(MDCLineRippleFoundation, _MDCFoundation);
  14399. _createClass(MDCLineRippleFoundation, null, [{
  14400. key: 'cssClasses',
  14401. /** @return enum {string} */
  14402. get: function get() {
  14403. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  14404. }
  14405. /**
  14406. * {@see MDCLineRippleAdapter} for typing information on parameters and return
  14407. * types.
  14408. * @return {!MDCLineRippleAdapter}
  14409. */
  14410. }, {
  14411. key: 'defaultAdapter',
  14412. get: function get() {
  14413. return (/** @type {!MDCLineRippleAdapter} */{
  14414. addClass: function addClass() {},
  14415. removeClass: function removeClass() {},
  14416. hasClass: function hasClass() {},
  14417. setStyle: function setStyle() {},
  14418. registerEventHandler: function registerEventHandler() {},
  14419. deregisterEventHandler: function deregisterEventHandler() {}
  14420. }
  14421. );
  14422. }
  14423. /**
  14424. * @param {!MDCLineRippleAdapter=} adapter
  14425. */
  14426. }]);
  14427. function MDCLineRippleFoundation(adapter) {
  14428. _classCallCheck(this, MDCLineRippleFoundation);
  14429. /** @private {function(!Event): undefined} */
  14430. var _this = _possibleConstructorReturn(this, (MDCLineRippleFoundation.__proto__ || Object.getPrototypeOf(MDCLineRippleFoundation)).call(this, _extends(MDCLineRippleFoundation.defaultAdapter, adapter)));
  14431. _this.transitionEndHandler_ = function (evt) {
  14432. return _this.handleTransitionEnd(evt);
  14433. };
  14434. return _this;
  14435. }
  14436. _createClass(MDCLineRippleFoundation, [{
  14437. key: 'init',
  14438. value: function init() {
  14439. this.adapter_.registerEventHandler('transitionend', this.transitionEndHandler_);
  14440. }
  14441. }, {
  14442. key: 'destroy',
  14443. value: function destroy() {
  14444. this.adapter_.deregisterEventHandler('transitionend', this.transitionEndHandler_);
  14445. }
  14446. /**
  14447. * Activates the line ripple
  14448. */
  14449. }, {
  14450. key: 'activate',
  14451. value: function activate() {
  14452. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LINE_RIPPLE_DEACTIVATING);
  14453. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LINE_RIPPLE_ACTIVE);
  14454. }
  14455. /**
  14456. * Sets the center of the ripple animation to the given X coordinate.
  14457. * @param {number} xCoordinate
  14458. */
  14459. }, {
  14460. key: 'setRippleCenter',
  14461. value: function setRippleCenter(xCoordinate) {
  14462. this.adapter_.setStyle('transform-origin', xCoordinate + 'px center');
  14463. }
  14464. /**
  14465. * Deactivates the line ripple
  14466. */
  14467. }, {
  14468. key: 'deactivate',
  14469. value: function deactivate() {
  14470. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LINE_RIPPLE_DEACTIVATING);
  14471. }
  14472. /**
  14473. * Handles a transition end event
  14474. * @param {!Event} evt
  14475. */
  14476. }, {
  14477. key: 'handleTransitionEnd',
  14478. value: function handleTransitionEnd(evt) {
  14479. // Wait for the line ripple to be either transparent or opaque
  14480. // before emitting the animation end event
  14481. var isDeactivating = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LINE_RIPPLE_DEACTIVATING);
  14482. if (evt.propertyName === 'opacity') {
  14483. if (isDeactivating) {
  14484. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LINE_RIPPLE_ACTIVE);
  14485. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LINE_RIPPLE_DEACTIVATING);
  14486. }
  14487. }
  14488. }
  14489. }]);
  14490. return MDCLineRippleFoundation;
  14491. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  14492. /* harmony default export */ __webpack_exports__["a"] = (MDCLineRippleFoundation);
  14493. /***/ }),
  14494. /* 108 */
  14495. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14496. "use strict";
  14497. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  14498. /**
  14499. * @license
  14500. * Copyright 2018 Google Inc.
  14501. *
  14502. * Permission is hereby granted, free of charge, to any person obtaining a copy
  14503. * of this software and associated documentation files (the "Software"), to deal
  14504. * in the Software without restriction, including without limitation the rights
  14505. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  14506. * copies of the Software, and to permit persons to whom the Software is
  14507. * furnished to do so, subject to the following conditions:
  14508. *
  14509. * The above copyright notice and this permission notice shall be included in
  14510. * all copies or substantial portions of the Software.
  14511. *
  14512. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14513. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14514. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  14515. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  14516. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  14517. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  14518. * THE SOFTWARE.
  14519. */
  14520. /** @enum {string} */
  14521. var cssClasses = {
  14522. LINE_RIPPLE_ACTIVE: 'mdc-line-ripple--active',
  14523. LINE_RIPPLE_DEACTIVATING: 'mdc-line-ripple--deactivating'
  14524. };
  14525. /***/ }),
  14526. /* 109 */
  14527. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14528. "use strict";
  14529. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCMenuFoundation; });
  14530. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  14531. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(110);
  14532. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(19);
  14533. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_menu_surface_foundation__ = __webpack_require__(20);
  14534. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__material_list_foundation__ = __webpack_require__(16);
  14535. 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; };
  14536. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  14537. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  14538. 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; }
  14539. 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; }
  14540. /**
  14541. * @license
  14542. * Copyright 2018 Google Inc.
  14543. *
  14544. * Permission is hereby granted, free of charge, to any person obtaining a copy
  14545. * of this software and associated documentation files (the "Software"), to deal
  14546. * in the Software without restriction, including without limitation the rights
  14547. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  14548. * copies of the Software, and to permit persons to whom the Software is
  14549. * furnished to do so, subject to the following conditions:
  14550. *
  14551. * The above copyright notice and this permission notice shall be included in
  14552. * all copies or substantial portions of the Software.
  14553. *
  14554. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14555. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14556. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  14557. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  14558. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  14559. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  14560. * THE SOFTWARE.
  14561. */
  14562. var ELEMENTS_KEY_ALLOWED_IN = ['input', 'button', 'textarea', 'select', 'a'];
  14563. /**
  14564. * @extends {MDCFoundation<!MDCMenuAdapter>}
  14565. */
  14566. var MDCMenuFoundation = function (_MDCFoundation) {
  14567. _inherits(MDCMenuFoundation, _MDCFoundation);
  14568. _createClass(MDCMenuFoundation, null, [{
  14569. key: 'cssClasses',
  14570. /** @return enum{cssClasses} */
  14571. get: function get() {
  14572. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  14573. }
  14574. /** @return enum{strings} */
  14575. }, {
  14576. key: 'strings',
  14577. get: function get() {
  14578. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  14579. }
  14580. /**
  14581. * {@see MDCMenuAdapter} for typing information on parameters and return
  14582. * types.
  14583. * @return {!MDCMenuAdapter}
  14584. */
  14585. }, {
  14586. key: 'defaultAdapter',
  14587. get: function get() {
  14588. return (/** @type {!MDCMenuAdapter} */{
  14589. addClassToElementAtIndex: function addClassToElementAtIndex() {},
  14590. removeClassFromElementAtIndex: function removeClassFromElementAtIndex() {},
  14591. addAttributeToElementAtIndex: function addAttributeToElementAtIndex() {},
  14592. removeAttributeFromElementAtIndex: function removeAttributeFromElementAtIndex() {},
  14593. elementContainsClass: function elementContainsClass() {},
  14594. closeSurface: function closeSurface() {},
  14595. getElementIndex: function getElementIndex() {},
  14596. getParentElement: function getParentElement() {},
  14597. getSelectedElementIndex: function getSelectedElementIndex() {},
  14598. notifySelected: function notifySelected() {}
  14599. }
  14600. );
  14601. }
  14602. /** @param {!MDCMenuAdapter} adapter */
  14603. }]);
  14604. function MDCMenuFoundation(adapter) {
  14605. _classCallCheck(this, MDCMenuFoundation);
  14606. /** @type {number} */
  14607. var _this = _possibleConstructorReturn(this, (MDCMenuFoundation.__proto__ || Object.getPrototypeOf(MDCMenuFoundation)).call(this, _extends(MDCMenuFoundation.defaultAdapter, adapter)));
  14608. _this.closeAnimationEndTimerId_ = 0;
  14609. return _this;
  14610. }
  14611. _createClass(MDCMenuFoundation, [{
  14612. key: 'destroy',
  14613. value: function destroy() {
  14614. if (this.closeAnimationEndTimerId_) {
  14615. clearTimeout(this.closeAnimationEndTimerId_);
  14616. }
  14617. this.adapter_.closeSurface();
  14618. }
  14619. /**
  14620. * Handler function for the keydown events.
  14621. * @param {!Event} evt
  14622. */
  14623. }, {
  14624. key: 'handleKeydown',
  14625. value: function handleKeydown(evt) {
  14626. var key = evt.key,
  14627. keyCode = evt.keyCode;
  14628. var isSpace = key === 'Space' || keyCode === 32;
  14629. var isEnter = key === 'Enter' || keyCode === 13;
  14630. var isTab = key === 'Tab' || keyCode === 9;
  14631. if (isSpace || isEnter) {
  14632. this.handleAction_(evt);
  14633. } else if (isTab) {
  14634. this.adapter_.closeSurface();
  14635. }
  14636. }
  14637. /**
  14638. * Handler function for the click events.
  14639. * @param {!Event} evt
  14640. */
  14641. }, {
  14642. key: 'handleClick',
  14643. value: function handleClick(evt) {
  14644. this.handleAction_(evt);
  14645. }
  14646. /**
  14647. * Combined action handling for click/keypress events.
  14648. * @param {!Event} evt
  14649. * @private
  14650. */
  14651. }, {
  14652. key: 'handleAction_',
  14653. value: function handleAction_(evt) {
  14654. var listItem = this.getListItem_( /** @type {HTMLElement} */evt.target);
  14655. if (listItem) {
  14656. this.handleSelection(listItem);
  14657. this.preventDefaultEvent_(evt);
  14658. }
  14659. }
  14660. /**
  14661. * Handler for a selected list item.
  14662. * @param {?HTMLElement} listItem
  14663. */
  14664. }, {
  14665. key: 'handleSelection',
  14666. value: function handleSelection(listItem) {
  14667. var _this2 = this;
  14668. var index = this.adapter_.getElementIndex(listItem);
  14669. if (index < 0) {
  14670. return;
  14671. }
  14672. this.adapter_.notifySelected({ index: index });
  14673. this.adapter_.closeSurface();
  14674. // Wait for the menu to close before adding/removing classes that affect styles.
  14675. this.closeAnimationEndTimerId_ = setTimeout(function () {
  14676. var selectionGroup = _this2.getSelectionGroup_(listItem);
  14677. if (selectionGroup !== null) {
  14678. _this2.handleSelectionGroup_( /** @type {!HTMLElement} */selectionGroup, index);
  14679. }
  14680. }, __WEBPACK_IMPORTED_MODULE_3__material_menu_surface_foundation__["b" /* MDCMenuSurfaceFoundation */].numbers.TRANSITION_CLOSE_DURATION);
  14681. }
  14682. /**
  14683. * Handles toggling the selected classes in a selection group when a
  14684. * selection is made.
  14685. * @param {!HTMLElement} selectionGroup
  14686. * @param {number} index The selected index value
  14687. * @private
  14688. */
  14689. }, {
  14690. key: 'handleSelectionGroup_',
  14691. value: function handleSelectionGroup_(selectionGroup, index) {
  14692. // De-select the previous selection in this group.
  14693. var selectedIndex = this.adapter_.getSelectedElementIndex(selectionGroup);
  14694. if (selectedIndex >= 0) {
  14695. this.adapter_.removeAttributeFromElementAtIndex(selectedIndex, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_SELECTED_ATTR);
  14696. this.adapter_.removeClassFromElementAtIndex(selectedIndex, __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].MENU_SELECTED_LIST_ITEM);
  14697. }
  14698. // Select the new list item in this group.
  14699. this.adapter_.addClassToElementAtIndex(index, __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].MENU_SELECTED_LIST_ITEM);
  14700. this.adapter_.addAttributeToElementAtIndex(index, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_SELECTED_ATTR, 'true');
  14701. }
  14702. /**
  14703. * Returns the parent selection group of an element if one exists.
  14704. * @param listItem
  14705. * @return {?HTMLElement} parent selection group element or null.
  14706. * @private
  14707. */
  14708. }, {
  14709. key: 'getSelectionGroup_',
  14710. value: function getSelectionGroup_(listItem) {
  14711. var parent = this.adapter_.getParentElement(listItem);
  14712. var isGroup = this.adapter_.elementContainsClass(parent, __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].MENU_SELECTION_GROUP);
  14713. // Iterate through ancestors until we find the group or get to the list.
  14714. while (!isGroup && !this.adapter_.elementContainsClass(parent, __WEBPACK_IMPORTED_MODULE_4__material_list_foundation__["a" /* default */].cssClasses.ROOT)) {
  14715. parent = this.adapter_.getParentElement(parent);
  14716. isGroup = this.adapter_.elementContainsClass(parent, __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].MENU_SELECTION_GROUP);
  14717. }
  14718. if (isGroup) {
  14719. return parent;
  14720. } else {
  14721. return null;
  14722. }
  14723. }
  14724. /**
  14725. * Find the first ancestor with the mdc-list-item class.
  14726. * @param {?HTMLElement} target
  14727. * @return {?HTMLElement}
  14728. * @private
  14729. */
  14730. }, {
  14731. key: 'getListItem_',
  14732. value: function getListItem_(target) {
  14733. var isListItem = this.adapter_.elementContainsClass(target, __WEBPACK_IMPORTED_MODULE_4__material_list_foundation__["a" /* default */].cssClasses.LIST_ITEM_CLASS);
  14734. while (!isListItem) {
  14735. target = this.adapter_.getParentElement(target);
  14736. if (target) {
  14737. isListItem = this.adapter_.elementContainsClass(target, __WEBPACK_IMPORTED_MODULE_4__material_list_foundation__["a" /* default */].cssClasses.LIST_ITEM_CLASS);
  14738. } else {
  14739. // target has no parent element.
  14740. return null;
  14741. }
  14742. }
  14743. return target;
  14744. }
  14745. /**
  14746. * Ensures that preventDefault is only called if the containing element doesn't
  14747. * consume the event, and it will cause an unintended scroll.
  14748. * @param {!Event} evt
  14749. * @private
  14750. */
  14751. }, {
  14752. key: 'preventDefaultEvent_',
  14753. value: function preventDefaultEvent_(evt) {
  14754. var target = /** @type {!HTMLElement} */evt.target;
  14755. var tagName = ('' + target.tagName).toLowerCase();
  14756. if (ELEMENTS_KEY_ALLOWED_IN.indexOf(tagName) === -1) {
  14757. evt.preventDefault();
  14758. }
  14759. }
  14760. }]);
  14761. return MDCMenuFoundation;
  14762. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  14763. /***/ }),
  14764. /* 110 */
  14765. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14766. "use strict";
  14767. /* unused harmony export MDCMenuAdapter */
  14768. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  14769. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  14770. /**
  14771. * @license
  14772. * Copyright 2018 Google Inc.
  14773. *
  14774. * Permission is hereby granted, free of charge, to any person obtaining a copy
  14775. * of this software and associated documentation files (the "Software"), to deal
  14776. * in the Software without restriction, including without limitation the rights
  14777. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  14778. * copies of the Software, and to permit persons to whom the Software is
  14779. * furnished to do so, subject to the following conditions:
  14780. *
  14781. * The above copyright notice and this permission notice shall be included in
  14782. * all copies or substantial portions of the Software.
  14783. *
  14784. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14785. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14786. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  14787. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  14788. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  14789. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  14790. * THE SOFTWARE.
  14791. */
  14792. /* eslint no-unused-vars: [2, {"args": "none"}] */
  14793. /**
  14794. * Adapter for MDC Menu. Provides an interface for managing
  14795. * - selected element classes
  14796. * - get focused elements
  14797. * - toggling a checkbox inside a list item
  14798. *
  14799. * Additionally, provides type information for the adapter to the Closure
  14800. * compiler.
  14801. *
  14802. * Implement this adapter for your framework of choice to delegate updates to
  14803. * the component in your framework of choice. See architecture documentation
  14804. * for more details.
  14805. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  14806. *
  14807. * @record
  14808. */
  14809. var MDCMenuAdapter = function () {
  14810. function MDCMenuAdapter() {
  14811. _classCallCheck(this, MDCMenuAdapter);
  14812. }
  14813. _createClass(MDCMenuAdapter, [{
  14814. key: "addClassToElementAtIndex",
  14815. /**
  14816. * Adds a class to the element at the index provided.
  14817. * @param {number} index
  14818. * @param {string} className
  14819. */
  14820. value: function addClassToElementAtIndex(index, className) {}
  14821. /**
  14822. * Removes a class from the element at the index provided
  14823. * @param {number} index
  14824. * @param {string} className
  14825. */
  14826. }, {
  14827. key: "removeClassFromElementAtIndex",
  14828. value: function removeClassFromElementAtIndex(index, className) {}
  14829. /**
  14830. * Adds an attribute, with value, to the element at the index provided.
  14831. * @param {number} index
  14832. * @param {string} attr
  14833. * @param {string} value
  14834. */
  14835. }, {
  14836. key: "addAttributeToElementAtIndex",
  14837. value: function addAttributeToElementAtIndex(index, attr, value) {}
  14838. /**
  14839. * Removes an attribute from an element at the index provided.
  14840. * @param {number} index
  14841. * @param {string} attr
  14842. */
  14843. }, {
  14844. key: "removeAttributeFromElementAtIndex",
  14845. value: function removeAttributeFromElementAtIndex(index, attr) {}
  14846. /**
  14847. * Returns true if the element contains the className.
  14848. * @param {?HTMLElement} element
  14849. * @param {string} className
  14850. * @return {boolean} true if the element contains the className
  14851. */
  14852. }, {
  14853. key: "elementContainsClass",
  14854. value: function elementContainsClass(element, className) {}
  14855. /**
  14856. * Closes the menu-surface.
  14857. */
  14858. }, {
  14859. key: "closeSurface",
  14860. value: function closeSurface() {}
  14861. /**
  14862. * Returns the index for the element provided.
  14863. * @param {?HTMLElement} element
  14864. * @return {number} index of the element in the list or -1 if it is not in the list.
  14865. */
  14866. }, {
  14867. key: "getElementIndex",
  14868. value: function getElementIndex(element) {}
  14869. /**
  14870. * Returns the parentElement of the provided element.
  14871. * @param {?HTMLElement} element
  14872. * @return {?HTMLElement} parentElement of the element provided.
  14873. */
  14874. }, {
  14875. key: "getParentElement",
  14876. value: function getParentElement(element) {}
  14877. /**
  14878. * Returns the element within the selectionGroup containing the selected element class.
  14879. * @param {!HTMLElement} selectionGroup
  14880. * @return {number} element within the selectionGroup that contains the selected element class.
  14881. */
  14882. }, {
  14883. key: "getSelectedElementIndex",
  14884. value: function getSelectedElementIndex(selectionGroup) {}
  14885. /**
  14886. * Emits an event using the evtData.
  14887. * @param {{
  14888. * index: number
  14889. * }} evtData
  14890. */
  14891. }, {
  14892. key: "notifySelected",
  14893. value: function notifySelected(evtData) {}
  14894. }]);
  14895. return MDCMenuAdapter;
  14896. }();
  14897. /***/ }),
  14898. /* 111 */
  14899. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14900. "use strict";
  14901. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  14902. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTransformPropertyName", function() { return getTransformPropertyName; });
  14903. /**
  14904. * @license
  14905. * Copyright 2018 Google Inc.
  14906. *
  14907. * Permission is hereby granted, free of charge, to any person obtaining a copy
  14908. * of this software and associated documentation files (the "Software"), to deal
  14909. * in the Software without restriction, including without limitation the rights
  14910. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  14911. * copies of the Software, and to permit persons to whom the Software is
  14912. * furnished to do so, subject to the following conditions:
  14913. *
  14914. * The above copyright notice and this permission notice shall be included in
  14915. * all copies or substantial portions of the Software.
  14916. *
  14917. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14918. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14919. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  14920. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  14921. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  14922. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  14923. * THE SOFTWARE.
  14924. */
  14925. /** @type {string|undefined} */
  14926. var storedTransformPropertyName_ = void 0;
  14927. /**
  14928. * Returns the name of the correct transform property to use on the current browser.
  14929. * @param {!Window} globalObj
  14930. * @param {boolean=} forceRefresh
  14931. * @return {string}
  14932. */
  14933. function getTransformPropertyName(globalObj) {
  14934. var forceRefresh = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  14935. if (storedTransformPropertyName_ === undefined || forceRefresh) {
  14936. var el = globalObj.document.createElement('div');
  14937. var transformPropertyName = 'transform' in el.style ? 'transform' : 'webkitTransform';
  14938. storedTransformPropertyName_ = transformPropertyName;
  14939. }
  14940. return storedTransformPropertyName_;
  14941. }
  14942. /***/ }),
  14943. /* 112 */
  14944. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14945. "use strict";
  14946. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  14947. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(46);
  14948. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(47);
  14949. 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; };
  14950. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  14951. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  14952. 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; }
  14953. 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; }
  14954. /**
  14955. * @license
  14956. * Copyright 2017 Google Inc.
  14957. *
  14958. * Permission is hereby granted, free of charge, to any person obtaining a copy
  14959. * of this software and associated documentation files (the "Software"), to deal
  14960. * in the Software without restriction, including without limitation the rights
  14961. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  14962. * copies of the Software, and to permit persons to whom the Software is
  14963. * furnished to do so, subject to the following conditions:
  14964. *
  14965. * The above copyright notice and this permission notice shall be included in
  14966. * all copies or substantial portions of the Software.
  14967. *
  14968. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14969. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14970. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  14971. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  14972. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  14973. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  14974. * THE SOFTWARE.
  14975. */
  14976. /**
  14977. * @extends {MDCFoundation<!MDCNotchedOutlineAdapter>}
  14978. * @final
  14979. */
  14980. var MDCNotchedOutlineFoundation = function (_MDCFoundation) {
  14981. _inherits(MDCNotchedOutlineFoundation, _MDCFoundation);
  14982. _createClass(MDCNotchedOutlineFoundation, null, [{
  14983. key: 'strings',
  14984. /** @return enum {string} */
  14985. get: function get() {
  14986. return __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */];
  14987. }
  14988. /** @return enum {string} */
  14989. }, {
  14990. key: 'cssClasses',
  14991. get: function get() {
  14992. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  14993. }
  14994. /** @return enum {number} */
  14995. }, {
  14996. key: 'numbers',
  14997. get: function get() {
  14998. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */];
  14999. }
  15000. /**
  15001. * {@see MDCNotchedOutlineAdapter} for typing information on parameters and return
  15002. * types.
  15003. * @return {!MDCNotchedOutlineAdapter}
  15004. */
  15005. }, {
  15006. key: 'defaultAdapter',
  15007. get: function get() {
  15008. return (/** @type {!MDCNotchedOutlineAdapter} */{
  15009. getWidth: function getWidth() {},
  15010. getHeight: function getHeight() {},
  15011. addClass: function addClass() {},
  15012. removeClass: function removeClass() {},
  15013. setOutlinePathAttr: function setOutlinePathAttr() {},
  15014. getIdleOutlineStyleValue: function getIdleOutlineStyleValue() {}
  15015. }
  15016. );
  15017. }
  15018. /**
  15019. * @param {!MDCNotchedOutlineAdapter} adapter
  15020. */
  15021. }]);
  15022. function MDCNotchedOutlineFoundation(adapter) {
  15023. _classCallCheck(this, MDCNotchedOutlineFoundation);
  15024. return _possibleConstructorReturn(this, (MDCNotchedOutlineFoundation.__proto__ || Object.getPrototypeOf(MDCNotchedOutlineFoundation)).call(this, _extends(MDCNotchedOutlineFoundation.defaultAdapter, adapter)));
  15025. }
  15026. /**
  15027. * Adds the outline notched selector and updates the notch width
  15028. * calculated based off of notchWidth and isRtl.
  15029. * @param {number} notchWidth
  15030. * @param {boolean=} isRtl
  15031. */
  15032. _createClass(MDCNotchedOutlineFoundation, [{
  15033. key: 'notch',
  15034. value: function notch(notchWidth) {
  15035. var isRtl = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  15036. var OUTLINE_NOTCHED = MDCNotchedOutlineFoundation.cssClasses.OUTLINE_NOTCHED;
  15037. this.adapter_.addClass(OUTLINE_NOTCHED);
  15038. this.updateSvgPath_(notchWidth, isRtl);
  15039. }
  15040. /**
  15041. * Removes notched outline selector to close the notch in the outline.
  15042. */
  15043. }, {
  15044. key: 'closeNotch',
  15045. value: function closeNotch() {
  15046. var OUTLINE_NOTCHED = MDCNotchedOutlineFoundation.cssClasses.OUTLINE_NOTCHED;
  15047. this.adapter_.removeClass(OUTLINE_NOTCHED);
  15048. }
  15049. /**
  15050. * Updates the SVG path of the focus outline element based on the notchWidth
  15051. * and the RTL context.
  15052. * @param {number} notchWidth
  15053. * @param {boolean=} isRtl
  15054. * @private
  15055. */
  15056. }, {
  15057. key: 'updateSvgPath_',
  15058. value: function updateSvgPath_(notchWidth, isRtl) {
  15059. // Fall back to reading a specific corner's style because Firefox doesn't report the style on border-radius.
  15060. var radiusStyleValue = this.adapter_.getIdleOutlineStyleValue('border-radius') || this.adapter_.getIdleOutlineStyleValue('border-top-left-radius');
  15061. var radius = parseFloat(radiusStyleValue);
  15062. var width = this.adapter_.getWidth();
  15063. var height = this.adapter_.getHeight();
  15064. var cornerWidth = radius + 1.2;
  15065. var leadingStrokeLength = Math.max(0, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].MIN_LEADING_STROKE_EDGE_POSITION - radius - 1.2);
  15066. // If the notchWidth is 0, the the notched outline doesn't need to add padding.
  15067. var paddedNotchWidth = 0;
  15068. if (notchWidth > 0) {
  15069. paddedNotchWidth = notchWidth + 2 * __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].NOTCH_GUTTER_SIZE;
  15070. }
  15071. // The right, bottom, and left sides of the outline follow the same SVG path.
  15072. var pathMiddle = 'a' + radius + ',' + radius + ' 0 0 1 ' + radius + ',' + radius + 'v' + (height - 2 * cornerWidth) + 'a' + radius + ',' + radius + ' 0 0 1 ' + -radius + ',' + radius + 'h' + (-width + 2 * cornerWidth) + 'a' + radius + ',' + radius + ' 0 0 1 ' + -radius + ',' + -radius + 'v' + (-height + 2 * cornerWidth) + 'a' + radius + ',' + radius + ' 0 0 1 ' + radius + ',' + -radius;
  15073. var path = void 0;
  15074. if (!isRtl) {
  15075. path = 'M' + (cornerWidth + leadingStrokeLength + paddedNotchWidth) + ',' + 1 + 'h' + (width - 2 * cornerWidth - paddedNotchWidth - leadingStrokeLength) + pathMiddle + 'h' + leadingStrokeLength;
  15076. } else {
  15077. path = 'M' + (width - cornerWidth - leadingStrokeLength) + ',' + 1 + 'h' + leadingStrokeLength + pathMiddle + 'h' + (width - 2 * cornerWidth - paddedNotchWidth - leadingStrokeLength);
  15078. }
  15079. this.adapter_.setOutlinePathAttr(path);
  15080. }
  15081. }]);
  15082. return MDCNotchedOutlineFoundation;
  15083. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  15084. /* harmony default export */ __webpack_exports__["a"] = (MDCNotchedOutlineFoundation);
  15085. /***/ }),
  15086. /* 113 */
  15087. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15088. "use strict";
  15089. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  15090. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCRadio", function() { return MDCRadio; });
  15091. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  15092. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_selection_control_index__ = __webpack_require__(4);
  15093. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(114);
  15094. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_ripple_index__ = __webpack_require__(2);
  15095. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCRadioFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  15096. 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; };
  15097. 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); } };
  15098. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  15099. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15100. 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; }
  15101. 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; }
  15102. /**
  15103. * @license
  15104. * Copyright 2016 Google Inc.
  15105. *
  15106. * Permission is hereby granted, free of charge, to any person obtaining a copy
  15107. * of this software and associated documentation files (the "Software"), to deal
  15108. * in the Software without restriction, including without limitation the rights
  15109. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  15110. * copies of the Software, and to permit persons to whom the Software is
  15111. * furnished to do so, subject to the following conditions:
  15112. *
  15113. * The above copyright notice and this permission notice shall be included in
  15114. * all copies or substantial portions of the Software.
  15115. *
  15116. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15117. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15118. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  15119. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  15120. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  15121. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  15122. * THE SOFTWARE.
  15123. */
  15124. /* eslint-disable no-unused-vars */
  15125. /* eslint-enable no-unused-vars */
  15126. /**
  15127. * @extends MDCComponent<!MDCRadioFoundation>
  15128. * @implements {MDCSelectionControl}
  15129. */
  15130. var MDCRadio = function (_MDCComponent) {
  15131. _inherits(MDCRadio, _MDCComponent);
  15132. _createClass(MDCRadio, [{
  15133. key: 'checked',
  15134. /** @return {boolean} */
  15135. get: function get() {
  15136. return this.nativeControl_.checked;
  15137. }
  15138. /** @param {boolean} checked */
  15139. ,
  15140. set: function set(checked) {
  15141. this.nativeControl_.checked = checked;
  15142. }
  15143. /** @return {boolean} */
  15144. }, {
  15145. key: 'disabled',
  15146. get: function get() {
  15147. return this.nativeControl_.disabled;
  15148. }
  15149. /** @param {boolean} disabled */
  15150. ,
  15151. set: function set(disabled) {
  15152. this.foundation_.setDisabled(disabled);
  15153. }
  15154. /** @return {?string} */
  15155. }, {
  15156. key: 'value',
  15157. get: function get() {
  15158. return this.nativeControl_.value;
  15159. }
  15160. /** @param {?string} value */
  15161. ,
  15162. set: function set(value) {
  15163. this.nativeControl_.value = value;
  15164. }
  15165. /** @return {!MDCRipple} */
  15166. }, {
  15167. key: 'ripple',
  15168. get: function get() {
  15169. return this.ripple_;
  15170. }
  15171. }], [{
  15172. key: 'attachTo',
  15173. value: function attachTo(root) {
  15174. return new MDCRadio(root);
  15175. }
  15176. }]);
  15177. function MDCRadio() {
  15178. var _ref;
  15179. _classCallCheck(this, MDCRadio);
  15180. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  15181. args[_key] = arguments[_key];
  15182. }
  15183. /** @private {!MDCRipple} */
  15184. var _this = _possibleConstructorReturn(this, (_ref = MDCRadio.__proto__ || Object.getPrototypeOf(MDCRadio)).call.apply(_ref, [this].concat(args)));
  15185. _this.ripple_ = _this.initRipple_();
  15186. return _this;
  15187. }
  15188. /**
  15189. * @return {!MDCRipple}
  15190. * @private
  15191. */
  15192. _createClass(MDCRadio, [{
  15193. key: 'initRipple_',
  15194. value: function initRipple_() {
  15195. var _this2 = this;
  15196. var adapter = _extends(__WEBPACK_IMPORTED_MODULE_3__material_ripple_index__["MDCRipple"].createAdapter(this), {
  15197. isUnbounded: function isUnbounded() {
  15198. return true;
  15199. },
  15200. // Radio buttons technically go "active" whenever there is *any* keyboard interaction. This is not the
  15201. // UI we desire.
  15202. isSurfaceActive: function isSurfaceActive() {
  15203. return false;
  15204. },
  15205. registerInteractionHandler: function registerInteractionHandler(type, handler) {
  15206. return _this2.nativeControl_.addEventListener(type, handler);
  15207. },
  15208. deregisterInteractionHandler: function deregisterInteractionHandler(type, handler) {
  15209. return _this2.nativeControl_.removeEventListener(type, handler);
  15210. }
  15211. });
  15212. var foundation = new __WEBPACK_IMPORTED_MODULE_3__material_ripple_index__["MDCRippleFoundation"](adapter);
  15213. return new __WEBPACK_IMPORTED_MODULE_3__material_ripple_index__["MDCRipple"](this.root_, foundation);
  15214. }
  15215. /**
  15216. * Returns the state of the native control element, or null if the native control element is not present.
  15217. * @return {?MDCSelectionControlState}
  15218. * @private
  15219. */
  15220. }, {
  15221. key: 'destroy',
  15222. value: function destroy() {
  15223. this.ripple_.destroy();
  15224. _get(MDCRadio.prototype.__proto__ || Object.getPrototypeOf(MDCRadio.prototype), 'destroy', this).call(this);
  15225. }
  15226. /** @return {!MDCRadioFoundation} */
  15227. }, {
  15228. key: 'getDefaultFoundation',
  15229. value: function getDefaultFoundation() {
  15230. var _this3 = this;
  15231. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]({
  15232. addClass: function addClass(className) {
  15233. return _this3.root_.classList.add(className);
  15234. },
  15235. removeClass: function removeClass(className) {
  15236. return _this3.root_.classList.remove(className);
  15237. },
  15238. setNativeControlDisabled: function setNativeControlDisabled(disabled) {
  15239. return _this3.nativeControl_.disabled = disabled;
  15240. }
  15241. });
  15242. }
  15243. }, {
  15244. key: 'nativeControl_',
  15245. get: function get() {
  15246. var NATIVE_CONTROL_SELECTOR = __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.NATIVE_CONTROL_SELECTOR;
  15247. var el = /** @type {?MDCSelectionControlState} */this.root_.querySelector(NATIVE_CONTROL_SELECTOR);
  15248. return el;
  15249. }
  15250. }]);
  15251. return MDCRadio;
  15252. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  15253. /***/ }),
  15254. /* 114 */
  15255. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15256. "use strict";
  15257. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  15258. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_selection_control_index__ = __webpack_require__(4);
  15259. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__adapter__ = __webpack_require__(115);
  15260. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__constants__ = __webpack_require__(116);
  15261. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  15262. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15263. 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; }
  15264. 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; }
  15265. /**
  15266. * @license
  15267. * Copyright 2016 Google Inc.
  15268. *
  15269. * Permission is hereby granted, free of charge, to any person obtaining a copy
  15270. * of this software and associated documentation files (the "Software"), to deal
  15271. * in the Software without restriction, including without limitation the rights
  15272. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  15273. * copies of the Software, and to permit persons to whom the Software is
  15274. * furnished to do so, subject to the following conditions:
  15275. *
  15276. * The above copyright notice and this permission notice shall be included in
  15277. * all copies or substantial portions of the Software.
  15278. *
  15279. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15280. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15281. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  15282. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  15283. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  15284. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  15285. * THE SOFTWARE.
  15286. */
  15287. /* eslint-disable no-unused-vars */
  15288. /* eslint-enable no-unused-vars */
  15289. /**
  15290. * @extends {MDCFoundation<!MDCRadioAdapter>}
  15291. */
  15292. var MDCRadioFoundation = function (_MDCFoundation) {
  15293. _inherits(MDCRadioFoundation, _MDCFoundation);
  15294. function MDCRadioFoundation() {
  15295. _classCallCheck(this, MDCRadioFoundation);
  15296. return _possibleConstructorReturn(this, (MDCRadioFoundation.__proto__ || Object.getPrototypeOf(MDCRadioFoundation)).apply(this, arguments));
  15297. }
  15298. _createClass(MDCRadioFoundation, [{
  15299. key: 'setDisabled',
  15300. /** @param {boolean} disabled */
  15301. value: function setDisabled(disabled) {
  15302. var DISABLED = MDCRadioFoundation.cssClasses.DISABLED;
  15303. this.adapter_.setNativeControlDisabled(disabled);
  15304. if (disabled) {
  15305. this.adapter_.addClass(DISABLED);
  15306. } else {
  15307. this.adapter_.removeClass(DISABLED);
  15308. }
  15309. }
  15310. }], [{
  15311. key: 'cssClasses',
  15312. /** @return enum {cssClasses} */
  15313. get: function get() {
  15314. return __WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */];
  15315. }
  15316. /** @return enum {strings} */
  15317. }, {
  15318. key: 'strings',
  15319. get: function get() {
  15320. return __WEBPACK_IMPORTED_MODULE_3__constants__["b" /* strings */];
  15321. }
  15322. /** @return {!MDCRadioAdapter} */
  15323. }, {
  15324. key: 'defaultAdapter',
  15325. get: function get() {
  15326. return (/** @type {!MDCRadioAdapter} */{
  15327. addClass: function addClass() /* className: string */{},
  15328. removeClass: function removeClass() /* className: string */{},
  15329. setNativeControlDisabled: function setNativeControlDisabled() /* disabled: boolean */{}
  15330. }
  15331. );
  15332. }
  15333. }]);
  15334. return MDCRadioFoundation;
  15335. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  15336. /* harmony default export */ __webpack_exports__["a"] = (MDCRadioFoundation);
  15337. /***/ }),
  15338. /* 115 */
  15339. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15340. "use strict";
  15341. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_selection_control_index__ = __webpack_require__(4);
  15342. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  15343. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15344. /**
  15345. * @license
  15346. * Copyright 2016 Google Inc.
  15347. *
  15348. * Permission is hereby granted, free of charge, to any person obtaining a copy
  15349. * of this software and associated documentation files (the "Software"), to deal
  15350. * in the Software without restriction, including without limitation the rights
  15351. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  15352. * copies of the Software, and to permit persons to whom the Software is
  15353. * furnished to do so, subject to the following conditions:
  15354. *
  15355. * The above copyright notice and this permission notice shall be included in
  15356. * all copies or substantial portions of the Software.
  15357. *
  15358. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15359. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15360. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  15361. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  15362. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  15363. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  15364. * THE SOFTWARE.
  15365. */
  15366. /* eslint-disable no-unused-vars */
  15367. /* eslint no-unused-vars: [2, {"args": "none"}] */
  15368. /**
  15369. * Adapter for MDC Radio. Provides an interface for managing
  15370. * - classes
  15371. * - dom
  15372. *
  15373. * Additionally, provides type information for the adapter to the Closure
  15374. * compiler.
  15375. *
  15376. * Implement this adapter for your framework of choice to delegate updates to
  15377. * the component in your framework of choice. See architecture documentation
  15378. * for more details.
  15379. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  15380. *
  15381. * @record
  15382. */
  15383. var MDCRadioAdapter = function () {
  15384. function MDCRadioAdapter() {
  15385. _classCallCheck(this, MDCRadioAdapter);
  15386. }
  15387. _createClass(MDCRadioAdapter, [{
  15388. key: 'addClass',
  15389. /** @param {string} className */
  15390. value: function addClass(className) {}
  15391. /** @param {string} className */
  15392. }, {
  15393. key: 'removeClass',
  15394. value: function removeClass(className) {}
  15395. /** @param {boolean} disabled */
  15396. }, {
  15397. key: 'setNativeControlDisabled',
  15398. value: function setNativeControlDisabled(disabled) {}
  15399. }]);
  15400. return MDCRadioAdapter;
  15401. }();
  15402. /* unused harmony default export */ var _unused_webpack_default_export = (MDCRadioAdapter);
  15403. /***/ }),
  15404. /* 116 */
  15405. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15406. "use strict";
  15407. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  15408. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  15409. /**
  15410. * @license
  15411. * Copyright 2016 Google Inc.
  15412. *
  15413. * Permission is hereby granted, free of charge, to any person obtaining a copy
  15414. * of this software and associated documentation files (the "Software"), to deal
  15415. * in the Software without restriction, including without limitation the rights
  15416. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  15417. * copies of the Software, and to permit persons to whom the Software is
  15418. * furnished to do so, subject to the following conditions:
  15419. *
  15420. * The above copyright notice and this permission notice shall be included in
  15421. * all copies or substantial portions of the Software.
  15422. *
  15423. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15424. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15425. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  15426. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  15427. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  15428. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  15429. * THE SOFTWARE.
  15430. */
  15431. /** @enum {string} */
  15432. var strings = {
  15433. NATIVE_CONTROL_SELECTOR: '.mdc-radio__native-control'
  15434. };
  15435. /** @enum {string} */
  15436. var cssClasses = {
  15437. ROOT: 'mdc-radio',
  15438. DISABLED: 'mdc-radio--disabled'
  15439. };
  15440. /***/ }),
  15441. /* 117 */
  15442. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15443. "use strict";
  15444. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  15445. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSelect", function() { return MDCSelect; });
  15446. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_index__ = __webpack_require__(3);
  15447. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_floating_label_index__ = __webpack_require__(17);
  15448. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_line_ripple_index__ = __webpack_require__(18);
  15449. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_menu_index__ = __webpack_require__(43);
  15450. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__material_ripple_index__ = __webpack_require__(2);
  15451. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__material_notched_outline_index__ = __webpack_require__(22);
  15452. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__foundation__ = __webpack_require__(118);
  15453. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__constants__ = __webpack_require__(51);
  15454. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__adapter__ = __webpack_require__(48);
  15455. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__icon_index__ = __webpack_require__(23);
  15456. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__helper_text_index__ = __webpack_require__(24);
  15457. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__material_menu_surface_constants__ = __webpack_require__(21);
  15458. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__material_menu_constants__ = __webpack_require__(19);
  15459. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSelectFoundation", function() { return __WEBPACK_IMPORTED_MODULE_6__foundation__["a"]; });
  15460. 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; };
  15461. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  15462. 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); } };
  15463. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15464. 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; }
  15465. 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; }
  15466. /**
  15467. * @license
  15468. * Copyright 2016 Google Inc.
  15469. *
  15470. * Permission is hereby granted, free of charge, to any person obtaining a copy
  15471. * of this software and associated documentation files (the "Software"), to deal
  15472. * in the Software without restriction, including without limitation the rights
  15473. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  15474. * copies of the Software, and to permit persons to whom the Software is
  15475. * furnished to do so, subject to the following conditions:
  15476. *
  15477. * The above copyright notice and this permission notice shall be included in
  15478. * all copies or substantial portions of the Software.
  15479. *
  15480. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15481. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15482. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  15483. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  15484. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  15485. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  15486. * THE SOFTWARE.
  15487. */
  15488. /* eslint-disable no-unused-vars */
  15489. /* eslint-enable no-unused-vars */
  15490. // Closure has issues with {this as that} syntax.
  15491. var VALIDATION_ATTR_WHITELIST = ['required', 'aria-required'];
  15492. /**
  15493. * @extends MDCComponent<!MDCSelectFoundation>
  15494. */
  15495. var MDCSelect = function (_MDCComponent) {
  15496. _inherits(MDCSelect, _MDCComponent);
  15497. /**
  15498. * @param {...?} args
  15499. */
  15500. function MDCSelect() {
  15501. var _ref;
  15502. _classCallCheck(this, MDCSelect);
  15503. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  15504. args[_key] = arguments[_key];
  15505. }
  15506. /** @private {?Element} */
  15507. var _this = _possibleConstructorReturn(this, (_ref = MDCSelect.__proto__ || Object.getPrototypeOf(MDCSelect)).call.apply(_ref, [this].concat(args)));
  15508. _this.nativeControl_;
  15509. /** @private {?Element} */
  15510. _this.selectedText_;
  15511. /** @private {?Element} */
  15512. _this.hiddenInput_;
  15513. /** @private {?MDCSelectIcon} */
  15514. _this.leadingIcon_;
  15515. /** @private {?MDCSelectHelperText} */
  15516. _this.helperText_;
  15517. /** @private {?Element} */
  15518. _this.menuElement_;
  15519. /** @type {?MDCMenu} */
  15520. _this.menu_;
  15521. /** @type {?MDCRipple} */
  15522. _this.ripple;
  15523. /** @private {?MDCLineRipple} */
  15524. _this.lineRipple_;
  15525. /** @private {?MDCFloatingLabel} */
  15526. _this.label_;
  15527. /** @private {?MDCNotchedOutline} */
  15528. _this.outline_;
  15529. /** @private {!Function} */
  15530. _this.handleChange_;
  15531. /** @private {!Function} */
  15532. _this.handleFocus_;
  15533. /** @private {!Function} */
  15534. _this.handleBlur_;
  15535. /** @private {!Function} */
  15536. _this.handleClick_;
  15537. /** @private {!Function} */
  15538. _this.handleKeydown_;
  15539. /** @private {!Function} */
  15540. _this.handleMenuOpened_;
  15541. /** @private {!Function} */
  15542. _this.handleMenuClosed_;
  15543. /** @private {!Function} */
  15544. _this.handleMenuSelected_;
  15545. /** @private {boolean} */
  15546. _this.menuOpened_ = false;
  15547. /** @private {!MutationObserver} */
  15548. _this.validationObserver_;
  15549. return _this;
  15550. }
  15551. /**
  15552. * @param {!Element} root
  15553. * @return {!MDCSelect}
  15554. */
  15555. _createClass(MDCSelect, [{
  15556. key: 'layout',
  15557. /**
  15558. * Recomputes the outline SVG path for the outline element.
  15559. */
  15560. value: function layout() {
  15561. this.foundation_.layout();
  15562. }
  15563. /**
  15564. * @param {(function(!Element): !MDCLineRipple)=} lineRippleFactory A function which creates a new MDCLineRipple.
  15565. * @param {(function(!Element): !MDCFloatingLabel)=} labelFactory A function which creates a new MDCFloatingLabel.
  15566. * @param {(function(!Element): !MDCNotchedOutline)=} outlineFactory A function which creates a new MDCNotchedOutline.
  15567. * @param {(function(!Element): !MDCMenu)=} menuFactory A function which creates a new MDCMenu.
  15568. * @param {(function(!Element): !MDCSelectIcon)=} iconFactory A function which creates a new MDCSelectIcon.
  15569. * @param {(function(!Element): !MDCSelectHelperText)=} helperTextFactory A function which creates a new
  15570. * MDCSelectHelperText.
  15571. */
  15572. }, {
  15573. key: 'initialize',
  15574. value: function initialize() {
  15575. var labelFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (el) {
  15576. return new __WEBPACK_IMPORTED_MODULE_1__material_floating_label_index__["MDCFloatingLabel"](el);
  15577. };
  15578. var lineRippleFactory = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (el) {
  15579. return new __WEBPACK_IMPORTED_MODULE_2__material_line_ripple_index__["MDCLineRipple"](el);
  15580. };
  15581. var outlineFactory = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function (el) {
  15582. return new __WEBPACK_IMPORTED_MODULE_5__material_notched_outline_index__["MDCNotchedOutline"](el);
  15583. };
  15584. var menuFactory = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : function (el) {
  15585. return new __WEBPACK_IMPORTED_MODULE_3__material_menu_index__["MDCMenu"](el);
  15586. };
  15587. var iconFactory = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : function (el) {
  15588. return new __WEBPACK_IMPORTED_MODULE_9__icon_index__["a" /* MDCSelectIcon */](el);
  15589. };
  15590. var helperTextFactory = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : function (el) {
  15591. return new __WEBPACK_IMPORTED_MODULE_10__helper_text_index__["a" /* MDCSelectHelperText */](el);
  15592. };
  15593. this.nativeControl_ = /** @type {HTMLElement} */this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].NATIVE_CONTROL_SELECTOR);
  15594. this.selectedText_ = /** @type {HTMLElement} */this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].SELECTED_TEXT_SELECTOR);
  15595. if (this.selectedText_) {
  15596. this.enhancedSelectSetup_(menuFactory);
  15597. }
  15598. var labelElement = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].LABEL_SELECTOR);
  15599. if (labelElement) {
  15600. this.label_ = labelFactory(labelElement);
  15601. }
  15602. var lineRippleElement = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].LINE_RIPPLE_SELECTOR);
  15603. if (lineRippleElement) {
  15604. this.lineRipple_ = lineRippleFactory(lineRippleElement);
  15605. }
  15606. var outlineElement = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].OUTLINE_SELECTOR);
  15607. if (outlineElement) {
  15608. this.outline_ = outlineFactory(outlineElement);
  15609. }
  15610. var leadingIcon = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].LEADING_ICON_SELECTOR);
  15611. if (leadingIcon) {
  15612. this.root_.classList.add(__WEBPACK_IMPORTED_MODULE_7__constants__["a" /* cssClasses */].WITH_LEADING_ICON);
  15613. this.leadingIcon_ = iconFactory(leadingIcon);
  15614. if (this.menuElement_) {
  15615. this.menuElement_.classList.add(__WEBPACK_IMPORTED_MODULE_7__constants__["a" /* cssClasses */].WITH_LEADING_ICON);
  15616. }
  15617. }
  15618. var element = this.nativeControl_ ? this.nativeControl_ : this.selectedText_;
  15619. if (element.hasAttribute(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].ARIA_CONTROLS)) {
  15620. var helperTextElement = document.getElementById(element.getAttribute(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].ARIA_CONTROLS));
  15621. if (helperTextElement) {
  15622. this.helperText_ = helperTextFactory(helperTextElement);
  15623. }
  15624. }
  15625. if (!this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_7__constants__["a" /* cssClasses */].OUTLINED)) {
  15626. this.ripple = this.initRipple_();
  15627. }
  15628. // The required state needs to be sync'd before the mutation observer is added.
  15629. this.initialSyncRequiredState_();
  15630. this.addMutationObserverForRequired_();
  15631. }
  15632. /**
  15633. * Handles setup for the enhanced menu.
  15634. * @private
  15635. */
  15636. }, {
  15637. key: 'enhancedSelectSetup_',
  15638. value: function enhancedSelectSetup_(menuFactory) {
  15639. var isDisabled = this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_7__constants__["a" /* cssClasses */].DISABLED);
  15640. this.selectedText_.setAttribute('tabindex', isDisabled ? '-1' : '0');
  15641. this.hiddenInput_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].HIDDEN_INPUT_SELECTOR);
  15642. this.menuElement_ = /** @type {HTMLElement} */this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].MENU_SELECTOR);
  15643. this.menu_ = menuFactory(this.menuElement_);
  15644. this.menu_.hoistMenuToBody();
  15645. this.menu_.setAnchorElement( /** @type {!HTMLElement} */this.root_);
  15646. this.menu_.setAnchorCorner(__WEBPACK_IMPORTED_MODULE_11__material_menu_surface_constants__["a" /* Corner */].BOTTOM_START);
  15647. }
  15648. /**
  15649. * @private
  15650. * @return {!MDCRipple}
  15651. */
  15652. }, {
  15653. key: 'initRipple_',
  15654. value: function initRipple_() {
  15655. var element = this.nativeControl_ ? this.nativeControl_ : this.selectedText_;
  15656. var adapter = _extends(__WEBPACK_IMPORTED_MODULE_4__material_ripple_index__["MDCRipple"].createAdapter(this), {
  15657. registerInteractionHandler: function registerInteractionHandler(type, handler) {
  15658. return element.addEventListener(type, handler);
  15659. },
  15660. deregisterInteractionHandler: function deregisterInteractionHandler(type, handler) {
  15661. return element.removeEventListener(type, handler);
  15662. }
  15663. });
  15664. var foundation = new __WEBPACK_IMPORTED_MODULE_4__material_ripple_index__["MDCRippleFoundation"](adapter);
  15665. return new __WEBPACK_IMPORTED_MODULE_4__material_ripple_index__["MDCRipple"](this.root_, foundation);
  15666. }
  15667. /**
  15668. * Initializes the select's event listeners and internal state based
  15669. * on the environment's state.
  15670. */
  15671. }, {
  15672. key: 'initialSyncWithDOM',
  15673. value: function initialSyncWithDOM() {
  15674. var _this2 = this;
  15675. this.handleChange_ = function () {
  15676. return _this2.foundation_.handleChange( /* didChange */true);
  15677. };
  15678. this.handleFocus_ = function () {
  15679. return _this2.foundation_.handleFocus();
  15680. };
  15681. this.handleBlur_ = function () {
  15682. return _this2.foundation_.handleBlur();
  15683. };
  15684. this.handleClick_ = function (evt) {
  15685. if (_this2.selectedText_) _this2.selectedText_.focus();
  15686. _this2.foundation_.handleClick(_this2.getNormalizedXCoordinate_(evt));
  15687. };
  15688. this.handleKeydown_ = function (evt) {
  15689. return _this2.foundation_.handleKeydown(evt);
  15690. };
  15691. this.handleMenuSelected_ = function (evtData) {
  15692. return _this2.selectedIndex = evtData.detail.index;
  15693. };
  15694. this.handleMenuOpened_ = function () {
  15695. // Menu should open to the last selected element.
  15696. if (_this2.selectedIndex >= 0) {
  15697. _this2.menu_.items[_this2.selectedIndex].focus();
  15698. }
  15699. };
  15700. this.handleMenuClosed_ = function () {
  15701. // menuOpened_ is used to track the state of the menu opening or closing since the menu.open function
  15702. // will return false if the menu is still closing and this method listens to the closed event which
  15703. // occurs after the menu is already closed.
  15704. _this2.menuOpened_ = false;
  15705. _this2.selectedText_.removeAttribute('aria-expanded');
  15706. if (document.activeElement !== _this2.selectedText_) {
  15707. _this2.foundation_.handleBlur();
  15708. }
  15709. };
  15710. var element = this.nativeControl_ ? this.nativeControl_ : this.selectedText_;
  15711. element.addEventListener('change', this.handleChange_);
  15712. element.addEventListener('focus', this.handleFocus_);
  15713. element.addEventListener('blur', this.handleBlur_);
  15714. ['mousedown', 'touchstart'].forEach(function (evtType) {
  15715. element.addEventListener(evtType, _this2.handleClick_);
  15716. });
  15717. if (this.menuElement_) {
  15718. this.selectedText_.addEventListener('keydown', this.handleKeydown_);
  15719. this.menu_.listen(__WEBPACK_IMPORTED_MODULE_11__material_menu_surface_constants__["e" /* strings */].CLOSED_EVENT, this.handleMenuClosed_);
  15720. this.menu_.listen(__WEBPACK_IMPORTED_MODULE_11__material_menu_surface_constants__["e" /* strings */].OPENED_EVENT, this.handleMenuOpened_);
  15721. this.menu_.listen(__WEBPACK_IMPORTED_MODULE_12__material_menu_constants__["b" /* strings */].SELECTED_EVENT, this.handleMenuSelected_);
  15722. if (this.hiddenInput_ && this.hiddenInput_.value) {
  15723. // If the hidden input already has a value, use it to restore the select's value.
  15724. // This can happen e.g. if the user goes back or (in some browsers) refreshes the page.
  15725. var enhancedAdapterMethods = this.getEnhancedSelectAdapterMethods_();
  15726. enhancedAdapterMethods.setValue(this.hiddenInput_.value);
  15727. } else if (this.menuElement_.querySelector(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].SELECTED_ITEM_SELECTOR)) {
  15728. // If an element is selected, the select should set the initial selected text.
  15729. var _enhancedAdapterMethods = this.getEnhancedSelectAdapterMethods_();
  15730. _enhancedAdapterMethods.setValue(_enhancedAdapterMethods.getValue());
  15731. }
  15732. }
  15733. // Initially sync floating label
  15734. this.foundation_.handleChange( /* didChange */false);
  15735. if (this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_7__constants__["a" /* cssClasses */].DISABLED) || this.nativeControl_ && this.nativeControl_.disabled) {
  15736. this.disabled = true;
  15737. }
  15738. }
  15739. }, {
  15740. key: 'destroy',
  15741. value: function destroy() {
  15742. var _this3 = this;
  15743. var element = this.nativeControl_ ? this.nativeControl_ : this.selectedText_;
  15744. element.removeEventListener('change', this.handleChange_);
  15745. element.removeEventListener('focus', this.handleFocus_);
  15746. element.removeEventListener('blur', this.handleBlur_);
  15747. element.removeEventListener('keydown', this.handleKeydown_);
  15748. ['mousedown', 'touchstart'].forEach(function (evtType) {
  15749. element.removeEventListener(evtType, _this3.handleClick_);
  15750. });
  15751. if (this.menu_) {
  15752. this.menu_.unlisten(__WEBPACK_IMPORTED_MODULE_11__material_menu_surface_constants__["e" /* strings */].CLOSED_EVENT, this.handleMenuClosed_);
  15753. this.menu_.unlisten(__WEBPACK_IMPORTED_MODULE_11__material_menu_surface_constants__["e" /* strings */].OPENED_EVENT, this.handleMenuOpened_);
  15754. this.menu_.unlisten(__WEBPACK_IMPORTED_MODULE_12__material_menu_constants__["b" /* strings */].SELECTED_EVENT, this.handleMenuSelected_);
  15755. this.menu_.destroy();
  15756. }
  15757. if (this.ripple) {
  15758. this.ripple.destroy();
  15759. }
  15760. if (this.outline_) {
  15761. this.outline_.destroy();
  15762. }
  15763. if (this.leadingIcon_) {
  15764. this.leadingIcon_.destroy();
  15765. }
  15766. if (this.helperText_) {
  15767. this.helperText_.destroy();
  15768. }
  15769. if (this.validationObserver_) {
  15770. this.validationObserver_.disconnect();
  15771. }
  15772. _get(MDCSelect.prototype.__proto__ || Object.getPrototypeOf(MDCSelect.prototype), 'destroy', this).call(this);
  15773. }
  15774. /**
  15775. * @return {!MDCSelectFoundation}
  15776. */
  15777. }, {
  15778. key: 'getDefaultFoundation',
  15779. value: function getDefaultFoundation() {
  15780. return new __WEBPACK_IMPORTED_MODULE_6__foundation__["a" /* default */](
  15781. /** @type {!MDCSelectAdapter} */_extends(this.nativeControl_ ? this.getNativeSelectAdapterMethods_() : this.getEnhancedSelectAdapterMethods_(), this.getCommonAdapterMethods_(), this.getOutlineAdapterMethods_(), this.getLabelAdapterMethods_()), this.getFoundationMap_());
  15782. }
  15783. /**
  15784. * @return {!{
  15785. * getValue: function(): string,
  15786. * setValue: function(string): string,
  15787. * openMenu: function(): void,
  15788. * closeMenu: function(): void,
  15789. * isMenuOpen: function(): boolean,
  15790. * setSelectedIndex: function(number): void,
  15791. * setDisabled: function(boolean): void
  15792. * }}
  15793. * @private
  15794. */
  15795. }, {
  15796. key: 'getNativeSelectAdapterMethods_',
  15797. value: function getNativeSelectAdapterMethods_() {
  15798. var _this4 = this;
  15799. return {
  15800. getValue: function getValue() {
  15801. return _this4.nativeControl_.value;
  15802. },
  15803. setValue: function setValue(value) {
  15804. return _this4.nativeControl_.value = value;
  15805. },
  15806. openMenu: function openMenu() {},
  15807. closeMenu: function closeMenu() {},
  15808. isMenuOpen: function isMenuOpen() {
  15809. return false;
  15810. },
  15811. setSelectedIndex: function setSelectedIndex(index) {
  15812. _this4.nativeControl_.selectedIndex = index;
  15813. },
  15814. setDisabled: function setDisabled(isDisabled) {
  15815. return _this4.nativeControl_.disabled = isDisabled;
  15816. },
  15817. setValid: function setValid(isValid) {
  15818. 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);
  15819. },
  15820. checkValidity: function checkValidity() {
  15821. return _this4.nativeControl_.checkValidity();
  15822. }
  15823. };
  15824. }
  15825. /**
  15826. * @return {!{
  15827. * getValue: function(): string,
  15828. * setValue: function(string): string,
  15829. * openMenu: function(): void,
  15830. * closeMenu: function(): void,
  15831. * isMenuOpen: function(): boolean,
  15832. * setSelectedIndex: function(number): void,
  15833. * setDisabled: function(boolean): void
  15834. * }}
  15835. * @private
  15836. */
  15837. }, {
  15838. key: 'getEnhancedSelectAdapterMethods_',
  15839. value: function getEnhancedSelectAdapterMethods_() {
  15840. var _this5 = this;
  15841. return {
  15842. getValue: function getValue() {
  15843. var listItem = _this5.menuElement_.querySelector(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].SELECTED_ITEM_SELECTOR);
  15844. if (listItem && listItem.hasAttribute(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].ENHANCED_VALUE_ATTR)) {
  15845. return listItem.getAttribute(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].ENHANCED_VALUE_ATTR);
  15846. }
  15847. return '';
  15848. },
  15849. setValue: function setValue(value) {
  15850. var element =
  15851. /** @type {HTMLElement} */_this5.menuElement_.querySelector('[' + __WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].ENHANCED_VALUE_ATTR + '="' + value + '"]');
  15852. _this5.setEnhancedSelectedIndex_(element ? _this5.menu_.items.indexOf(element) : -1);
  15853. },
  15854. openMenu: function openMenu() {
  15855. if (_this5.menu_ && !_this5.menu_.open) {
  15856. _this5.menu_.open = true;
  15857. _this5.menuOpened_ = true;
  15858. _this5.selectedText_.setAttribute('aria-expanded', 'true');
  15859. }
  15860. },
  15861. closeMenu: function closeMenu() {
  15862. if (_this5.menu_ && _this5.menu_.open) {
  15863. _this5.menu_.open = false;
  15864. }
  15865. },
  15866. isMenuOpen: function isMenuOpen() {
  15867. return _this5.menu_ && _this5.menuOpened_;
  15868. },
  15869. setSelectedIndex: function setSelectedIndex(index) {
  15870. _this5.setEnhancedSelectedIndex_(index);
  15871. },
  15872. setDisabled: function setDisabled(isDisabled) {
  15873. _this5.selectedText_.setAttribute('tabindex', isDisabled ? '-1' : '0');
  15874. _this5.selectedText_.setAttribute('aria-disabled', isDisabled.toString());
  15875. if (_this5.hiddenInput_) {
  15876. _this5.hiddenInput_.disabled = isDisabled;
  15877. }
  15878. },
  15879. checkValidity: function checkValidity() {
  15880. var classList = _this5.root_.classList;
  15881. if (classList.contains(__WEBPACK_IMPORTED_MODULE_7__constants__["a" /* cssClasses */].REQUIRED) && !classList.contains(__WEBPACK_IMPORTED_MODULE_7__constants__["a" /* cssClasses */].DISABLED)) {
  15882. // See notes for required attribute under https://www.w3.org/TR/html52/sec-forms.html#the-select-element
  15883. // TL;DR: Invalid if no index is selected, or if the first index is selected and has an empty value.
  15884. return _this5.selectedIndex !== -1 && (_this5.selectedIndex !== 0 || _this5.value);
  15885. } else {
  15886. return true;
  15887. }
  15888. },
  15889. setValid: function setValid(isValid) {
  15890. _this5.selectedText_.setAttribute('aria-invalid', (!isValid).toString());
  15891. 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);
  15892. }
  15893. };
  15894. }
  15895. /**
  15896. * @return {!{
  15897. * addClass: function(string): void,
  15898. * removeClass: function(string): void,
  15899. * hasClass: function(string): void,
  15900. * isRtl: function(): boolean,
  15901. * setRippleCenter: function(number): void,
  15902. * activateBottomLine: function(): void,
  15903. * deactivateBottomLine: function(): void,
  15904. * notifyChange: function(string): void
  15905. * }}
  15906. * @private
  15907. */
  15908. }, {
  15909. key: 'getCommonAdapterMethods_',
  15910. value: function getCommonAdapterMethods_() {
  15911. var _this6 = this;
  15912. return {
  15913. addClass: function addClass(className) {
  15914. return _this6.root_.classList.add(className);
  15915. },
  15916. removeClass: function removeClass(className) {
  15917. return _this6.root_.classList.remove(className);
  15918. },
  15919. hasClass: function hasClass(className) {
  15920. return _this6.root_.classList.contains(className);
  15921. },
  15922. isRtl: function isRtl() {
  15923. return window.getComputedStyle(_this6.root_).getPropertyValue('direction') === 'rtl';
  15924. },
  15925. setRippleCenter: function setRippleCenter(normalizedX) {
  15926. return _this6.lineRipple_ && _this6.lineRipple_.setRippleCenter(normalizedX);
  15927. },
  15928. activateBottomLine: function activateBottomLine() {
  15929. return _this6.lineRipple_ && _this6.lineRipple_.activate();
  15930. },
  15931. deactivateBottomLine: function deactivateBottomLine() {
  15932. return _this6.lineRipple_ && _this6.lineRipple_.deactivate();
  15933. },
  15934. notifyChange: function notifyChange(value) {
  15935. var index = _this6.selectedIndex;
  15936. _this6.emit(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].CHANGE_EVENT, { value: value, index: index }, true /* shouldBubble */);
  15937. }
  15938. };
  15939. }
  15940. /**
  15941. * @return {!{
  15942. * hasOutline: function(): boolean,
  15943. * notchOutline: function(number, boolean): undefined,
  15944. * closeOutline: function(): undefined,
  15945. * }}
  15946. */
  15947. }, {
  15948. key: 'getOutlineAdapterMethods_',
  15949. value: function getOutlineAdapterMethods_() {
  15950. var _this7 = this;
  15951. return {
  15952. hasOutline: function hasOutline() {
  15953. return !!_this7.outline_;
  15954. },
  15955. notchOutline: function notchOutline(labelWidth, isRtl) {
  15956. if (_this7.outline_) {
  15957. _this7.outline_.notch(labelWidth, isRtl);
  15958. }
  15959. },
  15960. closeOutline: function closeOutline() {
  15961. if (_this7.outline_) {
  15962. _this7.outline_.closeNotch();
  15963. }
  15964. }
  15965. };
  15966. }
  15967. /**
  15968. * @return {!{
  15969. * floatLabel: function(boolean): undefined,
  15970. * getLabelWidth: function(): number,
  15971. * }}
  15972. */
  15973. }, {
  15974. key: 'getLabelAdapterMethods_',
  15975. value: function getLabelAdapterMethods_() {
  15976. var _this8 = this;
  15977. return {
  15978. floatLabel: function floatLabel(shouldFloat) {
  15979. if (_this8.label_) {
  15980. _this8.label_.float(shouldFloat);
  15981. }
  15982. },
  15983. getLabelWidth: function getLabelWidth() {
  15984. return _this8.label_ ? _this8.label_.getWidth() : 0;
  15985. }
  15986. };
  15987. }
  15988. /**
  15989. * Calculates where the line ripple should start based on the x coordinate within the component.
  15990. * @param {!(MouseEvent|TouchEvent)} evt
  15991. * @return {number} normalizedX
  15992. */
  15993. }, {
  15994. key: 'getNormalizedXCoordinate_',
  15995. value: function getNormalizedXCoordinate_(evt) {
  15996. var targetClientRect = evt.target.getBoundingClientRect();
  15997. var xCoordinate = evt.clientX;
  15998. return xCoordinate - targetClientRect.left;
  15999. }
  16000. /**
  16001. * Returns a map of all subcomponents to subfoundations.
  16002. * @return {!FoundationMapType}
  16003. */
  16004. }, {
  16005. key: 'getFoundationMap_',
  16006. value: function getFoundationMap_() {
  16007. return {
  16008. leadingIcon: this.leadingIcon_ ? this.leadingIcon_.foundation : undefined,
  16009. helperText: this.helperText_ ? this.helperText_.foundation : undefined
  16010. };
  16011. }
  16012. /**
  16013. * Sets the selected index of the enhanced menu.
  16014. * @param {number} index
  16015. * @private
  16016. */
  16017. }, {
  16018. key: 'setEnhancedSelectedIndex_',
  16019. value: function setEnhancedSelectedIndex_(index) {
  16020. var selectedItem = this.menu_.items[index];
  16021. this.selectedText_.textContent = selectedItem ? selectedItem.textContent.trim() : '';
  16022. var previouslySelected = this.menuElement_.querySelector(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].SELECTED_ITEM_SELECTOR);
  16023. if (previouslySelected) {
  16024. previouslySelected.classList.remove(__WEBPACK_IMPORTED_MODULE_7__constants__["a" /* cssClasses */].SELECTED_ITEM_CLASS);
  16025. previouslySelected.removeAttribute(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].ARIA_SELECTED_ATTR);
  16026. }
  16027. if (selectedItem) {
  16028. selectedItem.classList.add(__WEBPACK_IMPORTED_MODULE_7__constants__["a" /* cssClasses */].SELECTED_ITEM_CLASS);
  16029. selectedItem.setAttribute(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].ARIA_SELECTED_ATTR, 'true');
  16030. }
  16031. // Synchronize hidden input's value with data-value attribute of selected item.
  16032. // This code path is also followed when setting value directly, so this covers all cases.
  16033. if (this.hiddenInput_) {
  16034. this.hiddenInput_.value = selectedItem ? selectedItem.getAttribute(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].ENHANCED_VALUE_ATTR) || '' : '';
  16035. }
  16036. this.layout();
  16037. }
  16038. }, {
  16039. key: 'initialSyncRequiredState_',
  16040. value: function initialSyncRequiredState_() {
  16041. var element = this.nativeControl_ ? this.nativeControl_ : this.selectedText_;
  16042. var isRequired = element.required || element.getAttribute('aria-required') === 'true' || this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_7__constants__["a" /* cssClasses */].REQUIRED);
  16043. if (isRequired) {
  16044. if (this.nativeControl_) {
  16045. this.nativeControl_.required = true;
  16046. } else {
  16047. this.selectedText_.setAttribute('aria-required', 'true');
  16048. }
  16049. this.root_.classList.add(__WEBPACK_IMPORTED_MODULE_7__constants__["a" /* cssClasses */].REQUIRED);
  16050. }
  16051. }
  16052. }, {
  16053. key: 'addMutationObserverForRequired_',
  16054. value: function addMutationObserverForRequired_() {
  16055. var _this9 = this;
  16056. var observerHandler = function observerHandler(attributesList) {
  16057. attributesList.some(function (attributeName) {
  16058. if (VALIDATION_ATTR_WHITELIST.indexOf(attributeName) > -1) {
  16059. if (_this9.selectedText_) {
  16060. if (_this9.selectedText_.getAttribute('aria-required') === 'true') {
  16061. _this9.root_.classList.add(__WEBPACK_IMPORTED_MODULE_7__constants__["a" /* cssClasses */].REQUIRED);
  16062. } else {
  16063. _this9.root_.classList.remove(__WEBPACK_IMPORTED_MODULE_7__constants__["a" /* cssClasses */].REQUIRED);
  16064. }
  16065. } else {
  16066. if (_this9.nativeControl_.required) {
  16067. _this9.root_.classList.add(__WEBPACK_IMPORTED_MODULE_7__constants__["a" /* cssClasses */].REQUIRED);
  16068. } else {
  16069. _this9.root_.classList.remove(__WEBPACK_IMPORTED_MODULE_7__constants__["a" /* cssClasses */].REQUIRED);
  16070. }
  16071. }
  16072. return true;
  16073. }
  16074. });
  16075. };
  16076. var getAttributesList = function getAttributesList(mutationsList) {
  16077. return mutationsList.map(function (mutation) {
  16078. return mutation.attributeName;
  16079. });
  16080. };
  16081. var observer = new MutationObserver(function (mutationsList) {
  16082. return observerHandler(getAttributesList(mutationsList));
  16083. });
  16084. var element = this.nativeControl_ ? this.nativeControl_ : this.selectedText_;
  16085. observer.observe(element, { attributes: true });
  16086. this.validationObserver_ = observer;
  16087. }
  16088. }, {
  16089. key: 'value',
  16090. /**
  16091. * @return {string} The value of the select.
  16092. */
  16093. get: function get() {
  16094. return this.foundation_.getValue();
  16095. }
  16096. /**
  16097. * @param {string} value The value to set on the select.
  16098. */
  16099. ,
  16100. set: function set(value) {
  16101. this.foundation_.setValue(value);
  16102. }
  16103. /**
  16104. * @return {number} The selected index of the select.
  16105. */
  16106. }, {
  16107. key: 'selectedIndex',
  16108. get: function get() {
  16109. var selectedIndex = void 0;
  16110. if (this.menuElement_) {
  16111. var selectedEl = /** @type {!HTMLElement} */this.menuElement_.querySelector(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].SELECTED_ITEM_SELECTOR);
  16112. selectedIndex = this.menu_.items.indexOf(selectedEl);
  16113. } else {
  16114. selectedIndex = this.nativeControl_.selectedIndex;
  16115. }
  16116. return selectedIndex;
  16117. }
  16118. /**
  16119. * @param {number} selectedIndex The index of the option to be set on the select.
  16120. */
  16121. ,
  16122. set: function set(selectedIndex) {
  16123. this.foundation_.setSelectedIndex(selectedIndex);
  16124. }
  16125. /**
  16126. * @return {boolean} True if the select is disabled.
  16127. */
  16128. }, {
  16129. key: 'disabled',
  16130. get: function get() {
  16131. return this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_7__constants__["a" /* cssClasses */].DISABLED) || (this.nativeControl_ ? this.nativeControl_.disabled : false);
  16132. }
  16133. /**
  16134. * @param {boolean} disabled Sets the select disabled or enabled.
  16135. */
  16136. ,
  16137. set: function set(disabled) {
  16138. this.foundation_.setDisabled(disabled);
  16139. }
  16140. /**
  16141. * Sets the aria label of the leading icon.
  16142. * @param {string} label
  16143. */
  16144. }, {
  16145. key: 'leadingIconAriaLabel',
  16146. set: function set(label) {
  16147. this.foundation_.setLeadingIconAriaLabel(label);
  16148. }
  16149. /**
  16150. * Sets the text content of the leading icon.
  16151. * @param {string} content
  16152. */
  16153. }, {
  16154. key: 'leadingIconContent',
  16155. set: function set(content) {
  16156. this.foundation_.setLeadingIconContent(content);
  16157. }
  16158. /**
  16159. * Sets the text content of the helper text.
  16160. * @param {string} content
  16161. */
  16162. }, {
  16163. key: 'helperTextContent',
  16164. set: function set(content) {
  16165. this.foundation_.setHelperTextContent(content);
  16166. }
  16167. /**
  16168. * Sets the current invalid state of the select.
  16169. * @param {boolean} isValid
  16170. */
  16171. }, {
  16172. key: 'valid',
  16173. set: function set(isValid) {
  16174. this.foundation_.setValid(isValid);
  16175. }
  16176. /**
  16177. * Checks if the select is in a valid state.
  16178. * @return {boolean}
  16179. */
  16180. ,
  16181. get: function get() {
  16182. return this.foundation_.isValid();
  16183. }
  16184. /**
  16185. * Sets the control to the required state.
  16186. * @param {boolean} isRequired
  16187. */
  16188. }, {
  16189. key: 'required',
  16190. set: function set(isRequired) {
  16191. if (this.nativeControl_) {
  16192. this.nativeControl_.required = isRequired;
  16193. } else {
  16194. if (isRequired) {
  16195. this.selectedText_.setAttribute('aria-required', isRequired.toString());
  16196. } else {
  16197. this.selectedText_.removeAttribute('aria-required');
  16198. }
  16199. }
  16200. }
  16201. /**
  16202. * Returns whether the select is required.
  16203. * @return {boolean}
  16204. */
  16205. ,
  16206. get: function get() {
  16207. if (this.nativeControl_) {
  16208. return this.nativeControl_.required;
  16209. } else {
  16210. return this.selectedText_.getAttribute('aria-required') === 'true';
  16211. }
  16212. }
  16213. }], [{
  16214. key: 'attachTo',
  16215. value: function attachTo(root) {
  16216. return new MDCSelect(root);
  16217. }
  16218. }]);
  16219. return MDCSelect;
  16220. }(__WEBPACK_IMPORTED_MODULE_0__material_base_index__["MDCComponent"]);
  16221. /***/ }),
  16222. /* 118 */
  16223. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16224. "use strict";
  16225. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_index__ = __webpack_require__(3);
  16226. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(48);
  16227. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__icon_index__ = __webpack_require__(23);
  16228. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__helper_text_index__ = __webpack_require__(24);
  16229. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__constants__ = __webpack_require__(51);
  16230. 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; };
  16231. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  16232. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  16233. 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; }
  16234. 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; }
  16235. /**
  16236. * @license
  16237. * Copyright 2016 Google Inc.
  16238. *
  16239. * Permission is hereby granted, free of charge, to any person obtaining a copy
  16240. * of this software and associated documentation files (the "Software"), to deal
  16241. * in the Software without restriction, including without limitation the rights
  16242. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  16243. * copies of the Software, and to permit persons to whom the Software is
  16244. * furnished to do so, subject to the following conditions:
  16245. *
  16246. * The above copyright notice and this permission notice shall be included in
  16247. * all copies or substantial portions of the Software.
  16248. *
  16249. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16250. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16251. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  16252. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  16253. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  16254. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  16255. * THE SOFTWARE.
  16256. */
  16257. /* eslint-disable no-unused-vars */
  16258. /* eslint-enable no-unused-vars */
  16259. /**
  16260. * @extends {MDCFoundation<!MDCSelectAdapter>}
  16261. * @final
  16262. */
  16263. var MDCSelectFoundation = function (_MDCFoundation) {
  16264. _inherits(MDCSelectFoundation, _MDCFoundation);
  16265. _createClass(MDCSelectFoundation, null, [{
  16266. key: 'cssClasses',
  16267. /** @return enum {string} */
  16268. get: function get() {
  16269. return __WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */];
  16270. }
  16271. /** @return enum {number} */
  16272. }, {
  16273. key: 'numbers',
  16274. get: function get() {
  16275. return __WEBPACK_IMPORTED_MODULE_4__constants__["b" /* numbers */];
  16276. }
  16277. /** @return enum {string} */
  16278. }, {
  16279. key: 'strings',
  16280. get: function get() {
  16281. return __WEBPACK_IMPORTED_MODULE_4__constants__["c" /* strings */];
  16282. }
  16283. /**
  16284. * {@see MDCSelectAdapter} for typing information on parameters and return
  16285. * types.
  16286. * @return {!MDCSelectAdapter}
  16287. */
  16288. }, {
  16289. key: 'defaultAdapter',
  16290. get: function get() {
  16291. return (/** @type {!MDCSelectAdapter} */{
  16292. addClass: function addClass() /* className: string */{},
  16293. removeClass: function removeClass() /* className: string */{},
  16294. hasClass: function hasClass() {
  16295. return (/* className: string */false
  16296. );
  16297. },
  16298. activateBottomLine: function activateBottomLine() {},
  16299. deactivateBottomLine: function deactivateBottomLine() {},
  16300. setValue: function setValue() {},
  16301. getValue: function getValue() {},
  16302. isRtl: function isRtl() {
  16303. return false;
  16304. },
  16305. floatLabel: function floatLabel() /* value: boolean */{},
  16306. getLabelWidth: function getLabelWidth() {},
  16307. hasOutline: function hasOutline() {
  16308. return false;
  16309. },
  16310. notchOutline: function notchOutline() /* labelWidth: number, isRtl: boolean */{},
  16311. closeOutline: function closeOutline() {},
  16312. openMenu: function openMenu() {},
  16313. closeMenu: function closeMenu() {},
  16314. isMenuOpen: function isMenuOpen() {},
  16315. setSelectedIndex: function setSelectedIndex() {},
  16316. setDisabled: function setDisabled() {},
  16317. setRippleCenter: function setRippleCenter() {},
  16318. notifyChange: function notifyChange() {},
  16319. checkValidity: function checkValidity() {},
  16320. setValid: function setValid() {}
  16321. }
  16322. );
  16323. }
  16324. /**
  16325. * @param {!MDCSelectAdapter} adapter
  16326. * @param {!FoundationMapType=} foundationMap Map from subcomponent names to their subfoundations.
  16327. */
  16328. }]);
  16329. function MDCSelectFoundation(adapter) {
  16330. var foundationMap = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : /** @type {!FoundationMapType} */{};
  16331. _classCallCheck(this, MDCSelectFoundation);
  16332. /** @type {!MDCSelectIconFoundation|undefined} */
  16333. var _this = _possibleConstructorReturn(this, (MDCSelectFoundation.__proto__ || Object.getPrototypeOf(MDCSelectFoundation)).call(this, _extends(MDCSelectFoundation.defaultAdapter, adapter)));
  16334. _this.leadingIcon_ = foundationMap.leadingIcon;
  16335. /** @type {!MDCSelectHelperTextFoundation|undefined} */
  16336. _this.helperText_ = foundationMap.helperText;
  16337. return _this;
  16338. }
  16339. _createClass(MDCSelectFoundation, [{
  16340. key: 'setSelectedIndex',
  16341. value: function setSelectedIndex(index) {
  16342. this.adapter_.setSelectedIndex(index);
  16343. this.adapter_.closeMenu();
  16344. var didChange = true;
  16345. this.handleChange(didChange);
  16346. }
  16347. }, {
  16348. key: 'setValue',
  16349. value: function setValue(value) {
  16350. this.adapter_.setValue(value);
  16351. var didChange = true;
  16352. this.handleChange(didChange);
  16353. }
  16354. }, {
  16355. key: 'getValue',
  16356. value: function getValue() {
  16357. return this.adapter_.getValue();
  16358. }
  16359. }, {
  16360. key: 'setDisabled',
  16361. value: function setDisabled(isDisabled) {
  16362. isDisabled ? this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */].DISABLED) : this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */].DISABLED);
  16363. this.adapter_.setDisabled(isDisabled);
  16364. this.adapter_.closeMenu();
  16365. if (this.leadingIcon_) {
  16366. this.leadingIcon_.setDisabled(isDisabled);
  16367. }
  16368. }
  16369. /**
  16370. * @param {string} content Sets the content of the helper text.
  16371. */
  16372. }, {
  16373. key: 'setHelperTextContent',
  16374. value: function setHelperTextContent(content) {
  16375. if (this.helperText_) {
  16376. this.helperText_.setContent(content);
  16377. }
  16378. }
  16379. }, {
  16380. key: 'layout',
  16381. value: function layout() {
  16382. var openNotch = this.getValue().length > 0;
  16383. this.notchOutline(openNotch);
  16384. }
  16385. /**
  16386. * Handles value changes, via change event or programmatic updates.
  16387. */
  16388. }, {
  16389. key: 'handleChange',
  16390. value: function handleChange() {
  16391. var didChange = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
  16392. var value = this.getValue();
  16393. var optionHasValue = value.length > 0;
  16394. var isRequired = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */].REQUIRED);
  16395. this.notchOutline(optionHasValue);
  16396. if (!this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */].FOCUSED)) {
  16397. this.adapter_.floatLabel(optionHasValue);
  16398. }
  16399. if (didChange) {
  16400. this.adapter_.notifyChange(value);
  16401. if (isRequired) {
  16402. this.setValid(this.isValid());
  16403. if (this.helperText_) {
  16404. this.helperText_.setValidity(this.isValid());
  16405. }
  16406. }
  16407. }
  16408. }
  16409. /**
  16410. * Handles focus events from select element.
  16411. */
  16412. }, {
  16413. key: 'handleFocus',
  16414. value: function handleFocus() {
  16415. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */].FOCUSED);
  16416. this.adapter_.floatLabel(true);
  16417. this.notchOutline(true);
  16418. this.adapter_.activateBottomLine();
  16419. if (this.helperText_) {
  16420. this.helperText_.showToScreenReader();
  16421. }
  16422. }
  16423. /**
  16424. * Handles blur events from select element.
  16425. */
  16426. }, {
  16427. key: 'handleBlur',
  16428. value: function handleBlur() {
  16429. if (this.adapter_.isMenuOpen()) return;
  16430. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */].FOCUSED);
  16431. this.handleChange(false);
  16432. this.adapter_.deactivateBottomLine();
  16433. var isRequired = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */].REQUIRED);
  16434. if (isRequired) {
  16435. this.setValid(this.isValid());
  16436. if (this.helperText_) {
  16437. this.helperText_.setValidity(this.isValid());
  16438. }
  16439. }
  16440. }
  16441. }, {
  16442. key: 'handleClick',
  16443. value: function handleClick(normalizedX) {
  16444. if (this.adapter_.isMenuOpen()) return;
  16445. this.adapter_.setRippleCenter(normalizedX);
  16446. this.adapter_.openMenu();
  16447. }
  16448. }, {
  16449. key: 'handleKeydown',
  16450. value: function handleKeydown(event) {
  16451. if (this.adapter_.isMenuOpen()) return;
  16452. var isEnter = event.key === 'Enter' || event.keyCode === 13;
  16453. var isSpace = event.key === 'Space' || event.keyCode === 32;
  16454. var arrowUp = event.key === 'ArrowUp' || event.keyCode === 38;
  16455. var arrowDown = event.key === 'ArrowDown' || event.keyCode === 40;
  16456. if (this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */].FOCUSED) && (isEnter || isSpace || arrowUp || arrowDown)) {
  16457. this.adapter_.openMenu();
  16458. event.preventDefault();
  16459. }
  16460. }
  16461. /**
  16462. * Opens/closes the notched outline.
  16463. * @param {boolean} openNotch
  16464. */
  16465. }, {
  16466. key: 'notchOutline',
  16467. value: function notchOutline(openNotch) {
  16468. if (!this.adapter_.hasOutline()) {
  16469. return;
  16470. }
  16471. var isFocused = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */].FOCUSED);
  16472. if (openNotch) {
  16473. var labelScale = __WEBPACK_IMPORTED_MODULE_4__constants__["b" /* numbers */].LABEL_SCALE;
  16474. var labelWidth = this.adapter_.getLabelWidth() * labelScale;
  16475. var isRtl = this.adapter_.isRtl();
  16476. this.adapter_.notchOutline(labelWidth, isRtl);
  16477. } else if (!isFocused) {
  16478. this.adapter_.closeOutline();
  16479. }
  16480. }
  16481. /**
  16482. * Sets the aria label of the leading icon.
  16483. * @param {string} label
  16484. */
  16485. }, {
  16486. key: 'setLeadingIconAriaLabel',
  16487. value: function setLeadingIconAriaLabel(label) {
  16488. if (this.leadingIcon_) {
  16489. this.leadingIcon_.setAriaLabel(label);
  16490. }
  16491. }
  16492. /**
  16493. * Sets the text content of the leading icon.
  16494. * @param {string} content
  16495. */
  16496. }, {
  16497. key: 'setLeadingIconContent',
  16498. value: function setLeadingIconContent(content) {
  16499. if (this.leadingIcon_) {
  16500. this.leadingIcon_.setContent(content);
  16501. }
  16502. }
  16503. }, {
  16504. key: 'setValid',
  16505. value: function setValid(isValid) {
  16506. this.adapter_.setValid(isValid);
  16507. }
  16508. }, {
  16509. key: 'isValid',
  16510. value: function isValid() {
  16511. return this.adapter_.checkValidity();
  16512. }
  16513. }]);
  16514. return MDCSelectFoundation;
  16515. }(__WEBPACK_IMPORTED_MODULE_0__material_base_index__["MDCFoundation"]);
  16516. /* harmony default export */ __webpack_exports__["a"] = (MDCSelectFoundation);
  16517. /***/ }),
  16518. /* 119 */
  16519. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16520. "use strict";
  16521. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  16522. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(49);
  16523. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(120);
  16524. 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; };
  16525. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  16526. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  16527. 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; }
  16528. 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; }
  16529. /**
  16530. * @license
  16531. * Copyright 2018 Google Inc.
  16532. *
  16533. * Permission is hereby granted, free of charge, to any person obtaining a copy
  16534. * of this software and associated documentation files (the "Software"), to deal
  16535. * in the Software without restriction, including without limitation the rights
  16536. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  16537. * copies of the Software, and to permit persons to whom the Software is
  16538. * furnished to do so, subject to the following conditions:
  16539. *
  16540. * The above copyright notice and this permission notice shall be included in
  16541. * all copies or substantial portions of the Software.
  16542. *
  16543. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16544. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16545. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  16546. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  16547. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  16548. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  16549. * THE SOFTWARE.
  16550. */
  16551. /**
  16552. * @extends {MDCFoundation<!MDCSelectIconAdapter>}
  16553. * @final
  16554. */
  16555. var MDCSelectIconFoundation = function (_MDCFoundation) {
  16556. _inherits(MDCSelectIconFoundation, _MDCFoundation);
  16557. _createClass(MDCSelectIconFoundation, null, [{
  16558. key: 'strings',
  16559. /** @return enum {string} */
  16560. get: function get() {
  16561. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* strings */];
  16562. }
  16563. /**
  16564. * {@see MDCSelectIconAdapter} for typing information on parameters and return
  16565. * types.
  16566. * @return {!MDCSelectIconAdapter}
  16567. */
  16568. }, {
  16569. key: 'defaultAdapter',
  16570. get: function get() {
  16571. return (/** @type {!MDCSelectIconAdapter} */{
  16572. getAttr: function getAttr() {},
  16573. setAttr: function setAttr() {},
  16574. removeAttr: function removeAttr() {},
  16575. setContent: function setContent() {},
  16576. registerInteractionHandler: function registerInteractionHandler() {},
  16577. deregisterInteractionHandler: function deregisterInteractionHandler() {},
  16578. notifyIconAction: function notifyIconAction() {}
  16579. }
  16580. );
  16581. }
  16582. /**
  16583. * @param {!MDCSelectIconAdapter} adapter
  16584. */
  16585. }]);
  16586. function MDCSelectIconFoundation(adapter) {
  16587. _classCallCheck(this, MDCSelectIconFoundation);
  16588. /** @private {string?} */
  16589. var _this = _possibleConstructorReturn(this, (MDCSelectIconFoundation.__proto__ || Object.getPrototypeOf(MDCSelectIconFoundation)).call(this, _extends(MDCSelectIconFoundation.defaultAdapter, adapter)));
  16590. _this.savedTabIndex_ = null;
  16591. /** @private {function(!Event): undefined} */
  16592. _this.interactionHandler_ = function (evt) {
  16593. return _this.handleInteraction(evt);
  16594. };
  16595. return _this;
  16596. }
  16597. _createClass(MDCSelectIconFoundation, [{
  16598. key: 'init',
  16599. value: function init() {
  16600. var _this2 = this;
  16601. this.savedTabIndex_ = this.adapter_.getAttr('tabindex');
  16602. ['click', 'keydown'].forEach(function (evtType) {
  16603. _this2.adapter_.registerInteractionHandler(evtType, _this2.interactionHandler_);
  16604. });
  16605. }
  16606. }, {
  16607. key: 'destroy',
  16608. value: function destroy() {
  16609. var _this3 = this;
  16610. ['click', 'keydown'].forEach(function (evtType) {
  16611. _this3.adapter_.deregisterInteractionHandler(evtType, _this3.interactionHandler_);
  16612. });
  16613. }
  16614. /** @param {boolean} disabled */
  16615. }, {
  16616. key: 'setDisabled',
  16617. value: function setDisabled(disabled) {
  16618. if (!this.savedTabIndex_) {
  16619. return;
  16620. }
  16621. if (disabled) {
  16622. this.adapter_.setAttr('tabindex', '-1');
  16623. this.adapter_.removeAttr('role');
  16624. } else {
  16625. this.adapter_.setAttr('tabindex', this.savedTabIndex_);
  16626. this.adapter_.setAttr('role', __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* strings */].ICON_ROLE);
  16627. }
  16628. }
  16629. /** @param {string} label */
  16630. }, {
  16631. key: 'setAriaLabel',
  16632. value: function setAriaLabel(label) {
  16633. this.adapter_.setAttr('aria-label', label);
  16634. }
  16635. /** @param {string} content */
  16636. }, {
  16637. key: 'setContent',
  16638. value: function setContent(content) {
  16639. this.adapter_.setContent(content);
  16640. }
  16641. /**
  16642. * Handles an interaction event
  16643. * @param {!Event} evt
  16644. */
  16645. }, {
  16646. key: 'handleInteraction',
  16647. value: function handleInteraction(evt) {
  16648. if (evt.type === 'click' || evt.key === 'Enter' || evt.keyCode === 13) {
  16649. this.adapter_.notifyIconAction();
  16650. }
  16651. }
  16652. }]);
  16653. return MDCSelectIconFoundation;
  16654. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  16655. /* harmony default export */ __webpack_exports__["a"] = (MDCSelectIconFoundation);
  16656. /***/ }),
  16657. /* 120 */
  16658. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16659. "use strict";
  16660. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return strings; });
  16661. /**
  16662. * @license
  16663. * Copyright 2018 Google Inc.
  16664. *
  16665. * Permission is hereby granted, free of charge, to any person obtaining a copy
  16666. * of this software and associated documentation files (the "Software"), to deal
  16667. * in the Software without restriction, including without limitation the rights
  16668. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  16669. * copies of the Software, and to permit persons to whom the Software is
  16670. * furnished to do so, subject to the following conditions:
  16671. *
  16672. * The above copyright notice and this permission notice shall be included in
  16673. * all copies or substantial portions of the Software.
  16674. *
  16675. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16676. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16677. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  16678. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  16679. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  16680. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  16681. * THE SOFTWARE.
  16682. */
  16683. /** @enum {string} */
  16684. var strings = {
  16685. ICON_EVENT: 'MDCSelect:icon',
  16686. ICON_ROLE: 'button'
  16687. };
  16688. /***/ }),
  16689. /* 121 */
  16690. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16691. "use strict";
  16692. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  16693. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(50);
  16694. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(122);
  16695. 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; };
  16696. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  16697. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  16698. 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; }
  16699. 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; }
  16700. /**
  16701. * @license
  16702. * Copyright 2018 Google Inc.
  16703. *
  16704. * Permission is hereby granted, free of charge, to any person obtaining a copy
  16705. * of this software and associated documentation files (the "Software"), to deal
  16706. * in the Software without restriction, including without limitation the rights
  16707. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  16708. * copies of the Software, and to permit persons to whom the Software is
  16709. * furnished to do so, subject to the following conditions:
  16710. *
  16711. * The above copyright notice and this permission notice shall be included in
  16712. * all copies or substantial portions of the Software.
  16713. *
  16714. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16715. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16716. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  16717. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  16718. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  16719. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  16720. * THE SOFTWARE.
  16721. */
  16722. /**
  16723. * @extends {MDCFoundation<!MDCSelectHelperTextAdapter>}
  16724. * @final
  16725. */
  16726. var MDCSelectHelperTextFoundation = function (_MDCFoundation) {
  16727. _inherits(MDCSelectHelperTextFoundation, _MDCFoundation);
  16728. _createClass(MDCSelectHelperTextFoundation, null, [{
  16729. key: 'cssClasses',
  16730. /** @return enum {string} */
  16731. get: function get() {
  16732. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  16733. }
  16734. /** @return enum {string} */
  16735. }, {
  16736. key: 'strings',
  16737. get: function get() {
  16738. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  16739. }
  16740. /**
  16741. * {@see MDCSelectHelperTextAdapter} for typing information on parameters and return
  16742. * types.
  16743. * @return {!MDCSelectHelperTextAdapter}
  16744. */
  16745. }, {
  16746. key: 'defaultAdapter',
  16747. get: function get() {
  16748. return (/** @type {!MDCSelectHelperTextAdapter} */{
  16749. addClass: function addClass() {},
  16750. removeClass: function removeClass() {},
  16751. hasClass: function hasClass() {},
  16752. setAttr: function setAttr() {},
  16753. removeAttr: function removeAttr() {},
  16754. setContent: function setContent() {}
  16755. }
  16756. );
  16757. }
  16758. /**
  16759. * @param {!MDCSelectHelperTextAdapter} adapter
  16760. */
  16761. }]);
  16762. function MDCSelectHelperTextFoundation(adapter) {
  16763. _classCallCheck(this, MDCSelectHelperTextFoundation);
  16764. return _possibleConstructorReturn(this, (MDCSelectHelperTextFoundation.__proto__ || Object.getPrototypeOf(MDCSelectHelperTextFoundation)).call(this, _extends(MDCSelectHelperTextFoundation.defaultAdapter, adapter)));
  16765. }
  16766. /**
  16767. * Sets the content of the helper text field.
  16768. * @param {string} content
  16769. */
  16770. _createClass(MDCSelectHelperTextFoundation, [{
  16771. key: 'setContent',
  16772. value: function setContent(content) {
  16773. this.adapter_.setContent(content);
  16774. }
  16775. /** @param {boolean} isPersistent Sets the persistency of the helper text. */
  16776. }, {
  16777. key: 'setPersistent',
  16778. value: function setPersistent(isPersistent) {
  16779. if (isPersistent) {
  16780. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_PERSISTENT);
  16781. } else {
  16782. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_PERSISTENT);
  16783. }
  16784. }
  16785. /**
  16786. * @param {boolean} isValidation True to make the helper text act as an
  16787. * error validation message.
  16788. */
  16789. }, {
  16790. key: 'setValidation',
  16791. value: function setValidation(isValidation) {
  16792. if (isValidation) {
  16793. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_VALIDATION_MSG);
  16794. } else {
  16795. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_VALIDATION_MSG);
  16796. }
  16797. }
  16798. /** Makes the helper text visible to the screen reader. */
  16799. }, {
  16800. key: 'showToScreenReader',
  16801. value: function showToScreenReader() {
  16802. this.adapter_.removeAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_HIDDEN);
  16803. }
  16804. /**
  16805. * Sets the validity of the helper text based on the select validity.
  16806. * @param {boolean} selectIsValid
  16807. */
  16808. }, {
  16809. key: 'setValidity',
  16810. value: function setValidity(selectIsValid) {
  16811. var helperTextIsPersistent = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_PERSISTENT);
  16812. var helperTextIsValidationMsg = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_VALIDATION_MSG);
  16813. var validationMsgNeedsDisplay = helperTextIsValidationMsg && !selectIsValid;
  16814. if (validationMsgNeedsDisplay) {
  16815. this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ROLE, 'alert');
  16816. } else {
  16817. this.adapter_.removeAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ROLE);
  16818. }
  16819. if (!helperTextIsPersistent && !validationMsgNeedsDisplay) {
  16820. this.hide_();
  16821. }
  16822. }
  16823. /**
  16824. * Hides the help text from screen readers.
  16825. * @private
  16826. */
  16827. }, {
  16828. key: 'hide_',
  16829. value: function hide_() {
  16830. this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_HIDDEN, 'true');
  16831. }
  16832. }]);
  16833. return MDCSelectHelperTextFoundation;
  16834. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  16835. /* harmony default export */ __webpack_exports__["a"] = (MDCSelectHelperTextFoundation);
  16836. /***/ }),
  16837. /* 122 */
  16838. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16839. "use strict";
  16840. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  16841. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  16842. /**
  16843. * @license
  16844. * Copyright 2018 Google Inc.
  16845. *
  16846. * Permission is hereby granted, free of charge, to any person obtaining a copy
  16847. * of this software and associated documentation files (the "Software"), to deal
  16848. * in the Software without restriction, including without limitation the rights
  16849. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  16850. * copies of the Software, and to permit persons to whom the Software is
  16851. * furnished to do so, subject to the following conditions:
  16852. *
  16853. * The above copyright notice and this permission notice shall be included in
  16854. * all copies or substantial portions of the Software.
  16855. *
  16856. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16857. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16858. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  16859. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  16860. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  16861. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  16862. * THE SOFTWARE.
  16863. */
  16864. /** @enum {string} */
  16865. var strings = {
  16866. ARIA_HIDDEN: 'aria-hidden',
  16867. ROLE: 'role'
  16868. };
  16869. /** @enum {string} */
  16870. var cssClasses = {
  16871. HELPER_TEXT_PERSISTENT: 'mdc-select-helper-text--persistent',
  16872. HELPER_TEXT_VALIDATION_MSG: 'mdc-select-helper-text--validation-msg'
  16873. };
  16874. /***/ }),
  16875. /* 123 */
  16876. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16877. "use strict";
  16878. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  16879. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSlider", function() { return MDCSlider; });
  16880. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  16881. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(52);
  16882. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__adapter__ = __webpack_require__(53);
  16883. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation__ = __webpack_require__(124);
  16884. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSliderFoundation", function() { return __WEBPACK_IMPORTED_MODULE_3__foundation__["a"]; });
  16885. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  16886. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  16887. 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; }
  16888. 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; }
  16889. /**
  16890. * @license
  16891. * Copyright 2017 Google Inc.
  16892. *
  16893. * Permission is hereby granted, free of charge, to any person obtaining a copy
  16894. * of this software and associated documentation files (the "Software"), to deal
  16895. * in the Software without restriction, including without limitation the rights
  16896. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  16897. * copies of the Software, and to permit persons to whom the Software is
  16898. * furnished to do so, subject to the following conditions:
  16899. *
  16900. * The above copyright notice and this permission notice shall be included in
  16901. * all copies or substantial portions of the Software.
  16902. *
  16903. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16904. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16905. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  16906. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  16907. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  16908. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  16909. * THE SOFTWARE.
  16910. */
  16911. /**
  16912. * @extends MDCComponent<!MDCSliderFoundation>
  16913. */
  16914. var MDCSlider = function (_MDCComponent) {
  16915. _inherits(MDCSlider, _MDCComponent);
  16916. _createClass(MDCSlider, null, [{
  16917. key: 'attachTo',
  16918. value: function attachTo(root) {
  16919. return new MDCSlider(root);
  16920. }
  16921. }]);
  16922. function MDCSlider() {
  16923. var _ref;
  16924. _classCallCheck(this, MDCSlider);
  16925. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  16926. args[_key] = arguments[_key];
  16927. }
  16928. /** @type {?Element} */
  16929. var _this = _possibleConstructorReturn(this, (_ref = MDCSlider.__proto__ || Object.getPrototypeOf(MDCSlider)).call.apply(_ref, [this].concat(args)));
  16930. _this.thumbContainer_;
  16931. /** @type {?Element} */
  16932. _this.track_;
  16933. /** @type {?Element} */
  16934. _this.pinValueMarker_;
  16935. /** @type {?Element} */
  16936. _this.trackMarkerContainer_;
  16937. return _this;
  16938. }
  16939. /** @return {number} */
  16940. _createClass(MDCSlider, [{
  16941. key: 'initialize',
  16942. value: function initialize() {
  16943. this.thumbContainer_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].THUMB_CONTAINER_SELECTOR);
  16944. this.track_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].TRACK_SELECTOR);
  16945. this.pinValueMarker_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].PIN_VALUE_MARKER_SELECTOR);
  16946. this.trackMarkerContainer_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].TRACK_MARKER_CONTAINER_SELECTOR);
  16947. }
  16948. /**
  16949. * @return {!MDCSliderFoundation}
  16950. */
  16951. }, {
  16952. key: 'getDefaultFoundation',
  16953. value: function getDefaultFoundation() {
  16954. var _this2 = this;
  16955. return new __WEBPACK_IMPORTED_MODULE_3__foundation__["a" /* default */](
  16956. /** @type {!MDCSliderAdapter} */{
  16957. hasClass: function hasClass(className) {
  16958. return _this2.root_.classList.contains(className);
  16959. },
  16960. addClass: function addClass(className) {
  16961. return _this2.root_.classList.add(className);
  16962. },
  16963. removeClass: function removeClass(className) {
  16964. return _this2.root_.classList.remove(className);
  16965. },
  16966. getAttribute: function getAttribute(name) {
  16967. return _this2.root_.getAttribute(name);
  16968. },
  16969. setAttribute: function setAttribute(name, value) {
  16970. return _this2.root_.setAttribute(name, value);
  16971. },
  16972. removeAttribute: function removeAttribute(name) {
  16973. return _this2.root_.removeAttribute(name);
  16974. },
  16975. computeBoundingRect: function computeBoundingRect() {
  16976. return _this2.root_.getBoundingClientRect();
  16977. },
  16978. getTabIndex: function getTabIndex() {
  16979. return _this2.root_.tabIndex;
  16980. },
  16981. registerInteractionHandler: function registerInteractionHandler(type, handler) {
  16982. _this2.root_.addEventListener(type, handler);
  16983. },
  16984. deregisterInteractionHandler: function deregisterInteractionHandler(type, handler) {
  16985. _this2.root_.removeEventListener(type, handler);
  16986. },
  16987. registerThumbContainerInteractionHandler: function registerThumbContainerInteractionHandler(type, handler) {
  16988. _this2.thumbContainer_.addEventListener(type, handler);
  16989. },
  16990. deregisterThumbContainerInteractionHandler: function deregisterThumbContainerInteractionHandler(type, handler) {
  16991. _this2.thumbContainer_.removeEventListener(type, handler);
  16992. },
  16993. registerBodyInteractionHandler: function registerBodyInteractionHandler(type, handler) {
  16994. document.body.addEventListener(type, handler);
  16995. },
  16996. deregisterBodyInteractionHandler: function deregisterBodyInteractionHandler(type, handler) {
  16997. document.body.removeEventListener(type, handler);
  16998. },
  16999. registerResizeHandler: function registerResizeHandler(handler) {
  17000. window.addEventListener('resize', handler);
  17001. },
  17002. deregisterResizeHandler: function deregisterResizeHandler(handler) {
  17003. window.removeEventListener('resize', handler);
  17004. },
  17005. notifyInput: function notifyInput() {
  17006. _this2.emit(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].INPUT_EVENT, _this2);
  17007. },
  17008. notifyChange: function notifyChange() {
  17009. _this2.emit(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].CHANGE_EVENT, _this2);
  17010. },
  17011. setThumbContainerStyleProperty: function setThumbContainerStyleProperty(propertyName, value) {
  17012. _this2.thumbContainer_.style.setProperty(propertyName, value);
  17013. },
  17014. setTrackStyleProperty: function setTrackStyleProperty(propertyName, value) {
  17015. _this2.track_.style.setProperty(propertyName, value);
  17016. },
  17017. setMarkerValue: function setMarkerValue(value) {
  17018. _this2.pinValueMarker_.innerText = value;
  17019. },
  17020. appendTrackMarkers: function appendTrackMarkers(numMarkers) {
  17021. var frag = document.createDocumentFragment();
  17022. for (var i = 0; i < numMarkers; i++) {
  17023. var marker = document.createElement('div');
  17024. marker.classList.add('mdc-slider__track-marker');
  17025. frag.appendChild(marker);
  17026. }
  17027. _this2.trackMarkerContainer_.appendChild(frag);
  17028. },
  17029. removeTrackMarkers: function removeTrackMarkers() {
  17030. while (_this2.trackMarkerContainer_.firstChild) {
  17031. _this2.trackMarkerContainer_.removeChild(_this2.trackMarkerContainer_.firstChild);
  17032. }
  17033. },
  17034. setLastTrackMarkersStyleProperty: function setLastTrackMarkersStyleProperty(propertyName, value) {
  17035. // We remove and append new nodes, thus, the last track marker must be dynamically found.
  17036. var lastTrackMarker = _this2.root_.querySelector(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].LAST_TRACK_MARKER_SELECTOR);
  17037. lastTrackMarker.style.setProperty(propertyName, value);
  17038. },
  17039. isRTL: function isRTL() {
  17040. return getComputedStyle(_this2.root_).direction === 'rtl';
  17041. }
  17042. });
  17043. }
  17044. }, {
  17045. key: 'initialSyncWithDOM',
  17046. value: function initialSyncWithDOM() {
  17047. var origValueNow = parseFloat(this.root_.getAttribute(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].ARIA_VALUENOW));
  17048. this.min = parseFloat(this.root_.getAttribute(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].ARIA_VALUEMIN)) || this.min;
  17049. this.max = parseFloat(this.root_.getAttribute(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].ARIA_VALUEMAX)) || this.max;
  17050. this.step = parseFloat(this.root_.getAttribute(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].STEP_DATA_ATTR)) || this.step;
  17051. this.value = origValueNow || this.value;
  17052. 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';
  17053. this.foundation_.setupTrackMarker();
  17054. }
  17055. }, {
  17056. key: 'layout',
  17057. value: function layout() {
  17058. this.foundation_.layout();
  17059. }
  17060. /** @param {number=} amount */
  17061. }, {
  17062. key: 'stepUp',
  17063. value: function stepUp() {
  17064. var amount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.step || 1;
  17065. this.value += amount;
  17066. }
  17067. /** @param {number=} amount */
  17068. }, {
  17069. key: 'stepDown',
  17070. value: function stepDown() {
  17071. var amount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.step || 1;
  17072. this.value -= amount;
  17073. }
  17074. }, {
  17075. key: 'value',
  17076. get: function get() {
  17077. return this.foundation_.getValue();
  17078. }
  17079. /** @param {number} value */
  17080. ,
  17081. set: function set(value) {
  17082. this.foundation_.setValue(value);
  17083. }
  17084. /** @return {number} */
  17085. }, {
  17086. key: 'min',
  17087. get: function get() {
  17088. return this.foundation_.getMin();
  17089. }
  17090. /** @param {number} min */
  17091. ,
  17092. set: function set(min) {
  17093. this.foundation_.setMin(min);
  17094. }
  17095. /** @return {number} */
  17096. }, {
  17097. key: 'max',
  17098. get: function get() {
  17099. return this.foundation_.getMax();
  17100. }
  17101. /** @param {number} max */
  17102. ,
  17103. set: function set(max) {
  17104. this.foundation_.setMax(max);
  17105. }
  17106. /** @return {number} */
  17107. }, {
  17108. key: 'step',
  17109. get: function get() {
  17110. return this.foundation_.getStep();
  17111. }
  17112. /** @param {number} step */
  17113. ,
  17114. set: function set(step) {
  17115. this.foundation_.setStep(step);
  17116. }
  17117. /** @return {boolean} */
  17118. }, {
  17119. key: 'disabled',
  17120. get: function get() {
  17121. return this.foundation_.isDisabled();
  17122. }
  17123. /** @param {boolean} disabled */
  17124. ,
  17125. set: function set(disabled) {
  17126. this.foundation_.setDisabled(disabled);
  17127. }
  17128. }]);
  17129. return MDCSlider;
  17130. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  17131. /***/ }),
  17132. /* 124 */
  17133. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17134. "use strict";
  17135. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__constants__ = __webpack_require__(52);
  17136. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(53);
  17137. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_animation_index__ = __webpack_require__(9);
  17138. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_base_foundation__ = __webpack_require__(0);
  17139. 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; };
  17140. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  17141. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  17142. 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; }
  17143. 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; }
  17144. /**
  17145. * @license
  17146. * Copyright 2017 Google Inc.
  17147. *
  17148. * Permission is hereby granted, free of charge, to any person obtaining a copy
  17149. * of this software and associated documentation files (the "Software"), to deal
  17150. * in the Software without restriction, including without limitation the rights
  17151. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  17152. * copies of the Software, and to permit persons to whom the Software is
  17153. * furnished to do so, subject to the following conditions:
  17154. *
  17155. * The above copyright notice and this permission notice shall be included in
  17156. * all copies or substantial portions of the Software.
  17157. *
  17158. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17159. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17160. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17161. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  17162. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  17163. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  17164. * THE SOFTWARE.
  17165. */
  17166. /** @enum {string} */
  17167. var KEY_IDS = {
  17168. ARROW_LEFT: 'ArrowLeft',
  17169. ARROW_RIGHT: 'ArrowRight',
  17170. ARROW_UP: 'ArrowUp',
  17171. ARROW_DOWN: 'ArrowDown',
  17172. HOME: 'Home',
  17173. END: 'End',
  17174. PAGE_UP: 'PageUp',
  17175. PAGE_DOWN: 'PageDown'
  17176. };
  17177. /** @enum {string} */
  17178. var MOVE_EVENT_MAP = {
  17179. 'mousedown': 'mousemove',
  17180. 'touchstart': 'touchmove',
  17181. 'pointerdown': 'pointermove'
  17182. };
  17183. var DOWN_EVENTS = ['mousedown', 'pointerdown', 'touchstart'];
  17184. var UP_EVENTS = ['mouseup', 'pointerup', 'touchend'];
  17185. /**
  17186. * @extends {MDCFoundation<!MDCSliderAdapter>}
  17187. */
  17188. var MDCSliderFoundation = function (_MDCFoundation) {
  17189. _inherits(MDCSliderFoundation, _MDCFoundation);
  17190. _createClass(MDCSliderFoundation, null, [{
  17191. key: 'cssClasses',
  17192. /** @return enum {cssClasses} */
  17193. get: function get() {
  17194. return __WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */];
  17195. }
  17196. /** @return enum {strings} */
  17197. }, {
  17198. key: 'strings',
  17199. get: function get() {
  17200. return __WEBPACK_IMPORTED_MODULE_0__constants__["c" /* strings */];
  17201. }
  17202. /** @return enum {numbers} */
  17203. }, {
  17204. key: 'numbers',
  17205. get: function get() {
  17206. return __WEBPACK_IMPORTED_MODULE_0__constants__["b" /* numbers */];
  17207. }
  17208. /** @return {!MDCSliderAdapter} */
  17209. }, {
  17210. key: 'defaultAdapter',
  17211. get: function get() {
  17212. return (/** @type {!MDCSliderAdapter} */{
  17213. hasClass: function hasClass() {
  17214. return (/* className: string */ /* boolean */false
  17215. );
  17216. },
  17217. addClass: function addClass() /* className: string */{},
  17218. removeClass: function removeClass() /* className: string */{},
  17219. getAttribute: function getAttribute() {
  17220. return (/* name: string */ /* string|null */null
  17221. );
  17222. },
  17223. setAttribute: function setAttribute() /* name: string, value: string */{},
  17224. removeAttribute: function removeAttribute() /* name: string */{},
  17225. computeBoundingRect: function computeBoundingRect() {
  17226. return (/* ClientRect */{
  17227. top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0
  17228. }
  17229. );
  17230. },
  17231. getTabIndex: function getTabIndex() {
  17232. return (/* number */0
  17233. );
  17234. },
  17235. registerInteractionHandler: function registerInteractionHandler() /* type: string, handler: EventListener */{},
  17236. deregisterInteractionHandler: function deregisterInteractionHandler() /* type: string, handler: EventListener */{},
  17237. registerThumbContainerInteractionHandler: function registerThumbContainerInteractionHandler() /* type: string, handler: EventListener */{},
  17238. deregisterThumbContainerInteractionHandler: function deregisterThumbContainerInteractionHandler() /* type: string, handler: EventListener */{},
  17239. registerBodyInteractionHandler: function registerBodyInteractionHandler() /* type: string, handler: EventListener */{},
  17240. deregisterBodyInteractionHandler: function deregisterBodyInteractionHandler() /* type: string, handler: EventListener */{},
  17241. registerResizeHandler: function registerResizeHandler() /* handler: EventListener */{},
  17242. deregisterResizeHandler: function deregisterResizeHandler() /* handler: EventListener */{},
  17243. notifyInput: function notifyInput() {},
  17244. notifyChange: function notifyChange() {},
  17245. setThumbContainerStyleProperty: function setThumbContainerStyleProperty() /* propertyName: string, value: string */{},
  17246. setTrackStyleProperty: function setTrackStyleProperty() /* propertyName: string, value: string */{},
  17247. setMarkerValue: function setMarkerValue() /* value: number */{},
  17248. appendTrackMarkers: function appendTrackMarkers() /* numMarkers: number */{},
  17249. removeTrackMarkers: function removeTrackMarkers() {},
  17250. setLastTrackMarkersStyleProperty: function setLastTrackMarkersStyleProperty() /* propertyName: string, value: string */{},
  17251. isRTL: function isRTL() {
  17252. return (/* boolean */false
  17253. );
  17254. }
  17255. }
  17256. );
  17257. }
  17258. /**
  17259. * Creates a new instance of MDCSliderFoundation
  17260. * @param {?MDCSliderAdapter} adapter
  17261. */
  17262. }]);
  17263. function MDCSliderFoundation(adapter) {
  17264. _classCallCheck(this, MDCSliderFoundation);
  17265. /** @private {?ClientRect} */
  17266. var _this = _possibleConstructorReturn(this, (MDCSliderFoundation.__proto__ || Object.getPrototypeOf(MDCSliderFoundation)).call(this, _extends(MDCSliderFoundation.defaultAdapter, adapter)));
  17267. _this.rect_ = null;
  17268. // We set this to NaN since we want it to be a number, but we can't use '0' or '-1'
  17269. // because those could be valid tabindices set by the client code.
  17270. _this.savedTabIndex_ = NaN;
  17271. _this.active_ = false;
  17272. _this.inTransit_ = false;
  17273. _this.isDiscrete_ = false;
  17274. _this.hasTrackMarker_ = false;
  17275. _this.handlingThumbTargetEvt_ = false;
  17276. _this.min_ = 0;
  17277. _this.max_ = 100;
  17278. _this.step_ = 0;
  17279. _this.value_ = 0;
  17280. _this.disabled_ = false;
  17281. _this.preventFocusState_ = false;
  17282. _this.updateUIFrame_ = 0;
  17283. _this.thumbContainerPointerHandler_ = function () {
  17284. _this.handlingThumbTargetEvt_ = true;
  17285. };
  17286. _this.interactionStartHandler_ = function (evt) {
  17287. return _this.handleDown_(evt);
  17288. };
  17289. _this.keydownHandler_ = function (evt) {
  17290. return _this.handleKeydown_(evt);
  17291. };
  17292. _this.focusHandler_ = function () {
  17293. return _this.handleFocus_();
  17294. };
  17295. _this.blurHandler_ = function () {
  17296. return _this.handleBlur_();
  17297. };
  17298. _this.resizeHandler_ = function () {
  17299. return _this.layout();
  17300. };
  17301. return _this;
  17302. }
  17303. _createClass(MDCSliderFoundation, [{
  17304. key: 'init',
  17305. value: function init() {
  17306. var _this2 = this;
  17307. this.isDiscrete_ = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].IS_DISCRETE);
  17308. this.hasTrackMarker_ = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].HAS_TRACK_MARKER);
  17309. DOWN_EVENTS.forEach(function (evtName) {
  17310. return _this2.adapter_.registerInteractionHandler(evtName, _this2.interactionStartHandler_);
  17311. });
  17312. this.adapter_.registerInteractionHandler('keydown', this.keydownHandler_);
  17313. this.adapter_.registerInteractionHandler('focus', this.focusHandler_);
  17314. this.adapter_.registerInteractionHandler('blur', this.blurHandler_);
  17315. DOWN_EVENTS.forEach(function (evtName) {
  17316. _this2.adapter_.registerThumbContainerInteractionHandler(evtName, _this2.thumbContainerPointerHandler_);
  17317. });
  17318. this.adapter_.registerResizeHandler(this.resizeHandler_);
  17319. this.layout();
  17320. // At last step, provide a reasonable default value to discrete slider
  17321. if (this.isDiscrete_ && this.getStep() == 0) {
  17322. this.step_ = 1;
  17323. }
  17324. }
  17325. }, {
  17326. key: 'destroy',
  17327. value: function destroy() {
  17328. var _this3 = this;
  17329. DOWN_EVENTS.forEach(function (evtName) {
  17330. _this3.adapter_.deregisterInteractionHandler(evtName, _this3.interactionStartHandler_);
  17331. });
  17332. this.adapter_.deregisterInteractionHandler('keydown', this.keydownHandler_);
  17333. this.adapter_.deregisterInteractionHandler('focus', this.focusHandler_);
  17334. this.adapter_.deregisterInteractionHandler('blur', this.blurHandler_);
  17335. DOWN_EVENTS.forEach(function (evtName) {
  17336. _this3.adapter_.deregisterThumbContainerInteractionHandler(evtName, _this3.thumbContainerPointerHandler_);
  17337. });
  17338. this.adapter_.deregisterResizeHandler(this.resizeHandler_);
  17339. }
  17340. }, {
  17341. key: 'setupTrackMarker',
  17342. value: function setupTrackMarker() {
  17343. if (this.isDiscrete_ && this.hasTrackMarker_ && this.getStep() != 0) {
  17344. var min = this.getMin();
  17345. var max = this.getMax();
  17346. var step = this.getStep();
  17347. var numMarkers = (max - min) / step;
  17348. // In case distance between max & min is indivisible to step,
  17349. // we place the secondary to last marker proportionally at where thumb
  17350. // could reach and place the last marker at max value
  17351. var indivisible = Math.ceil(numMarkers) !== numMarkers;
  17352. if (indivisible) {
  17353. numMarkers = Math.ceil(numMarkers);
  17354. }
  17355. this.adapter_.removeTrackMarkers();
  17356. this.adapter_.appendTrackMarkers(numMarkers);
  17357. if (indivisible) {
  17358. var lastStepRatio = (max - numMarkers * step) / step + 1;
  17359. var flex = Object(__WEBPACK_IMPORTED_MODULE_2__material_animation_index__["b" /* getCorrectPropertyName */])(window, 'flex');
  17360. this.adapter_.setLastTrackMarkersStyleProperty(flex, String(lastStepRatio));
  17361. }
  17362. }
  17363. }
  17364. }, {
  17365. key: 'layout',
  17366. value: function layout() {
  17367. this.rect_ = this.adapter_.computeBoundingRect();
  17368. this.updateUIForCurrentValue_();
  17369. }
  17370. /** @return {number} */
  17371. }, {
  17372. key: 'getValue',
  17373. value: function getValue() {
  17374. return this.value_;
  17375. }
  17376. /** @param {number} value */
  17377. }, {
  17378. key: 'setValue',
  17379. value: function setValue(value) {
  17380. this.setValue_(value, false);
  17381. }
  17382. /** @return {number} */
  17383. }, {
  17384. key: 'getMax',
  17385. value: function getMax() {
  17386. return this.max_;
  17387. }
  17388. /** @param {number} max */
  17389. }, {
  17390. key: 'setMax',
  17391. value: function setMax(max) {
  17392. if (max < this.min_) {
  17393. throw new Error('Cannot set max to be less than the slider\'s minimum value');
  17394. }
  17395. this.max_ = max;
  17396. this.setValue_(this.value_, false, true);
  17397. this.adapter_.setAttribute(__WEBPACK_IMPORTED_MODULE_0__constants__["c" /* strings */].ARIA_VALUEMAX, String(this.max_));
  17398. this.setupTrackMarker();
  17399. }
  17400. /** @return {number} */
  17401. }, {
  17402. key: 'getMin',
  17403. value: function getMin() {
  17404. return this.min_;
  17405. }
  17406. /** @param {number} min */
  17407. }, {
  17408. key: 'setMin',
  17409. value: function setMin(min) {
  17410. if (min > this.max_) {
  17411. throw new Error('Cannot set min to be greater than the slider\'s maximum value');
  17412. }
  17413. this.min_ = min;
  17414. this.setValue_(this.value_, false, true);
  17415. this.adapter_.setAttribute(__WEBPACK_IMPORTED_MODULE_0__constants__["c" /* strings */].ARIA_VALUEMIN, String(this.min_));
  17416. this.setupTrackMarker();
  17417. }
  17418. /** @return {number} */
  17419. }, {
  17420. key: 'getStep',
  17421. value: function getStep() {
  17422. return this.step_;
  17423. }
  17424. /** @param {number} step */
  17425. }, {
  17426. key: 'setStep',
  17427. value: function setStep(step) {
  17428. if (step < 0) {
  17429. throw new Error('Step cannot be set to a negative number');
  17430. }
  17431. if (this.isDiscrete_ && (typeof step !== 'number' || step < 1)) {
  17432. step = 1;
  17433. }
  17434. this.step_ = step;
  17435. this.setValue_(this.value_, false, true);
  17436. this.setupTrackMarker();
  17437. }
  17438. /** @return {boolean} */
  17439. }, {
  17440. key: 'isDisabled',
  17441. value: function isDisabled() {
  17442. return this.disabled_;
  17443. }
  17444. /** @param {boolean} disabled */
  17445. }, {
  17446. key: 'setDisabled',
  17447. value: function setDisabled(disabled) {
  17448. this.disabled_ = disabled;
  17449. this.toggleClass_(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].DISABLED, this.disabled_);
  17450. if (this.disabled_) {
  17451. this.savedTabIndex_ = this.adapter_.getTabIndex();
  17452. this.adapter_.setAttribute(__WEBPACK_IMPORTED_MODULE_0__constants__["c" /* strings */].ARIA_DISABLED, 'true');
  17453. this.adapter_.removeAttribute('tabindex');
  17454. } else {
  17455. this.adapter_.removeAttribute(__WEBPACK_IMPORTED_MODULE_0__constants__["c" /* strings */].ARIA_DISABLED);
  17456. if (!isNaN(this.savedTabIndex_)) {
  17457. this.adapter_.setAttribute('tabindex', String(this.savedTabIndex_));
  17458. }
  17459. }
  17460. }
  17461. /**
  17462. * Called when the user starts interacting with the slider
  17463. * @param {!Event} evt
  17464. * @private
  17465. */
  17466. }, {
  17467. key: 'handleDown_',
  17468. value: function handleDown_(evt) {
  17469. var _this4 = this;
  17470. if (this.disabled_) {
  17471. return;
  17472. }
  17473. this.preventFocusState_ = true;
  17474. this.setInTransit_(!this.handlingThumbTargetEvt_);
  17475. this.handlingThumbTargetEvt_ = false;
  17476. this.setActive_(true);
  17477. var moveHandler = function moveHandler(evt) {
  17478. _this4.handleMove_(evt);
  17479. };
  17480. // Note: upHandler is [de]registered on ALL potential pointer-related release event types, since some browsers
  17481. // do not always fire these consistently in pairs.
  17482. // (See https://github.com/material-components/material-components-web/issues/1192)
  17483. var upHandler = function upHandler() {
  17484. _this4.handleUp_();
  17485. _this4.adapter_.deregisterBodyInteractionHandler(MOVE_EVENT_MAP[evt.type], moveHandler);
  17486. UP_EVENTS.forEach(function (evtName) {
  17487. return _this4.adapter_.deregisterBodyInteractionHandler(evtName, upHandler);
  17488. });
  17489. };
  17490. this.adapter_.registerBodyInteractionHandler(MOVE_EVENT_MAP[evt.type], moveHandler);
  17491. UP_EVENTS.forEach(function (evtName) {
  17492. return _this4.adapter_.registerBodyInteractionHandler(evtName, upHandler);
  17493. });
  17494. this.setValueFromEvt_(evt);
  17495. }
  17496. /**
  17497. * Called when the user moves the slider
  17498. * @param {!Event} evt
  17499. * @private
  17500. */
  17501. }, {
  17502. key: 'handleMove_',
  17503. value: function handleMove_(evt) {
  17504. evt.preventDefault();
  17505. this.setValueFromEvt_(evt);
  17506. }
  17507. /**
  17508. * Called when the user's interaction with the slider ends
  17509. * @private
  17510. */
  17511. }, {
  17512. key: 'handleUp_',
  17513. value: function handleUp_() {
  17514. this.setActive_(false);
  17515. this.adapter_.notifyChange();
  17516. }
  17517. /**
  17518. * Returns the pageX of the event
  17519. * @param {!Event} evt
  17520. * @return {number}
  17521. * @private
  17522. */
  17523. }, {
  17524. key: 'getPageX_',
  17525. value: function getPageX_(evt) {
  17526. if (evt.targetTouches && evt.targetTouches.length > 0) {
  17527. return evt.targetTouches[0].pageX;
  17528. }
  17529. return evt.pageX;
  17530. }
  17531. /**
  17532. * Sets the slider value from an event
  17533. * @param {!Event} evt
  17534. * @private
  17535. */
  17536. }, {
  17537. key: 'setValueFromEvt_',
  17538. value: function setValueFromEvt_(evt) {
  17539. var pageX = this.getPageX_(evt);
  17540. var value = this.computeValueFromPageX_(pageX);
  17541. this.setValue_(value, true);
  17542. }
  17543. /**
  17544. * Computes the new value from the pageX position
  17545. * @param {number} pageX
  17546. * @return {number}
  17547. */
  17548. }, {
  17549. key: 'computeValueFromPageX_',
  17550. value: function computeValueFromPageX_(pageX) {
  17551. var max = this.max_,
  17552. min = this.min_;
  17553. var xPos = pageX - this.rect_.left;
  17554. var pctComplete = xPos / this.rect_.width;
  17555. if (this.adapter_.isRTL()) {
  17556. pctComplete = 1 - pctComplete;
  17557. }
  17558. // Fit the percentage complete between the range [min,max]
  17559. // by remapping from [0, 1] to [min, min+(max-min)].
  17560. return min + pctComplete * (max - min);
  17561. }
  17562. /**
  17563. * Handles keydown events
  17564. * @param {!Event} evt
  17565. */
  17566. }, {
  17567. key: 'handleKeydown_',
  17568. value: function handleKeydown_(evt) {
  17569. var keyId = this.getKeyId_(evt);
  17570. var value = this.getValueForKeyId_(keyId);
  17571. if (isNaN(value)) {
  17572. return;
  17573. }
  17574. // Prevent page from scrolling due to key presses that would normally scroll the page
  17575. evt.preventDefault();
  17576. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].FOCUS);
  17577. this.setValue_(value, true);
  17578. this.adapter_.notifyChange();
  17579. }
  17580. /**
  17581. * Returns the computed name of the event
  17582. * @param {!Event} kbdEvt
  17583. * @return {string}
  17584. */
  17585. }, {
  17586. key: 'getKeyId_',
  17587. value: function getKeyId_(kbdEvt) {
  17588. if (kbdEvt.key === KEY_IDS.ARROW_LEFT || kbdEvt.keyCode === 37) {
  17589. return KEY_IDS.ARROW_LEFT;
  17590. }
  17591. if (kbdEvt.key === KEY_IDS.ARROW_RIGHT || kbdEvt.keyCode === 39) {
  17592. return KEY_IDS.ARROW_RIGHT;
  17593. }
  17594. if (kbdEvt.key === KEY_IDS.ARROW_UP || kbdEvt.keyCode === 38) {
  17595. return KEY_IDS.ARROW_UP;
  17596. }
  17597. if (kbdEvt.key === KEY_IDS.ARROW_DOWN || kbdEvt.keyCode === 40) {
  17598. return KEY_IDS.ARROW_DOWN;
  17599. }
  17600. if (kbdEvt.key === KEY_IDS.HOME || kbdEvt.keyCode === 36) {
  17601. return KEY_IDS.HOME;
  17602. }
  17603. if (kbdEvt.key === KEY_IDS.END || kbdEvt.keyCode === 35) {
  17604. return KEY_IDS.END;
  17605. }
  17606. if (kbdEvt.key === KEY_IDS.PAGE_UP || kbdEvt.keyCode === 33) {
  17607. return KEY_IDS.PAGE_UP;
  17608. }
  17609. if (kbdEvt.key === KEY_IDS.PAGE_DOWN || kbdEvt.keyCode === 34) {
  17610. return KEY_IDS.PAGE_DOWN;
  17611. }
  17612. return '';
  17613. }
  17614. /**
  17615. * Computes the value given a keyboard key ID
  17616. * @param {string} keyId
  17617. * @return {number}
  17618. */
  17619. }, {
  17620. key: 'getValueForKeyId_',
  17621. value: function getValueForKeyId_(keyId) {
  17622. var max = this.max_,
  17623. min = this.min_,
  17624. step = this.step_;
  17625. var delta = step || (max - min) / 100;
  17626. var valueNeedsToBeFlipped = this.adapter_.isRTL() && (keyId === KEY_IDS.ARROW_LEFT || keyId === KEY_IDS.ARROW_RIGHT);
  17627. if (valueNeedsToBeFlipped) {
  17628. delta = -delta;
  17629. }
  17630. switch (keyId) {
  17631. case KEY_IDS.ARROW_LEFT:
  17632. case KEY_IDS.ARROW_DOWN:
  17633. return this.value_ - delta;
  17634. case KEY_IDS.ARROW_RIGHT:
  17635. case KEY_IDS.ARROW_UP:
  17636. return this.value_ + delta;
  17637. case KEY_IDS.HOME:
  17638. return this.min_;
  17639. case KEY_IDS.END:
  17640. return this.max_;
  17641. case KEY_IDS.PAGE_UP:
  17642. return this.value_ + delta * __WEBPACK_IMPORTED_MODULE_0__constants__["b" /* numbers */].PAGE_FACTOR;
  17643. case KEY_IDS.PAGE_DOWN:
  17644. return this.value_ - delta * __WEBPACK_IMPORTED_MODULE_0__constants__["b" /* numbers */].PAGE_FACTOR;
  17645. default:
  17646. return NaN;
  17647. }
  17648. }
  17649. }, {
  17650. key: 'handleFocus_',
  17651. value: function handleFocus_() {
  17652. if (this.preventFocusState_) {
  17653. return;
  17654. }
  17655. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].FOCUS);
  17656. }
  17657. }, {
  17658. key: 'handleBlur_',
  17659. value: function handleBlur_() {
  17660. this.preventFocusState_ = false;
  17661. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].FOCUS);
  17662. }
  17663. /**
  17664. * Sets the value of the slider
  17665. * @param {number} value
  17666. * @param {boolean} shouldFireInput
  17667. * @param {boolean=} force
  17668. */
  17669. }, {
  17670. key: 'setValue_',
  17671. value: function setValue_(value, shouldFireInput) {
  17672. var force = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  17673. if (value === this.value_ && !force) {
  17674. return;
  17675. }
  17676. var min = this.min_,
  17677. max = this.max_;
  17678. var valueSetToBoundary = value === min || value === max;
  17679. if (this.step_ && !valueSetToBoundary) {
  17680. value = this.quantize_(value);
  17681. }
  17682. if (value < min) {
  17683. value = min;
  17684. } else if (value > max) {
  17685. value = max;
  17686. }
  17687. this.value_ = value;
  17688. this.adapter_.setAttribute(__WEBPACK_IMPORTED_MODULE_0__constants__["c" /* strings */].ARIA_VALUENOW, String(this.value_));
  17689. this.updateUIForCurrentValue_();
  17690. if (shouldFireInput) {
  17691. this.adapter_.notifyInput();
  17692. if (this.isDiscrete_) {
  17693. this.adapter_.setMarkerValue(value);
  17694. }
  17695. }
  17696. }
  17697. /**
  17698. * Calculates the quantized value
  17699. * @param {number} value
  17700. * @return {number}
  17701. */
  17702. }, {
  17703. key: 'quantize_',
  17704. value: function quantize_(value) {
  17705. var numSteps = Math.round(value / this.step_);
  17706. var quantizedVal = numSteps * this.step_;
  17707. return quantizedVal;
  17708. }
  17709. }, {
  17710. key: 'updateUIForCurrentValue_',
  17711. value: function updateUIForCurrentValue_() {
  17712. var _this5 = this;
  17713. var max = this.max_,
  17714. min = this.min_,
  17715. value = this.value_;
  17716. var pctComplete = (value - min) / (max - min);
  17717. var translatePx = pctComplete * this.rect_.width;
  17718. if (this.adapter_.isRTL()) {
  17719. translatePx = this.rect_.width - translatePx;
  17720. }
  17721. var transformProp = Object(__WEBPACK_IMPORTED_MODULE_2__material_animation_index__["b" /* getCorrectPropertyName */])(window, 'transform');
  17722. var transitionendEvtName = Object(__WEBPACK_IMPORTED_MODULE_2__material_animation_index__["a" /* getCorrectEventName */])(window, 'transitionend');
  17723. if (this.inTransit_) {
  17724. var onTransitionEnd = function onTransitionEnd() {
  17725. _this5.setInTransit_(false);
  17726. _this5.adapter_.deregisterThumbContainerInteractionHandler(transitionendEvtName, onTransitionEnd);
  17727. };
  17728. this.adapter_.registerThumbContainerInteractionHandler(transitionendEvtName, onTransitionEnd);
  17729. }
  17730. this.updateUIFrame_ = requestAnimationFrame(function () {
  17731. // NOTE(traviskaufman): It would be nice to use calc() here,
  17732. // but IE cannot handle calcs in transforms correctly.
  17733. // See: https://goo.gl/NC2itk
  17734. // Also note that the -50% offset is used to center the slider thumb.
  17735. _this5.adapter_.setThumbContainerStyleProperty(transformProp, 'translateX(' + translatePx + 'px) translateX(-50%)');
  17736. _this5.adapter_.setTrackStyleProperty(transformProp, 'scaleX(' + pctComplete + ')');
  17737. });
  17738. }
  17739. /**
  17740. * Toggles the active state of the slider
  17741. * @param {boolean} active
  17742. */
  17743. }, {
  17744. key: 'setActive_',
  17745. value: function setActive_(active) {
  17746. this.active_ = active;
  17747. this.toggleClass_(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].ACTIVE, this.active_);
  17748. }
  17749. /**
  17750. * Toggles the inTransit state of the slider
  17751. * @param {boolean} inTransit
  17752. */
  17753. }, {
  17754. key: 'setInTransit_',
  17755. value: function setInTransit_(inTransit) {
  17756. this.inTransit_ = inTransit;
  17757. this.toggleClass_(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].IN_TRANSIT, this.inTransit_);
  17758. }
  17759. /**
  17760. * Conditionally adds or removes a class based on shouldBePresent
  17761. * @param {string} className
  17762. * @param {boolean} shouldBePresent
  17763. */
  17764. }, {
  17765. key: 'toggleClass_',
  17766. value: function toggleClass_(className, shouldBePresent) {
  17767. if (shouldBePresent) {
  17768. this.adapter_.addClass(className);
  17769. } else {
  17770. this.adapter_.removeClass(className);
  17771. }
  17772. }
  17773. }]);
  17774. return MDCSliderFoundation;
  17775. }(__WEBPACK_IMPORTED_MODULE_3__material_base_foundation__["a" /* default */]);
  17776. /* harmony default export */ __webpack_exports__["a"] = (MDCSliderFoundation);
  17777. /***/ }),
  17778. /* 125 */
  17779. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17780. "use strict";
  17781. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  17782. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSnackbar", function() { return MDCSnackbar; });
  17783. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_index__ = __webpack_require__(3);
  17784. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(126);
  17785. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_animation_index__ = __webpack_require__(9);
  17786. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSnackbarFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__foundation__["a"]; });
  17787. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  17788. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  17789. 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; }
  17790. 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; }
  17791. /**
  17792. * @license
  17793. * Copyright 2016 Google Inc.
  17794. *
  17795. * Permission is hereby granted, free of charge, to any person obtaining a copy
  17796. * of this software and associated documentation files (the "Software"), to deal
  17797. * in the Software without restriction, including without limitation the rights
  17798. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  17799. * copies of the Software, and to permit persons to whom the Software is
  17800. * furnished to do so, subject to the following conditions:
  17801. *
  17802. * The above copyright notice and this permission notice shall be included in
  17803. * all copies or substantial portions of the Software.
  17804. *
  17805. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17806. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17807. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17808. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  17809. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  17810. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  17811. * THE SOFTWARE.
  17812. */
  17813. var MDCSnackbar = function (_MDCComponent) {
  17814. _inherits(MDCSnackbar, _MDCComponent);
  17815. function MDCSnackbar() {
  17816. _classCallCheck(this, MDCSnackbar);
  17817. return _possibleConstructorReturn(this, (MDCSnackbar.__proto__ || Object.getPrototypeOf(MDCSnackbar)).apply(this, arguments));
  17818. }
  17819. _createClass(MDCSnackbar, [{
  17820. key: 'show',
  17821. value: function show(data) {
  17822. this.foundation_.show(data);
  17823. }
  17824. }, {
  17825. key: 'getDefaultFoundation',
  17826. value: function getDefaultFoundation() {
  17827. var _this2 = this;
  17828. var _MDCSnackbarFoundatio = __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings,
  17829. TEXT_SELECTOR = _MDCSnackbarFoundatio.TEXT_SELECTOR,
  17830. ACTION_BUTTON_SELECTOR = _MDCSnackbarFoundatio.ACTION_BUTTON_SELECTOR;
  17831. var getText = function getText() {
  17832. return _this2.root_.querySelector(TEXT_SELECTOR);
  17833. };
  17834. var getActionButton = function getActionButton() {
  17835. return _this2.root_.querySelector(ACTION_BUTTON_SELECTOR);
  17836. };
  17837. /* eslint brace-style: "off" */
  17838. return new __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]({
  17839. addClass: function addClass(className) {
  17840. return _this2.root_.classList.add(className);
  17841. },
  17842. removeClass: function removeClass(className) {
  17843. return _this2.root_.classList.remove(className);
  17844. },
  17845. setAriaHidden: function setAriaHidden() {
  17846. return _this2.root_.setAttribute('aria-hidden', 'true');
  17847. },
  17848. unsetAriaHidden: function unsetAriaHidden() {
  17849. return _this2.root_.removeAttribute('aria-hidden');
  17850. },
  17851. setActionAriaHidden: function setActionAriaHidden() {
  17852. return getActionButton().setAttribute('aria-hidden', 'true');
  17853. },
  17854. unsetActionAriaHidden: function unsetActionAriaHidden() {
  17855. return getActionButton().removeAttribute('aria-hidden');
  17856. },
  17857. setActionText: function setActionText(text) {
  17858. getActionButton().textContent = text;
  17859. },
  17860. setMessageText: function setMessageText(text) {
  17861. getText().textContent = text;
  17862. },
  17863. setFocus: function setFocus() {
  17864. return getActionButton().focus();
  17865. },
  17866. isFocused: function isFocused() {
  17867. return document.activeElement === getActionButton();
  17868. },
  17869. visibilityIsHidden: function visibilityIsHidden() {
  17870. return document.hidden;
  17871. },
  17872. registerCapturedBlurHandler: function registerCapturedBlurHandler(handler) {
  17873. return getActionButton().addEventListener('blur', handler, true);
  17874. },
  17875. deregisterCapturedBlurHandler: function deregisterCapturedBlurHandler(handler) {
  17876. return getActionButton().removeEventListener('blur', handler, true);
  17877. },
  17878. registerVisibilityChangeHandler: function registerVisibilityChangeHandler(handler) {
  17879. return document.addEventListener('visibilitychange', handler);
  17880. },
  17881. deregisterVisibilityChangeHandler: function deregisterVisibilityChangeHandler(handler) {
  17882. return document.removeEventListener('visibilitychange', handler);
  17883. },
  17884. registerCapturedInteractionHandler: function registerCapturedInteractionHandler(evt, handler) {
  17885. return document.body.addEventListener(evt, handler, true);
  17886. },
  17887. deregisterCapturedInteractionHandler: function deregisterCapturedInteractionHandler(evt, handler) {
  17888. return document.body.removeEventListener(evt, handler, true);
  17889. },
  17890. registerActionClickHandler: function registerActionClickHandler(handler) {
  17891. return getActionButton().addEventListener('click', handler);
  17892. },
  17893. deregisterActionClickHandler: function deregisterActionClickHandler(handler) {
  17894. return getActionButton().removeEventListener('click', handler);
  17895. },
  17896. registerTransitionEndHandler: function registerTransitionEndHandler(handler) {
  17897. return _this2.root_.addEventListener(Object(__WEBPACK_IMPORTED_MODULE_2__material_animation_index__["a" /* getCorrectEventName */])(window, 'transitionend'), handler);
  17898. },
  17899. deregisterTransitionEndHandler: function deregisterTransitionEndHandler(handler) {
  17900. return _this2.root_.removeEventListener(Object(__WEBPACK_IMPORTED_MODULE_2__material_animation_index__["a" /* getCorrectEventName */])(window, 'transitionend'), handler);
  17901. },
  17902. notifyShow: function notifyShow() {
  17903. return _this2.emit(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.SHOW_EVENT);
  17904. },
  17905. notifyHide: function notifyHide() {
  17906. return _this2.emit(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.HIDE_EVENT);
  17907. }
  17908. });
  17909. }
  17910. }, {
  17911. key: 'dismissesOnAction',
  17912. get: function get() {
  17913. return this.foundation_.dismissesOnAction();
  17914. },
  17915. set: function set(dismissesOnAction) {
  17916. this.foundation_.setDismissOnAction(dismissesOnAction);
  17917. }
  17918. }], [{
  17919. key: 'attachTo',
  17920. value: function attachTo(root) {
  17921. return new MDCSnackbar(root);
  17922. }
  17923. }]);
  17924. return MDCSnackbar;
  17925. }(__WEBPACK_IMPORTED_MODULE_0__material_base_index__["MDCComponent"]);
  17926. /***/ }),
  17927. /* 126 */
  17928. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17929. "use strict";
  17930. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_index__ = __webpack_require__(3);
  17931. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(127);
  17932. 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; };
  17933. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  17934. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  17935. 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; }
  17936. 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; }
  17937. /**
  17938. * @license
  17939. * Copyright 2016 Google Inc.
  17940. *
  17941. * Permission is hereby granted, free of charge, to any person obtaining a copy
  17942. * of this software and associated documentation files (the "Software"), to deal
  17943. * in the Software without restriction, including without limitation the rights
  17944. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  17945. * copies of the Software, and to permit persons to whom the Software is
  17946. * furnished to do so, subject to the following conditions:
  17947. *
  17948. * The above copyright notice and this permission notice shall be included in
  17949. * all copies or substantial portions of the Software.
  17950. *
  17951. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17952. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17953. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17954. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  17955. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  17956. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  17957. * THE SOFTWARE.
  17958. */
  17959. var MDCSnackbarFoundation = function (_MDCFoundation) {
  17960. _inherits(MDCSnackbarFoundation, _MDCFoundation);
  17961. _createClass(MDCSnackbarFoundation, [{
  17962. key: 'active',
  17963. get: function get() {
  17964. return this.active_;
  17965. }
  17966. }], [{
  17967. key: 'cssClasses',
  17968. get: function get() {
  17969. return __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */];
  17970. }
  17971. }, {
  17972. key: 'strings',
  17973. get: function get() {
  17974. return __WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */];
  17975. }
  17976. }, {
  17977. key: 'defaultAdapter',
  17978. get: function get() {
  17979. return {
  17980. addClass: function addClass() /* className: string */{},
  17981. removeClass: function removeClass() /* className: string */{},
  17982. setAriaHidden: function setAriaHidden() {},
  17983. unsetAriaHidden: function unsetAriaHidden() {},
  17984. setActionAriaHidden: function setActionAriaHidden() {},
  17985. unsetActionAriaHidden: function unsetActionAriaHidden() {},
  17986. setActionText: function setActionText() /* actionText: string */{},
  17987. setMessageText: function setMessageText() /* message: string */{},
  17988. setFocus: function setFocus() {},
  17989. isFocused: function isFocused() {
  17990. return (/* boolean */false
  17991. );
  17992. },
  17993. visibilityIsHidden: function visibilityIsHidden() {
  17994. return (/* boolean */false
  17995. );
  17996. },
  17997. registerCapturedBlurHandler: function registerCapturedBlurHandler() /* handler: EventListener */{},
  17998. deregisterCapturedBlurHandler: function deregisterCapturedBlurHandler() /* handler: EventListener */{},
  17999. registerVisibilityChangeHandler: function registerVisibilityChangeHandler() /* handler: EventListener */{},
  18000. deregisterVisibilityChangeHandler: function deregisterVisibilityChangeHandler() /* handler: EventListener */{},
  18001. registerCapturedInteractionHandler: function registerCapturedInteractionHandler() /* evtType: string, handler: EventListener */{},
  18002. deregisterCapturedInteractionHandler: function deregisterCapturedInteractionHandler() /* evtType: string, handler: EventListener */{},
  18003. registerActionClickHandler: function registerActionClickHandler() /* handler: EventListener */{},
  18004. deregisterActionClickHandler: function deregisterActionClickHandler() /* handler: EventListener */{},
  18005. registerTransitionEndHandler: function registerTransitionEndHandler() /* handler: EventListener */{},
  18006. deregisterTransitionEndHandler: function deregisterTransitionEndHandler() /* handler: EventListener */{},
  18007. notifyShow: function notifyShow() {},
  18008. notifyHide: function notifyHide() {}
  18009. };
  18010. }
  18011. }]);
  18012. function MDCSnackbarFoundation(adapter) {
  18013. _classCallCheck(this, MDCSnackbarFoundation);
  18014. var _this = _possibleConstructorReturn(this, (MDCSnackbarFoundation.__proto__ || Object.getPrototypeOf(MDCSnackbarFoundation)).call(this, _extends(MDCSnackbarFoundation.defaultAdapter, adapter)));
  18015. _this.active_ = false;
  18016. _this.actionWasClicked_ = false;
  18017. _this.dismissOnAction_ = true;
  18018. _this.firstFocus_ = true;
  18019. _this.pointerDownRecognized_ = false;
  18020. _this.snackbarHasFocus_ = false;
  18021. _this.snackbarData_ = null;
  18022. _this.queue_ = [];
  18023. _this.actionClickHandler_ = function () {
  18024. _this.actionWasClicked_ = true;
  18025. _this.invokeAction_();
  18026. };
  18027. _this.visibilitychangeHandler_ = function () {
  18028. clearTimeout(_this.timeoutId_);
  18029. _this.snackbarHasFocus_ = true;
  18030. if (!_this.adapter_.visibilityIsHidden()) {
  18031. setTimeout(_this.cleanup_.bind(_this), _this.snackbarData_.timeout || __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* numbers */].MESSAGE_TIMEOUT);
  18032. }
  18033. };
  18034. _this.interactionHandler_ = function (evt) {
  18035. if (evt.type === 'focus' && !_this.adapter_.isFocused()) {
  18036. return;
  18037. }
  18038. if (evt.type === 'touchstart' || evt.type === 'mousedown') {
  18039. _this.pointerDownRecognized_ = true;
  18040. }
  18041. _this.handlePossibleTabKeyboardFocus_(evt);
  18042. if (evt.type === 'focus') {
  18043. _this.pointerDownRecognized_ = false;
  18044. }
  18045. };
  18046. _this.blurHandler_ = function () {
  18047. clearTimeout(_this.timeoutId_);
  18048. _this.snackbarHasFocus_ = false;
  18049. _this.timeoutId_ = setTimeout(_this.cleanup_.bind(_this), _this.snackbarData_.timeout || __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* numbers */].MESSAGE_TIMEOUT);
  18050. };
  18051. return _this;
  18052. }
  18053. _createClass(MDCSnackbarFoundation, [{
  18054. key: 'init',
  18055. value: function init() {
  18056. this.adapter_.registerActionClickHandler(this.actionClickHandler_);
  18057. this.adapter_.setAriaHidden();
  18058. this.adapter_.setActionAriaHidden();
  18059. }
  18060. }, {
  18061. key: 'destroy',
  18062. value: function destroy() {
  18063. var _this2 = this;
  18064. this.adapter_.deregisterActionClickHandler(this.actionClickHandler_);
  18065. this.adapter_.deregisterCapturedBlurHandler(this.blurHandler_);
  18066. this.adapter_.deregisterVisibilityChangeHandler(this.visibilitychangeHandler_);
  18067. ['touchstart', 'mousedown', 'focus'].forEach(function (evtType) {
  18068. _this2.adapter_.deregisterCapturedInteractionHandler(evtType, _this2.interactionHandler_);
  18069. });
  18070. }
  18071. }, {
  18072. key: 'dismissesOnAction',
  18073. value: function dismissesOnAction() {
  18074. return this.dismissOnAction_;
  18075. }
  18076. }, {
  18077. key: 'setDismissOnAction',
  18078. value: function setDismissOnAction(dismissOnAction) {
  18079. this.dismissOnAction_ = !!dismissOnAction;
  18080. }
  18081. }, {
  18082. key: 'show',
  18083. value: function show(data) {
  18084. var _this3 = this;
  18085. if (!data) {
  18086. throw new Error('Please provide a data object with at least a message to display.');
  18087. }
  18088. if (!data.message) {
  18089. throw new Error('Please provide a message to be displayed.');
  18090. }
  18091. if (data.actionHandler && !data.actionText) {
  18092. throw new Error('Please provide action text with the handler.');
  18093. }
  18094. if (this.active) {
  18095. this.queue_.push(data);
  18096. return;
  18097. }
  18098. clearTimeout(this.timeoutId_);
  18099. this.snackbarData_ = data;
  18100. this.firstFocus_ = true;
  18101. this.adapter_.registerVisibilityChangeHandler(this.visibilitychangeHandler_);
  18102. this.adapter_.registerCapturedBlurHandler(this.blurHandler_);
  18103. ['touchstart', 'mousedown', 'focus'].forEach(function (evtType) {
  18104. _this3.adapter_.registerCapturedInteractionHandler(evtType, _this3.interactionHandler_);
  18105. });
  18106. var ACTIVE = __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].ACTIVE,
  18107. MULTILINE = __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].MULTILINE,
  18108. ACTION_ON_BOTTOM = __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].ACTION_ON_BOTTOM;
  18109. this.adapter_.setMessageText(this.snackbarData_.message);
  18110. if (this.snackbarData_.multiline) {
  18111. this.adapter_.addClass(MULTILINE);
  18112. if (this.snackbarData_.actionOnBottom) {
  18113. this.adapter_.addClass(ACTION_ON_BOTTOM);
  18114. }
  18115. }
  18116. if (this.snackbarData_.actionHandler) {
  18117. this.adapter_.setActionText(this.snackbarData_.actionText);
  18118. this.actionHandler_ = this.snackbarData_.actionHandler;
  18119. this.setActionHidden_(false);
  18120. } else {
  18121. this.setActionHidden_(true);
  18122. this.actionHandler_ = null;
  18123. this.adapter_.setActionText(null);
  18124. }
  18125. this.active_ = true;
  18126. this.adapter_.addClass(ACTIVE);
  18127. this.adapter_.unsetAriaHidden();
  18128. this.adapter_.notifyShow();
  18129. this.timeoutId_ = setTimeout(this.cleanup_.bind(this), this.snackbarData_.timeout || __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* numbers */].MESSAGE_TIMEOUT);
  18130. }
  18131. }, {
  18132. key: 'handlePossibleTabKeyboardFocus_',
  18133. value: function handlePossibleTabKeyboardFocus_() {
  18134. var hijackFocus = this.firstFocus_ && !this.pointerDownRecognized_;
  18135. if (hijackFocus) {
  18136. this.setFocusOnAction_();
  18137. }
  18138. this.firstFocus_ = false;
  18139. }
  18140. }, {
  18141. key: 'setFocusOnAction_',
  18142. value: function setFocusOnAction_() {
  18143. this.adapter_.setFocus();
  18144. this.snackbarHasFocus_ = true;
  18145. this.firstFocus_ = false;
  18146. }
  18147. }, {
  18148. key: 'invokeAction_',
  18149. value: function invokeAction_() {
  18150. try {
  18151. if (!this.actionHandler_) {
  18152. return;
  18153. }
  18154. this.actionHandler_();
  18155. } finally {
  18156. if (this.dismissOnAction_) {
  18157. this.cleanup_();
  18158. }
  18159. }
  18160. }
  18161. }, {
  18162. key: 'cleanup_',
  18163. value: function cleanup_() {
  18164. var _this4 = this;
  18165. var allowDismissal = !this.snackbarHasFocus_ || this.actionWasClicked_;
  18166. if (allowDismissal) {
  18167. var ACTIVE = __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].ACTIVE,
  18168. MULTILINE = __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].MULTILINE,
  18169. ACTION_ON_BOTTOM = __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].ACTION_ON_BOTTOM;
  18170. this.adapter_.removeClass(ACTIVE);
  18171. var handler = function handler() {
  18172. clearTimeout(_this4.timeoutId_);
  18173. _this4.adapter_.deregisterTransitionEndHandler(handler);
  18174. _this4.adapter_.removeClass(MULTILINE);
  18175. _this4.adapter_.removeClass(ACTION_ON_BOTTOM);
  18176. _this4.setActionHidden_(true);
  18177. _this4.adapter_.setAriaHidden();
  18178. _this4.active_ = false;
  18179. _this4.snackbarHasFocus_ = false;
  18180. _this4.adapter_.notifyHide();
  18181. _this4.showNext_();
  18182. };
  18183. this.adapter_.registerTransitionEndHandler(handler);
  18184. }
  18185. }
  18186. }, {
  18187. key: 'showNext_',
  18188. value: function showNext_() {
  18189. if (!this.queue_.length) {
  18190. return;
  18191. }
  18192. this.show(this.queue_.shift());
  18193. }
  18194. }, {
  18195. key: 'setActionHidden_',
  18196. value: function setActionHidden_(isHidden) {
  18197. if (isHidden) {
  18198. this.adapter_.setActionAriaHidden();
  18199. } else {
  18200. this.adapter_.unsetActionAriaHidden();
  18201. }
  18202. }
  18203. }]);
  18204. return MDCSnackbarFoundation;
  18205. }(__WEBPACK_IMPORTED_MODULE_0__material_base_index__["MDCFoundation"]);
  18206. /* harmony default export */ __webpack_exports__["a"] = (MDCSnackbarFoundation);
  18207. /***/ }),
  18208. /* 127 */
  18209. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18210. "use strict";
  18211. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  18212. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; });
  18213. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; });
  18214. /**
  18215. * @license
  18216. * Copyright 2016 Google Inc.
  18217. *
  18218. * Permission is hereby granted, free of charge, to any person obtaining a copy
  18219. * of this software and associated documentation files (the "Software"), to deal
  18220. * in the Software without restriction, including without limitation the rights
  18221. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  18222. * copies of the Software, and to permit persons to whom the Software is
  18223. * furnished to do so, subject to the following conditions:
  18224. *
  18225. * The above copyright notice and this permission notice shall be included in
  18226. * all copies or substantial portions of the Software.
  18227. *
  18228. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18229. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18230. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18231. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18232. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18233. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  18234. * THE SOFTWARE.
  18235. */
  18236. var cssClasses = {
  18237. ROOT: 'mdc-snackbar',
  18238. TEXT: 'mdc-snackbar__text',
  18239. ACTION_WRAPPER: 'mdc-snackbar__action-wrapper',
  18240. ACTION_BUTTON: 'mdc-snackbar__action-button',
  18241. ACTIVE: 'mdc-snackbar--active',
  18242. MULTILINE: 'mdc-snackbar--multiline',
  18243. ACTION_ON_BOTTOM: 'mdc-snackbar--action-on-bottom'
  18244. };
  18245. var strings = {
  18246. TEXT_SELECTOR: '.mdc-snackbar__text',
  18247. ACTION_WRAPPER_SELECTOR: '.mdc-snackbar__action-wrapper',
  18248. ACTION_BUTTON_SELECTOR: '.mdc-snackbar__action-button',
  18249. SHOW_EVENT: 'MDCSnackbar:show',
  18250. HIDE_EVENT: 'MDCSnackbar:hide'
  18251. };
  18252. var numbers = {
  18253. MESSAGE_TIMEOUT: 2750
  18254. };
  18255. /***/ }),
  18256. /* 128 */
  18257. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18258. "use strict";
  18259. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  18260. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSwitch", function() { return MDCSwitch; });
  18261. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  18262. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_selection_control_index__ = __webpack_require__(4);
  18263. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(129);
  18264. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_ripple_index__ = __webpack_require__(2);
  18265. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__material_ripple_util__ = __webpack_require__(6);
  18266. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSwitchFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  18267. 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; };
  18268. 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); } };
  18269. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  18270. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18271. 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; }
  18272. 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; }
  18273. /**
  18274. * @license
  18275. * Copyright 2018 Google Inc.
  18276. *
  18277. * Permission is hereby granted, free of charge, to any person obtaining a copy
  18278. * of this software and associated documentation files (the "Software"), to deal
  18279. * in the Software without restriction, including without limitation the rights
  18280. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  18281. * copies of the Software, and to permit persons to whom the Software is
  18282. * furnished to do so, subject to the following conditions:
  18283. *
  18284. * The above copyright notice and this permission notice shall be included in
  18285. * all copies or substantial portions of the Software.
  18286. *
  18287. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18288. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18289. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18290. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18291. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18292. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  18293. * THE SOFTWARE.
  18294. */
  18295. /* eslint-disable no-unused-vars */
  18296. /* eslint-enable no-unused-vars */
  18297. /**
  18298. * @extends MDCComponent<!MDCSwitchFoundation>
  18299. * @implements {MDCSelectionControl}
  18300. */
  18301. var MDCSwitch = function (_MDCComponent) {
  18302. _inherits(MDCSwitch, _MDCComponent);
  18303. _createClass(MDCSwitch, null, [{
  18304. key: 'attachTo',
  18305. value: function attachTo(root) {
  18306. return new MDCSwitch(root);
  18307. }
  18308. }]);
  18309. function MDCSwitch() {
  18310. var _ref;
  18311. _classCallCheck(this, MDCSwitch);
  18312. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  18313. args[_key] = arguments[_key];
  18314. }
  18315. /** @private {!MDCRipple} */
  18316. var _this = _possibleConstructorReturn(this, (_ref = MDCSwitch.__proto__ || Object.getPrototypeOf(MDCSwitch)).call.apply(_ref, [this].concat(args)));
  18317. _this.ripple_ = _this.initRipple_();
  18318. /** @private {!Function} */
  18319. _this.changeHandler_;
  18320. return _this;
  18321. }
  18322. _createClass(MDCSwitch, [{
  18323. key: 'destroy',
  18324. value: function destroy() {
  18325. _get(MDCSwitch.prototype.__proto__ || Object.getPrototypeOf(MDCSwitch.prototype), 'destroy', this).call(this);
  18326. this.ripple_.destroy();
  18327. this.nativeControl_.removeEventListener('change', this.changeHandler_);
  18328. }
  18329. }, {
  18330. key: 'initialSyncWithDOM',
  18331. value: function initialSyncWithDOM() {
  18332. this.changeHandler_ = this.foundation_.handleChange.bind(this.foundation_);
  18333. this.nativeControl_.addEventListener('change', this.changeHandler_);
  18334. // Sometimes the checked state of the input element is saved in the history.
  18335. // The switch styling should match the checked state of the input element.
  18336. // Do an initial sync between the native control and the foundation.
  18337. this.checked = this.checked;
  18338. }
  18339. /**
  18340. * Returns the state of the native control element, or null if the native control element is not present.
  18341. * @return {?MDCSelectionControlState}
  18342. * @private
  18343. */
  18344. }, {
  18345. key: 'initRipple_',
  18346. /**
  18347. * @return {!MDCRipple}
  18348. * @private
  18349. */
  18350. value: function initRipple_() {
  18351. var _this2 = this;
  18352. var RIPPLE_SURFACE_SELECTOR = __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.RIPPLE_SURFACE_SELECTOR;
  18353. var rippleSurface = /** @type {!Element} */this.root_.querySelector(RIPPLE_SURFACE_SELECTOR);
  18354. var MATCHES = Object(__WEBPACK_IMPORTED_MODULE_4__material_ripple_util__["getMatchesProperty"])(HTMLElement.prototype);
  18355. var adapter = _extends(__WEBPACK_IMPORTED_MODULE_3__material_ripple_index__["MDCRipple"].createAdapter(this), {
  18356. isUnbounded: function isUnbounded() {
  18357. return true;
  18358. },
  18359. isSurfaceActive: function isSurfaceActive() {
  18360. return _this2.nativeControl_[MATCHES](':active');
  18361. },
  18362. addClass: function addClass(className) {
  18363. return rippleSurface.classList.add(className);
  18364. },
  18365. removeClass: function removeClass(className) {
  18366. return rippleSurface.classList.remove(className);
  18367. },
  18368. registerInteractionHandler: function registerInteractionHandler(type, handler) {
  18369. return _this2.nativeControl_.addEventListener(type, handler);
  18370. },
  18371. deregisterInteractionHandler: function deregisterInteractionHandler(type, handler) {
  18372. return _this2.nativeControl_.removeEventListener(type, handler);
  18373. },
  18374. updateCssVariable: function updateCssVariable(varName, value) {
  18375. return rippleSurface.style.setProperty(varName, value);
  18376. },
  18377. computeBoundingRect: function computeBoundingRect() {
  18378. return rippleSurface.getBoundingClientRect();
  18379. }
  18380. });
  18381. var foundation = new __WEBPACK_IMPORTED_MODULE_3__material_ripple_index__["MDCRippleFoundation"](adapter);
  18382. return new __WEBPACK_IMPORTED_MODULE_3__material_ripple_index__["MDCRipple"](this.root_, foundation);
  18383. }
  18384. /** @return {!MDCSwitchFoundation} */
  18385. }, {
  18386. key: 'getDefaultFoundation',
  18387. value: function getDefaultFoundation() {
  18388. var _this3 = this;
  18389. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]({
  18390. addClass: function addClass(className) {
  18391. return _this3.root_.classList.add(className);
  18392. },
  18393. removeClass: function removeClass(className) {
  18394. return _this3.root_.classList.remove(className);
  18395. },
  18396. setNativeControlChecked: function setNativeControlChecked(checked) {
  18397. return _this3.nativeControl_.checked = checked;
  18398. },
  18399. setNativeControlDisabled: function setNativeControlDisabled(disabled) {
  18400. return _this3.nativeControl_.disabled = disabled;
  18401. }
  18402. });
  18403. }
  18404. /** @return {!MDCRipple} */
  18405. }, {
  18406. key: 'nativeControl_',
  18407. get: function get() {
  18408. var NATIVE_CONTROL_SELECTOR = __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.NATIVE_CONTROL_SELECTOR;
  18409. var el = /** @type {?MDCSelectionControlState} */this.root_.querySelector(NATIVE_CONTROL_SELECTOR);
  18410. return el;
  18411. }
  18412. }, {
  18413. key: 'ripple',
  18414. get: function get() {
  18415. return this.ripple_;
  18416. }
  18417. /** @return {boolean} */
  18418. }, {
  18419. key: 'checked',
  18420. get: function get() {
  18421. return this.nativeControl_.checked;
  18422. }
  18423. /** @param {boolean} checked */
  18424. ,
  18425. set: function set(checked) {
  18426. this.foundation_.setChecked(checked);
  18427. }
  18428. /** @return {boolean} */
  18429. }, {
  18430. key: 'disabled',
  18431. get: function get() {
  18432. return this.nativeControl_.disabled;
  18433. }
  18434. /** @param {boolean} disabled */
  18435. ,
  18436. set: function set(disabled) {
  18437. this.foundation_.setDisabled(disabled);
  18438. }
  18439. }]);
  18440. return MDCSwitch;
  18441. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  18442. /***/ }),
  18443. /* 129 */
  18444. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18445. "use strict";
  18446. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  18447. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(130);
  18448. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(131);
  18449. 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; };
  18450. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  18451. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18452. 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; }
  18453. 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; }
  18454. /**
  18455. * @license
  18456. * Copyright 2018 Google Inc.
  18457. *
  18458. * Permission is hereby granted, free of charge, to any person obtaining a copy
  18459. * of this software and associated documentation files (the "Software"), to deal
  18460. * in the Software without restriction, including without limitation the rights
  18461. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  18462. * copies of the Software, and to permit persons to whom the Software is
  18463. * furnished to do so, subject to the following conditions:
  18464. *
  18465. * The above copyright notice and this permission notice shall be included in
  18466. * all copies or substantial portions of the Software.
  18467. *
  18468. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18469. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18470. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18471. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18472. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18473. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  18474. * THE SOFTWARE.
  18475. */
  18476. /* eslint-enable no-unused-vars */
  18477. /**
  18478. * @extends {MDCFoundation<!MDCSwitchAdapter>}
  18479. */
  18480. var MDCSwitchFoundation = function (_MDCFoundation) {
  18481. _inherits(MDCSwitchFoundation, _MDCFoundation);
  18482. _createClass(MDCSwitchFoundation, null, [{
  18483. key: 'strings',
  18484. /** @return enum {string} */
  18485. get: function get() {
  18486. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  18487. }
  18488. /** @return enum {string} */
  18489. }, {
  18490. key: 'cssClasses',
  18491. get: function get() {
  18492. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  18493. }
  18494. /** @return {!MDCSwitchAdapter} */
  18495. }, {
  18496. key: 'defaultAdapter',
  18497. get: function get() {
  18498. return (/** @type {!MDCSwitchAdapter} */{
  18499. addClass: function addClass() /* className: string */{},
  18500. removeClass: function removeClass() /* className: string */{},
  18501. setNativeControlChecked: function setNativeControlChecked() /* checked: boolean */{},
  18502. setNativeControlDisabled: function setNativeControlDisabled() /* disabled: boolean */{}
  18503. }
  18504. );
  18505. }
  18506. }]);
  18507. function MDCSwitchFoundation(adapter) {
  18508. _classCallCheck(this, MDCSwitchFoundation);
  18509. return _possibleConstructorReturn(this, (MDCSwitchFoundation.__proto__ || Object.getPrototypeOf(MDCSwitchFoundation)).call(this, _extends(MDCSwitchFoundation.defaultAdapter, adapter)));
  18510. }
  18511. /** @param {boolean} checked */
  18512. _createClass(MDCSwitchFoundation, [{
  18513. key: 'setChecked',
  18514. value: function setChecked(checked) {
  18515. this.adapter_.setNativeControlChecked(checked);
  18516. this.updateCheckedStyling_(checked);
  18517. }
  18518. /** @param {boolean} disabled */
  18519. }, {
  18520. key: 'setDisabled',
  18521. value: function setDisabled(disabled) {
  18522. this.adapter_.setNativeControlDisabled(disabled);
  18523. if (disabled) {
  18524. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].DISABLED);
  18525. } else {
  18526. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].DISABLED);
  18527. }
  18528. }
  18529. /**
  18530. * Handles the change event for the switch native control.
  18531. * @param {!Event} evt
  18532. */
  18533. }, {
  18534. key: 'handleChange',
  18535. value: function handleChange(evt) {
  18536. this.updateCheckedStyling_(evt.target.checked);
  18537. }
  18538. /**
  18539. * Updates the styling of the switch based on its checked state.
  18540. * @param {boolean} checked
  18541. * @private
  18542. */
  18543. }, {
  18544. key: 'updateCheckedStyling_',
  18545. value: function updateCheckedStyling_(checked) {
  18546. if (checked) {
  18547. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CHECKED);
  18548. } else {
  18549. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CHECKED);
  18550. }
  18551. }
  18552. }]);
  18553. return MDCSwitchFoundation;
  18554. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  18555. /* harmony default export */ __webpack_exports__["a"] = (MDCSwitchFoundation);
  18556. /***/ }),
  18557. /* 130 */
  18558. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18559. "use strict";
  18560. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  18561. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18562. /**
  18563. * @license
  18564. * Copyright 2018 Google Inc.
  18565. *
  18566. * Permission is hereby granted, free of charge, to any person obtaining a copy
  18567. * of this software and associated documentation files (the "Software"), to deal
  18568. * in the Software without restriction, including without limitation the rights
  18569. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  18570. * copies of the Software, and to permit persons to whom the Software is
  18571. * furnished to do so, subject to the following conditions:
  18572. *
  18573. * The above copyright notice and this permission notice shall be included in
  18574. * all copies or substantial portions of the Software.
  18575. *
  18576. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18577. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18578. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18579. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18580. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18581. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  18582. * THE SOFTWARE.
  18583. */
  18584. /* eslint no-unused-vars: [2, {"args": "none"}] */
  18585. /**
  18586. * Adapter for MDC Switch. Provides an interface for managing
  18587. * - classes
  18588. * - dom
  18589. *
  18590. * Additionally, provides type information for the adapter to the Closure
  18591. * compiler.
  18592. *
  18593. * Implement this adapter for your framework of choice to delegate updates to
  18594. * the component in your framework of choice. See architecture documentation
  18595. * for more details.
  18596. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  18597. *
  18598. * @record
  18599. */
  18600. var MDCSwitchAdapter = function () {
  18601. function MDCSwitchAdapter() {
  18602. _classCallCheck(this, MDCSwitchAdapter);
  18603. }
  18604. _createClass(MDCSwitchAdapter, [{
  18605. key: "addClass",
  18606. /** @param {string} className */
  18607. value: function addClass(className) {}
  18608. /** @param {string} className */
  18609. }, {
  18610. key: "removeClass",
  18611. value: function removeClass(className) {}
  18612. /** @param {boolean} checked */
  18613. }, {
  18614. key: "setNativeControlChecked",
  18615. value: function setNativeControlChecked(checked) {}
  18616. /** @param {boolean} disabled */
  18617. }, {
  18618. key: "setNativeControlDisabled",
  18619. value: function setNativeControlDisabled(disabled) {}
  18620. }]);
  18621. return MDCSwitchAdapter;
  18622. }();
  18623. /* unused harmony default export */ var _unused_webpack_default_export = (MDCSwitchAdapter);
  18624. /***/ }),
  18625. /* 131 */
  18626. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18627. "use strict";
  18628. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  18629. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  18630. /**
  18631. * @license
  18632. * Copyright 2018 Google Inc.
  18633. *
  18634. * Permission is hereby granted, free of charge, to any person obtaining a copy
  18635. * of this software and associated documentation files (the "Software"), to deal
  18636. * in the Software without restriction, including without limitation the rights
  18637. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  18638. * copies of the Software, and to permit persons to whom the Software is
  18639. * furnished to do so, subject to the following conditions:
  18640. *
  18641. * The above copyright notice and this permission notice shall be included in
  18642. * all copies or substantial portions of the Software.
  18643. *
  18644. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18645. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18646. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18647. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18648. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18649. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  18650. * THE SOFTWARE.
  18651. */
  18652. /** @enum {string} */
  18653. var cssClasses = {
  18654. CHECKED: 'mdc-switch--checked',
  18655. DISABLED: 'mdc-switch--disabled'
  18656. };
  18657. /** @enum {string} */
  18658. var strings = {
  18659. NATIVE_CONTROL_SELECTOR: '.mdc-switch__native-control',
  18660. RIPPLE_SURFACE_SELECTOR: '.mdc-switch__thumb-underlay'
  18661. };
  18662. /***/ }),
  18663. /* 132 */
  18664. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18665. "use strict";
  18666. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  18667. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  18668. /**
  18669. * @license
  18670. * Copyright 2018 Google Inc.
  18671. *
  18672. * Permission is hereby granted, free of charge, to any person obtaining a copy
  18673. * of this software and associated documentation files (the "Software"), to deal
  18674. * in the Software without restriction, including without limitation the rights
  18675. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  18676. * copies of the Software, and to permit persons to whom the Software is
  18677. * furnished to do so, subject to the following conditions:
  18678. *
  18679. * The above copyright notice and this permission notice shall be included in
  18680. * all copies or substantial portions of the Software.
  18681. *
  18682. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18683. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18684. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18685. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18686. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18687. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  18688. * THE SOFTWARE.
  18689. */
  18690. /** @enum {string} */
  18691. var cssClasses = {
  18692. ACTIVE: 'mdc-tab-indicator--active',
  18693. FADE: 'mdc-tab-indicator--fade',
  18694. NO_TRANSITION: 'mdc-tab-indicator--no-transition'
  18695. };
  18696. /** @enum {string} */
  18697. var strings = {
  18698. CONTENT_SELECTOR: '.mdc-tab-indicator__content'
  18699. };
  18700. /***/ }),
  18701. /* 133 */
  18702. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18703. "use strict";
  18704. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation__ = __webpack_require__(26);
  18705. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  18706. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18707. 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; }
  18708. 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; }
  18709. /**
  18710. * @license
  18711. * Copyright 2018 Google Inc.
  18712. *
  18713. * Permission is hereby granted, free of charge, to any person obtaining a copy
  18714. * of this software and associated documentation files (the "Software"), to deal
  18715. * in the Software without restriction, including without limitation the rights
  18716. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  18717. * copies of the Software, and to permit persons to whom the Software is
  18718. * furnished to do so, subject to the following conditions:
  18719. *
  18720. * The above copyright notice and this permission notice shall be included in
  18721. * all copies or substantial portions of the Software.
  18722. *
  18723. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18724. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18725. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18726. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18727. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18728. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  18729. * THE SOFTWARE.
  18730. */
  18731. /**
  18732. * @extends {MDCTabIndicatorFoundation}
  18733. * @final
  18734. */
  18735. var MDCSlidingTabIndicatorFoundation = function (_MDCTabIndicatorFound) {
  18736. _inherits(MDCSlidingTabIndicatorFoundation, _MDCTabIndicatorFound);
  18737. function MDCSlidingTabIndicatorFoundation() {
  18738. _classCallCheck(this, MDCSlidingTabIndicatorFoundation);
  18739. return _possibleConstructorReturn(this, (MDCSlidingTabIndicatorFoundation.__proto__ || Object.getPrototypeOf(MDCSlidingTabIndicatorFoundation)).apply(this, arguments));
  18740. }
  18741. _createClass(MDCSlidingTabIndicatorFoundation, [{
  18742. key: 'activate',
  18743. /** @param {!ClientRect=} previousIndicatorClientRect */
  18744. value: function activate(previousIndicatorClientRect) {
  18745. // Early exit if no indicator is present to handle cases where an indicator
  18746. // may be activated without a prior indicator state
  18747. if (!previousIndicatorClientRect) {
  18748. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */].cssClasses.ACTIVE);
  18749. return;
  18750. }
  18751. // This animation uses the FLIP approach. You can read more about it at the link below:
  18752. // https://aerotwist.com/blog/flip-your-animations/
  18753. // Calculate the dimensions based on the dimensions of the previous indicator
  18754. var currentClientRect = this.computeContentClientRect();
  18755. var widthDelta = previousIndicatorClientRect.width / currentClientRect.width;
  18756. var xPosition = previousIndicatorClientRect.left - currentClientRect.left;
  18757. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */].cssClasses.NO_TRANSITION);
  18758. this.adapter_.setContentStyleProperty('transform', 'translateX(' + xPosition + 'px) scaleX(' + widthDelta + ')');
  18759. // Force repaint before updating classes and transform to ensure the transform properly takes effect
  18760. this.computeContentClientRect();
  18761. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */].cssClasses.NO_TRANSITION);
  18762. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */].cssClasses.ACTIVE);
  18763. this.adapter_.setContentStyleProperty('transform', '');
  18764. }
  18765. }, {
  18766. key: 'deactivate',
  18767. value: function deactivate() {
  18768. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */].cssClasses.ACTIVE);
  18769. }
  18770. }]);
  18771. return MDCSlidingTabIndicatorFoundation;
  18772. }(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */]);
  18773. /* harmony default export */ __webpack_exports__["a"] = (MDCSlidingTabIndicatorFoundation);
  18774. /***/ }),
  18775. /* 134 */
  18776. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18777. "use strict";
  18778. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation__ = __webpack_require__(26);
  18779. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  18780. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18781. 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; }
  18782. 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; }
  18783. /**
  18784. * @license
  18785. * Copyright 2018 Google Inc.
  18786. *
  18787. * Permission is hereby granted, free of charge, to any person obtaining a copy
  18788. * of this software and associated documentation files (the "Software"), to deal
  18789. * in the Software without restriction, including without limitation the rights
  18790. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  18791. * copies of the Software, and to permit persons to whom the Software is
  18792. * furnished to do so, subject to the following conditions:
  18793. *
  18794. * The above copyright notice and this permission notice shall be included in
  18795. * all copies or substantial portions of the Software.
  18796. *
  18797. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18798. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18799. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18800. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18801. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18802. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  18803. * THE SOFTWARE.
  18804. */
  18805. /**
  18806. * @extends {MDCTabIndicatorFoundation}
  18807. * @final
  18808. */
  18809. var MDCFadingTabIndicatorFoundation = function (_MDCTabIndicatorFound) {
  18810. _inherits(MDCFadingTabIndicatorFoundation, _MDCTabIndicatorFound);
  18811. function MDCFadingTabIndicatorFoundation() {
  18812. _classCallCheck(this, MDCFadingTabIndicatorFoundation);
  18813. return _possibleConstructorReturn(this, (MDCFadingTabIndicatorFoundation.__proto__ || Object.getPrototypeOf(MDCFadingTabIndicatorFoundation)).apply(this, arguments));
  18814. }
  18815. _createClass(MDCFadingTabIndicatorFoundation, [{
  18816. key: 'activate',
  18817. value: function activate() {
  18818. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */].cssClasses.ACTIVE);
  18819. }
  18820. }, {
  18821. key: 'deactivate',
  18822. value: function deactivate() {
  18823. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */].cssClasses.ACTIVE);
  18824. }
  18825. }]);
  18826. return MDCFadingTabIndicatorFoundation;
  18827. }(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */]);
  18828. /* harmony default export */ __webpack_exports__["a"] = (MDCFadingTabIndicatorFoundation);
  18829. /***/ }),
  18830. /* 135 */
  18831. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18832. "use strict";
  18833. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  18834. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(10);
  18835. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(136);
  18836. 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; };
  18837. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  18838. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18839. 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; }
  18840. 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; }
  18841. /**
  18842. * @license
  18843. * Copyright 2018 Google Inc.
  18844. *
  18845. * Permission is hereby granted, free of charge, to any person obtaining a copy
  18846. * of this software and associated documentation files (the "Software"), to deal
  18847. * in the Software without restriction, including without limitation the rights
  18848. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  18849. * copies of the Software, and to permit persons to whom the Software is
  18850. * furnished to do so, subject to the following conditions:
  18851. *
  18852. * The above copyright notice and this permission notice shall be included in
  18853. * all copies or substantial portions of the Software.
  18854. *
  18855. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18856. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18857. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18858. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18859. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18860. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  18861. * THE SOFTWARE.
  18862. */
  18863. /* eslint-disable no-unused-vars */
  18864. /* eslint-enable no-unused-vars */
  18865. /**
  18866. * @extends {MDCFoundation<!MDCTabAdapter>}
  18867. * @final
  18868. */
  18869. var MDCTabFoundation = function (_MDCFoundation) {
  18870. _inherits(MDCTabFoundation, _MDCFoundation);
  18871. _createClass(MDCTabFoundation, null, [{
  18872. key: 'cssClasses',
  18873. /** @return enum {string} */
  18874. get: function get() {
  18875. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  18876. }
  18877. /** @return enum {string} */
  18878. }, {
  18879. key: 'strings',
  18880. get: function get() {
  18881. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  18882. }
  18883. /**
  18884. * @see MDCTabAdapter for typing information
  18885. * @return {!MDCTabAdapter}
  18886. */
  18887. }, {
  18888. key: 'defaultAdapter',
  18889. get: function get() {
  18890. return (/** @type {!MDCTabAdapter} */{
  18891. addClass: function addClass() {},
  18892. removeClass: function removeClass() {},
  18893. hasClass: function hasClass() {},
  18894. setAttr: function setAttr() {},
  18895. activateIndicator: function activateIndicator() {},
  18896. deactivateIndicator: function deactivateIndicator() {},
  18897. notifyInteracted: function notifyInteracted() {},
  18898. getOffsetLeft: function getOffsetLeft() {},
  18899. getOffsetWidth: function getOffsetWidth() {},
  18900. getContentOffsetLeft: function getContentOffsetLeft() {},
  18901. getContentOffsetWidth: function getContentOffsetWidth() {},
  18902. focus: function focus() {}
  18903. }
  18904. );
  18905. }
  18906. /** @param {!MDCTabAdapter} adapter */
  18907. }]);
  18908. function MDCTabFoundation(adapter) {
  18909. _classCallCheck(this, MDCTabFoundation);
  18910. /** @private {boolean} */
  18911. var _this = _possibleConstructorReturn(this, (MDCTabFoundation.__proto__ || Object.getPrototypeOf(MDCTabFoundation)).call(this, _extends(MDCTabFoundation.defaultAdapter, adapter)));
  18912. _this.focusOnActivate_ = true;
  18913. return _this;
  18914. }
  18915. /**
  18916. * Handles the "click" event
  18917. */
  18918. _createClass(MDCTabFoundation, [{
  18919. key: 'handleClick',
  18920. value: function handleClick() {
  18921. // It's up to the parent component to keep track of the active Tab and
  18922. // ensure we don't activate a Tab that's already active.
  18923. this.adapter_.notifyInteracted();
  18924. }
  18925. /**
  18926. * Returns the Tab's active state
  18927. * @return {boolean}
  18928. */
  18929. }, {
  18930. key: 'isActive',
  18931. value: function isActive() {
  18932. return this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ACTIVE);
  18933. }
  18934. /**
  18935. * Sets whether the tab should focus itself when activated
  18936. * @param {boolean} focusOnActivate
  18937. */
  18938. }, {
  18939. key: 'setFocusOnActivate',
  18940. value: function setFocusOnActivate(focusOnActivate) {
  18941. this.focusOnActivate_ = focusOnActivate;
  18942. }
  18943. /**
  18944. * Activates the Tab
  18945. * @param {!ClientRect=} previousIndicatorClientRect
  18946. */
  18947. }, {
  18948. key: 'activate',
  18949. value: function activate(previousIndicatorClientRect) {
  18950. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ACTIVE);
  18951. this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_SELECTED, 'true');
  18952. this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].TABINDEX, '0');
  18953. this.adapter_.activateIndicator(previousIndicatorClientRect);
  18954. if (this.focusOnActivate_) {
  18955. this.adapter_.focus();
  18956. }
  18957. }
  18958. /**
  18959. * Deactivates the Tab
  18960. */
  18961. }, {
  18962. key: 'deactivate',
  18963. value: function deactivate() {
  18964. // Early exit
  18965. if (!this.isActive()) {
  18966. return;
  18967. }
  18968. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ACTIVE);
  18969. this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_SELECTED, 'false');
  18970. this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].TABINDEX, '-1');
  18971. this.adapter_.deactivateIndicator();
  18972. }
  18973. /**
  18974. * Returns the dimensions of the Tab
  18975. * @return {!MDCTabDimensions}
  18976. */
  18977. }, {
  18978. key: 'computeDimensions',
  18979. value: function computeDimensions() {
  18980. var rootWidth = this.adapter_.getOffsetWidth();
  18981. var rootLeft = this.adapter_.getOffsetLeft();
  18982. var contentWidth = this.adapter_.getContentOffsetWidth();
  18983. var contentLeft = this.adapter_.getContentOffsetLeft();
  18984. return {
  18985. rootLeft: rootLeft,
  18986. rootRight: rootLeft + rootWidth,
  18987. contentLeft: rootLeft + contentLeft,
  18988. contentRight: rootLeft + contentLeft + contentWidth
  18989. };
  18990. }
  18991. }]);
  18992. return MDCTabFoundation;
  18993. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  18994. /* harmony default export */ __webpack_exports__["a"] = (MDCTabFoundation);
  18995. /***/ }),
  18996. /* 136 */
  18997. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18998. "use strict";
  18999. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  19000. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  19001. /**
  19002. * @license
  19003. * Copyright 2018 Google Inc.
  19004. *
  19005. * Permission is hereby granted, free of charge, to any person obtaining a copy
  19006. * of this software and associated documentation files (the "Software"), to deal
  19007. * in the Software without restriction, including without limitation the rights
  19008. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  19009. * copies of the Software, and to permit persons to whom the Software is
  19010. * furnished to do so, subject to the following conditions:
  19011. *
  19012. * The above copyright notice and this permission notice shall be included in
  19013. * all copies or substantial portions of the Software.
  19014. *
  19015. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19016. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19017. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19018. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19019. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19020. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19021. * THE SOFTWARE.
  19022. */
  19023. /** @enum {string} */
  19024. var cssClasses = {
  19025. ACTIVE: 'mdc-tab--active'
  19026. };
  19027. /** @enum {string} */
  19028. var strings = {
  19029. ARIA_SELECTED: 'aria-selected',
  19030. RIPPLE_SELECTOR: '.mdc-tab__ripple',
  19031. CONTENT_SELECTOR: '.mdc-tab__content',
  19032. TAB_INDICATOR_SELECTOR: '.mdc-tab-indicator',
  19033. TABINDEX: 'tabIndex',
  19034. INTERACTED_EVENT: 'MDCTab:interacted'
  19035. };
  19036. /***/ }),
  19037. /* 137 */
  19038. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19039. "use strict";
  19040. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  19041. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTabBar", function() { return MDCTabBar; });
  19042. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  19043. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_tab_index__ = __webpack_require__(25);
  19044. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_tab_scroller_index__ = __webpack_require__(56);
  19045. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__adapter__ = __webpack_require__(58);
  19046. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation__ = __webpack_require__(143);
  19047. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTabBarFoundation", function() { return __WEBPACK_IMPORTED_MODULE_4__foundation__["a"]; });
  19048. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  19049. 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); } };
  19050. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19051. 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; }
  19052. 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; }
  19053. /**
  19054. * @license
  19055. * Copyright 2018 Google Inc.
  19056. *
  19057. * Permission is hereby granted, free of charge, to any person obtaining a copy
  19058. * of this software and associated documentation files (the "Software"), to deal
  19059. * in the Software without restriction, including without limitation the rights
  19060. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  19061. * copies of the Software, and to permit persons to whom the Software is
  19062. * furnished to do so, subject to the following conditions:
  19063. *
  19064. * The above copyright notice and this permission notice shall be included in
  19065. * all copies or substantial portions of the Software.
  19066. *
  19067. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19068. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19069. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19070. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19071. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19072. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19073. * THE SOFTWARE.
  19074. */
  19075. /**
  19076. * @extends {MDCComponent<!MDCTabBarFoundation>}
  19077. * @final
  19078. */
  19079. var MDCTabBar = function (_MDCComponent) {
  19080. _inherits(MDCTabBar, _MDCComponent);
  19081. /**
  19082. * @param {...?} args
  19083. */
  19084. function MDCTabBar() {
  19085. var _ref;
  19086. _classCallCheck(this, MDCTabBar);
  19087. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  19088. args[_key] = arguments[_key];
  19089. }
  19090. /** @private {!Array<!MDCTab>} */
  19091. var _this = _possibleConstructorReturn(this, (_ref = MDCTabBar.__proto__ || Object.getPrototypeOf(MDCTabBar)).call.apply(_ref, [this].concat(args)));
  19092. _this.tabList_;
  19093. /** @type {(function(!Element): !MDCTab)} */
  19094. _this.tabFactory_;
  19095. /** @private {?MDCTabScroller} */
  19096. _this.tabScroller_;
  19097. /** @type {(function(!Element): !MDCTabScroller)} */
  19098. _this.tabScrollerFactory_;
  19099. /** @private {?function(?Event): undefined} */
  19100. _this.handleTabInteraction_;
  19101. /** @private {?function(?Event): undefined} */
  19102. _this.handleKeyDown_;
  19103. return _this;
  19104. }
  19105. /**
  19106. * @param {!Element} root
  19107. * @return {!MDCTabBar}
  19108. */
  19109. _createClass(MDCTabBar, [{
  19110. key: 'initialize',
  19111. /**
  19112. * @param {(function(!Element): !MDCTab)=} tabFactory A function which creates a new MDCTab
  19113. * @param {(function(!Element): !MDCTabScroller)=} tabScrollerFactory A function which creates a new MDCTabScroller
  19114. */
  19115. value: function initialize() {
  19116. var _this2 = this;
  19117. var tabFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (el) {
  19118. return new __WEBPACK_IMPORTED_MODULE_1__material_tab_index__["MDCTab"](el);
  19119. };
  19120. var tabScrollerFactory = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (el) {
  19121. return new __WEBPACK_IMPORTED_MODULE_2__material_tab_scroller_index__["MDCTabScroller"](el);
  19122. };
  19123. this.tabFactory_ = tabFactory;
  19124. this.tabScrollerFactory_ = tabScrollerFactory;
  19125. this.tabList_ = this.getTabElements_().map(function (el) {
  19126. return _this2.tabFactory_(el);
  19127. });
  19128. var tabScrollerElement = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* default */].strings.TAB_SCROLLER_SELECTOR);
  19129. if (tabScrollerElement) {
  19130. this.tabScroller_ = this.tabScrollerFactory_(tabScrollerElement);
  19131. }
  19132. }
  19133. }, {
  19134. key: 'initialSyncWithDOM',
  19135. value: function initialSyncWithDOM() {
  19136. var _this3 = this;
  19137. this.handleTabInteraction_ = function (evt) {
  19138. return _this3.foundation_.handleTabInteraction(evt);
  19139. };
  19140. this.handleKeyDown_ = function (evt) {
  19141. return _this3.foundation_.handleKeyDown(evt);
  19142. };
  19143. this.root_.addEventListener(__WEBPACK_IMPORTED_MODULE_1__material_tab_index__["MDCTabFoundation"].strings.INTERACTED_EVENT, this.handleTabInteraction_);
  19144. this.root_.addEventListener('keydown', this.handleKeyDown_);
  19145. for (var i = 0; i < this.tabList_.length; i++) {
  19146. if (this.tabList_[i].active) {
  19147. this.scrollIntoView(i);
  19148. break;
  19149. }
  19150. }
  19151. }
  19152. }, {
  19153. key: 'destroy',
  19154. value: function destroy() {
  19155. _get(MDCTabBar.prototype.__proto__ || Object.getPrototypeOf(MDCTabBar.prototype), 'destroy', this).call(this);
  19156. this.root_.removeEventListener(__WEBPACK_IMPORTED_MODULE_1__material_tab_index__["MDCTabFoundation"].strings.INTERACTED_EVENT, this.handleTabInteraction_);
  19157. this.root_.removeEventListener('keydown', this.handleKeyDown_);
  19158. this.tabList_.forEach(function (tab) {
  19159. return tab.destroy();
  19160. });
  19161. this.tabScroller_.destroy();
  19162. }
  19163. /**
  19164. * @return {!MDCTabBarFoundation}
  19165. */
  19166. }, {
  19167. key: 'getDefaultFoundation',
  19168. value: function getDefaultFoundation() {
  19169. var _this4 = this;
  19170. return new __WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* default */](
  19171. /** @type {!MDCTabBarAdapter} */{
  19172. scrollTo: function scrollTo(scrollX) {
  19173. return _this4.tabScroller_.scrollTo(scrollX);
  19174. },
  19175. incrementScroll: function incrementScroll(scrollXIncrement) {
  19176. return _this4.tabScroller_.incrementScroll(scrollXIncrement);
  19177. },
  19178. getScrollPosition: function getScrollPosition() {
  19179. return _this4.tabScroller_.getScrollPosition();
  19180. },
  19181. getScrollContentWidth: function getScrollContentWidth() {
  19182. return _this4.tabScroller_.getScrollContentWidth();
  19183. },
  19184. getOffsetWidth: function getOffsetWidth() {
  19185. return _this4.root_.offsetWidth;
  19186. },
  19187. isRTL: function isRTL() {
  19188. return window.getComputedStyle(_this4.root_).getPropertyValue('direction') === 'rtl';
  19189. },
  19190. setActiveTab: function setActiveTab(index) {
  19191. return _this4.foundation_.activateTab(index);
  19192. },
  19193. activateTabAtIndex: function activateTabAtIndex(index, clientRect) {
  19194. return _this4.tabList_[index].activate(clientRect);
  19195. },
  19196. deactivateTabAtIndex: function deactivateTabAtIndex(index) {
  19197. return _this4.tabList_[index].deactivate();
  19198. },
  19199. focusTabAtIndex: function focusTabAtIndex(index) {
  19200. return _this4.tabList_[index].focus();
  19201. },
  19202. getTabIndicatorClientRectAtIndex: function getTabIndicatorClientRectAtIndex(index) {
  19203. return _this4.tabList_[index].computeIndicatorClientRect();
  19204. },
  19205. getTabDimensionsAtIndex: function getTabDimensionsAtIndex(index) {
  19206. return _this4.tabList_[index].computeDimensions();
  19207. },
  19208. getPreviousActiveTabIndex: function getPreviousActiveTabIndex() {
  19209. for (var i = 0; i < _this4.tabList_.length; i++) {
  19210. if (_this4.tabList_[i].active) {
  19211. return i;
  19212. }
  19213. }
  19214. return -1;
  19215. },
  19216. getFocusedTabIndex: function getFocusedTabIndex() {
  19217. var tabElements = _this4.getTabElements_();
  19218. var activeElement = document.activeElement;
  19219. return tabElements.indexOf(activeElement);
  19220. },
  19221. getIndexOfTab: function getIndexOfTab(tabToFind) {
  19222. return _this4.tabList_.indexOf(tabToFind);
  19223. },
  19224. getTabListLength: function getTabListLength() {
  19225. return _this4.tabList_.length;
  19226. },
  19227. notifyTabActivated: function notifyTabActivated(index) {
  19228. return _this4.emit(__WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* default */].strings.TAB_ACTIVATED_EVENT, { index: index }, true);
  19229. }
  19230. });
  19231. }
  19232. /**
  19233. * Activates the tab at the given index
  19234. * @param {number} index The index of the tab
  19235. */
  19236. }, {
  19237. key: 'activateTab',
  19238. value: function activateTab(index) {
  19239. this.foundation_.activateTab(index);
  19240. }
  19241. /**
  19242. * Scrolls the tab at the given index into view
  19243. * @param {number} index THe index of the tab
  19244. */
  19245. }, {
  19246. key: 'scrollIntoView',
  19247. value: function scrollIntoView(index) {
  19248. this.foundation_.scrollIntoView(index);
  19249. }
  19250. }, {
  19251. key: 'getTabElements_',
  19252. value: function getTabElements_() {
  19253. return [].slice.call(this.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* default */].strings.TAB_SELECTOR));
  19254. }
  19255. }, {
  19256. key: 'focusOnActivate',
  19257. set: function set(focusOnActivate) {
  19258. this.tabList_.forEach(function (tab) {
  19259. return tab.focusOnActivate = focusOnActivate;
  19260. });
  19261. }
  19262. }, {
  19263. key: 'useAutomaticActivation',
  19264. set: function set(useAutomaticActivation) {
  19265. this.foundation_.setUseAutomaticActivation(useAutomaticActivation);
  19266. }
  19267. }], [{
  19268. key: 'attachTo',
  19269. value: function attachTo(root) {
  19270. return new MDCTabBar(root);
  19271. }
  19272. }]);
  19273. return MDCTabBar;
  19274. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  19275. /***/ }),
  19276. /* 138 */
  19277. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19278. "use strict";
  19279. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  19280. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(57);
  19281. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__adapter__ = __webpack_require__(5);
  19282. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__rtl_scroller__ = __webpack_require__(11);
  19283. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__rtl_default_scroller__ = __webpack_require__(139);
  19284. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__rtl_negative_scroller__ = __webpack_require__(140);
  19285. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__rtl_reverse_scroller__ = __webpack_require__(141);
  19286. 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; };
  19287. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  19288. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19289. 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; }
  19290. 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; }
  19291. /**
  19292. * @license
  19293. * Copyright 2018 Google Inc.
  19294. *
  19295. * Permission is hereby granted, free of charge, to any person obtaining a copy
  19296. * of this software and associated documentation files (the "Software"), to deal
  19297. * in the Software without restriction, including without limitation the rights
  19298. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  19299. * copies of the Software, and to permit persons to whom the Software is
  19300. * furnished to do so, subject to the following conditions:
  19301. *
  19302. * The above copyright notice and this permission notice shall be included in
  19303. * all copies or substantial portions of the Software.
  19304. *
  19305. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19306. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19307. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19308. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19309. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19310. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19311. * THE SOFTWARE.
  19312. */
  19313. /* eslint-disable no-unused-vars */
  19314. /* eslint-enable no-unused-vars */
  19315. /**
  19316. * @extends {MDCFoundation<!MDCTabScrollerAdapter>}
  19317. * @final
  19318. */
  19319. var MDCTabScrollerFoundation = function (_MDCFoundation) {
  19320. _inherits(MDCTabScrollerFoundation, _MDCFoundation);
  19321. _createClass(MDCTabScrollerFoundation, null, [{
  19322. key: 'cssClasses',
  19323. /** @return enum {string} */
  19324. get: function get() {
  19325. return __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */];
  19326. }
  19327. /** @return enum {string} */
  19328. }, {
  19329. key: 'strings',
  19330. get: function get() {
  19331. return __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */];
  19332. }
  19333. /**
  19334. * @see MDCTabScrollerAdapter for typing information
  19335. * @return {!MDCTabScrollerAdapter}
  19336. */
  19337. }, {
  19338. key: 'defaultAdapter',
  19339. get: function get() {
  19340. return (/** @type {!MDCTabScrollerAdapter} */{
  19341. eventTargetMatchesSelector: function eventTargetMatchesSelector() {},
  19342. addClass: function addClass() {},
  19343. removeClass: function removeClass() {},
  19344. addScrollAreaClass: function addScrollAreaClass() {},
  19345. setScrollAreaStyleProperty: function setScrollAreaStyleProperty() {},
  19346. setScrollContentStyleProperty: function setScrollContentStyleProperty() {},
  19347. getScrollContentStyleValue: function getScrollContentStyleValue() {},
  19348. setScrollAreaScrollLeft: function setScrollAreaScrollLeft() {},
  19349. getScrollAreaScrollLeft: function getScrollAreaScrollLeft() {},
  19350. getScrollContentOffsetWidth: function getScrollContentOffsetWidth() {},
  19351. getScrollAreaOffsetWidth: function getScrollAreaOffsetWidth() {},
  19352. computeScrollAreaClientRect: function computeScrollAreaClientRect() {},
  19353. computeScrollContentClientRect: function computeScrollContentClientRect() {},
  19354. computeHorizontalScrollbarHeight: function computeHorizontalScrollbarHeight() {}
  19355. }
  19356. );
  19357. }
  19358. /** @param {!MDCTabScrollerAdapter} adapter */
  19359. }]);
  19360. function MDCTabScrollerFoundation(adapter) {
  19361. _classCallCheck(this, MDCTabScrollerFoundation);
  19362. /**
  19363. * This boolean controls whether we should handle the transitionend and interaction events during the animation.
  19364. * @private {boolean}
  19365. */
  19366. var _this = _possibleConstructorReturn(this, (MDCTabScrollerFoundation.__proto__ || Object.getPrototypeOf(MDCTabScrollerFoundation)).call(this, _extends(MDCTabScrollerFoundation.defaultAdapter, adapter)));
  19367. _this.isAnimating_ = false;
  19368. /**
  19369. * The MDCTabScrollerRTL instance varies per browser and allows us to encapsulate the peculiar browser behavior
  19370. * of RTL scrolling in it's own class.
  19371. * @private {?MDCTabScrollerRTL}
  19372. */
  19373. _this.rtlScrollerInstance_;
  19374. return _this;
  19375. }
  19376. _createClass(MDCTabScrollerFoundation, [{
  19377. key: 'init',
  19378. value: function init() {
  19379. // Compute horizontal scrollbar height on scroller with overflow initially hidden, then update overflow to scroll
  19380. // and immediately adjust bottom margin to avoid the scrollbar initially appearing before JS runs.
  19381. var horizontalScrollbarHeight = this.adapter_.computeHorizontalScrollbarHeight();
  19382. this.adapter_.setScrollAreaStyleProperty('margin-bottom', -horizontalScrollbarHeight + 'px');
  19383. this.adapter_.addScrollAreaClass(MDCTabScrollerFoundation.cssClasses.SCROLL_AREA_SCROLL);
  19384. }
  19385. /**
  19386. * Computes the current visual scroll position
  19387. * @return {number}
  19388. */
  19389. }, {
  19390. key: 'getScrollPosition',
  19391. value: function getScrollPosition() {
  19392. if (this.isRTL_()) {
  19393. return this.computeCurrentScrollPositionRTL_();
  19394. }
  19395. var currentTranslateX = this.calculateCurrentTranslateX_();
  19396. var scrollLeft = this.adapter_.getScrollAreaScrollLeft();
  19397. return scrollLeft - currentTranslateX;
  19398. }
  19399. /**
  19400. * Handles interaction events that occur during transition
  19401. */
  19402. }, {
  19403. key: 'handleInteraction',
  19404. value: function handleInteraction() {
  19405. // Early exit if we aren't animating
  19406. if (!this.isAnimating_) {
  19407. return;
  19408. }
  19409. // Prevent other event listeners from handling this event
  19410. this.stopScrollAnimation_();
  19411. }
  19412. /**
  19413. * Handles the transitionend event
  19414. * @param {!Event} evt
  19415. */
  19416. }, {
  19417. key: 'handleTransitionEnd',
  19418. value: function handleTransitionEnd(evt) {
  19419. // Early exit if we aren't animating or the event was triggered by a different element.
  19420. if (!this.isAnimating_ || !this.adapter_.eventTargetMatchesSelector(evt.target, MDCTabScrollerFoundation.strings.CONTENT_SELECTOR)) {
  19421. return;
  19422. }
  19423. this.isAnimating_ = false;
  19424. this.adapter_.removeClass(MDCTabScrollerFoundation.cssClasses.ANIMATING);
  19425. }
  19426. /**
  19427. * Increment the scroll value by the scrollXIncrement
  19428. * @param {number} scrollXIncrement The value by which to increment the scroll position
  19429. */
  19430. }, {
  19431. key: 'incrementScroll',
  19432. value: function incrementScroll(scrollXIncrement) {
  19433. // Early exit for non-operational increment values
  19434. if (scrollXIncrement === 0) {
  19435. return;
  19436. }
  19437. if (this.isRTL_()) {
  19438. return this.incrementScrollRTL_(scrollXIncrement);
  19439. }
  19440. this.incrementScroll_(scrollXIncrement);
  19441. }
  19442. /**
  19443. * Scrolls to the given scrollX value
  19444. * @param {number} scrollX
  19445. */
  19446. }, {
  19447. key: 'scrollTo',
  19448. value: function scrollTo(scrollX) {
  19449. if (this.isRTL_()) {
  19450. return this.scrollToRTL_(scrollX);
  19451. }
  19452. this.scrollTo_(scrollX);
  19453. }
  19454. /**
  19455. * Returns the appropriate version of the MDCTabScrollerRTL
  19456. * @return {!MDCTabScrollerRTL}
  19457. */
  19458. }, {
  19459. key: 'getRTLScroller',
  19460. value: function getRTLScroller() {
  19461. if (!this.rtlScrollerInstance_) {
  19462. this.rtlScrollerInstance_ = this.rtlScrollerFactory_();
  19463. }
  19464. return this.rtlScrollerInstance_;
  19465. }
  19466. /**
  19467. * Returns the translateX value from a CSS matrix transform function string
  19468. * @return {number}
  19469. * @private
  19470. */
  19471. }, {
  19472. key: 'calculateCurrentTranslateX_',
  19473. value: function calculateCurrentTranslateX_() {
  19474. var transformValue = this.adapter_.getScrollContentStyleValue('transform');
  19475. // Early exit if no transform is present
  19476. if (transformValue === 'none') {
  19477. return 0;
  19478. }
  19479. // The transform value comes back as a matrix transformation in the form
  19480. // of `matrix(a, b, c, d, tx, ty)`. We only care about tx (translateX) so
  19481. // we're going to grab all the parenthesized values, strip out tx, and
  19482. // parse it.
  19483. var results = /\((.+)\)/.exec(transformValue)[1];
  19484. var parts = results.split(',');
  19485. return parseFloat(parts[4]);
  19486. }
  19487. /**
  19488. * Calculates a safe scroll value that is > 0 and < the max scroll value
  19489. * @param {number} scrollX The distance to scroll
  19490. * @return {number}
  19491. * @private
  19492. */
  19493. }, {
  19494. key: 'clampScrollValue_',
  19495. value: function clampScrollValue_(scrollX) {
  19496. var edges = this.calculateScrollEdges_();
  19497. return Math.min(Math.max(edges.left, scrollX), edges.right);
  19498. }
  19499. /**
  19500. * @return {number}
  19501. * @private
  19502. */
  19503. }, {
  19504. key: 'computeCurrentScrollPositionRTL_',
  19505. value: function computeCurrentScrollPositionRTL_() {
  19506. var translateX = this.calculateCurrentTranslateX_();
  19507. return this.getRTLScroller().getScrollPositionRTL(translateX);
  19508. }
  19509. /**
  19510. * @return {!MDCTabScrollerHorizontalEdges}
  19511. * @private
  19512. */
  19513. }, {
  19514. key: 'calculateScrollEdges_',
  19515. value: function calculateScrollEdges_() {
  19516. var contentWidth = this.adapter_.getScrollContentOffsetWidth();
  19517. var rootWidth = this.adapter_.getScrollAreaOffsetWidth();
  19518. return (/** @type {!MDCTabScrollerHorizontalEdges} */{
  19519. left: 0,
  19520. right: contentWidth - rootWidth
  19521. }
  19522. );
  19523. }
  19524. /**
  19525. * Internal scroll method
  19526. * @param {number} scrollX The new scroll position
  19527. * @private
  19528. */
  19529. }, {
  19530. key: 'scrollTo_',
  19531. value: function scrollTo_(scrollX) {
  19532. var currentScrollX = this.getScrollPosition();
  19533. var safeScrollX = this.clampScrollValue_(scrollX);
  19534. var scrollDelta = safeScrollX - currentScrollX;
  19535. this.animate_( /** @type {!MDCTabScrollerAnimation} */{
  19536. finalScrollPosition: safeScrollX,
  19537. scrollDelta: scrollDelta
  19538. });
  19539. }
  19540. /**
  19541. * Internal RTL scroll method
  19542. * @param {number} scrollX The new scroll position
  19543. * @private
  19544. */
  19545. }, {
  19546. key: 'scrollToRTL_',
  19547. value: function scrollToRTL_(scrollX) {
  19548. var animation = this.getRTLScroller().scrollToRTL(scrollX);
  19549. this.animate_(animation);
  19550. }
  19551. /**
  19552. * Internal increment scroll method
  19553. * @param {number} scrollX The new scroll position increment
  19554. * @private
  19555. */
  19556. }, {
  19557. key: 'incrementScroll_',
  19558. value: function incrementScroll_(scrollX) {
  19559. var currentScrollX = this.getScrollPosition();
  19560. var targetScrollX = scrollX + currentScrollX;
  19561. var safeScrollX = this.clampScrollValue_(targetScrollX);
  19562. var scrollDelta = safeScrollX - currentScrollX;
  19563. this.animate_( /** @type {!MDCTabScrollerAnimation} */{
  19564. finalScrollPosition: safeScrollX,
  19565. scrollDelta: scrollDelta
  19566. });
  19567. }
  19568. /**
  19569. * Internal incremenet scroll RTL method
  19570. * @param {number} scrollX The new scroll position RTL increment
  19571. * @private
  19572. */
  19573. }, {
  19574. key: 'incrementScrollRTL_',
  19575. value: function incrementScrollRTL_(scrollX) {
  19576. var animation = this.getRTLScroller().incrementScrollRTL(scrollX);
  19577. this.animate_(animation);
  19578. }
  19579. /**
  19580. * Animates the tab scrolling
  19581. * @param {!MDCTabScrollerAnimation} animation The animation to apply
  19582. * @private
  19583. */
  19584. }, {
  19585. key: 'animate_',
  19586. value: function animate_(animation) {
  19587. var _this2 = this;
  19588. // Early exit if translateX is 0, which means there's no animation to perform
  19589. if (animation.scrollDelta === 0) {
  19590. return;
  19591. }
  19592. this.stopScrollAnimation_();
  19593. // This animation uses the FLIP approach.
  19594. // Read more here: https://aerotwist.com/blog/flip-your-animations/
  19595. this.adapter_.setScrollAreaScrollLeft(animation.finalScrollPosition);
  19596. this.adapter_.setScrollContentStyleProperty('transform', 'translateX(' + animation.scrollDelta + 'px)');
  19597. // Force repaint
  19598. this.adapter_.computeScrollAreaClientRect();
  19599. requestAnimationFrame(function () {
  19600. _this2.adapter_.addClass(MDCTabScrollerFoundation.cssClasses.ANIMATING);
  19601. _this2.adapter_.setScrollContentStyleProperty('transform', 'none');
  19602. });
  19603. this.isAnimating_ = true;
  19604. }
  19605. /**
  19606. * Stops scroll animation
  19607. * @private
  19608. */
  19609. }, {
  19610. key: 'stopScrollAnimation_',
  19611. value: function stopScrollAnimation_() {
  19612. this.isAnimating_ = false;
  19613. var currentScrollPosition = this.getAnimatingScrollPosition_();
  19614. this.adapter_.removeClass(MDCTabScrollerFoundation.cssClasses.ANIMATING);
  19615. this.adapter_.setScrollContentStyleProperty('transform', 'translateX(0px)');
  19616. this.adapter_.setScrollAreaScrollLeft(currentScrollPosition);
  19617. }
  19618. /**
  19619. * Gets the current scroll position during animation
  19620. * @return {number}
  19621. * @private
  19622. */
  19623. }, {
  19624. key: 'getAnimatingScrollPosition_',
  19625. value: function getAnimatingScrollPosition_() {
  19626. var currentTranslateX = this.calculateCurrentTranslateX_();
  19627. var scrollLeft = this.adapter_.getScrollAreaScrollLeft();
  19628. if (this.isRTL_()) {
  19629. return this.getRTLScroller().getAnimatingScrollPosition(scrollLeft, currentTranslateX);
  19630. }
  19631. return scrollLeft - currentTranslateX;
  19632. }
  19633. /**
  19634. * Determines the RTL Scroller to use
  19635. * @return {!MDCTabScrollerRTL}
  19636. * @private
  19637. */
  19638. }, {
  19639. key: 'rtlScrollerFactory_',
  19640. value: function rtlScrollerFactory_() {
  19641. // Browsers have three different implementations of scrollLeft in RTL mode,
  19642. // dependent on the browser. The behavior is based off the max LTR
  19643. // scrollleft value and 0.
  19644. //
  19645. // * Default scrolling in RTL *
  19646. // - Left-most value: 0
  19647. // - Right-most value: Max LTR scrollLeft value
  19648. //
  19649. // * Negative scrolling in RTL *
  19650. // - Left-most value: Negated max LTR scrollLeft value
  19651. // - Right-most value: 0
  19652. //
  19653. // * Reverse scrolling in RTL *
  19654. // - Left-most value: Max LTR scrollLeft value
  19655. // - Right-most value: 0
  19656. //
  19657. // We use those principles below to determine which RTL scrollLeft
  19658. // behavior is implemented in the current browser.
  19659. var initialScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  19660. this.adapter_.setScrollAreaScrollLeft(initialScrollLeft - 1);
  19661. var newScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  19662. // If the newScrollLeft value is negative,then we know that the browser has
  19663. // implemented negative RTL scrolling, since all other implementations have
  19664. // only positive values.
  19665. if (newScrollLeft < 0) {
  19666. // Undo the scrollLeft test check
  19667. this.adapter_.setScrollAreaScrollLeft(initialScrollLeft);
  19668. return new __WEBPACK_IMPORTED_MODULE_5__rtl_negative_scroller__["a" /* default */](this.adapter_);
  19669. }
  19670. var rootClientRect = this.adapter_.computeScrollAreaClientRect();
  19671. var contentClientRect = this.adapter_.computeScrollContentClientRect();
  19672. var rightEdgeDelta = Math.round(contentClientRect.right - rootClientRect.right);
  19673. // Undo the scrollLeft test check
  19674. this.adapter_.setScrollAreaScrollLeft(initialScrollLeft);
  19675. // By calculating the clientRect of the root element and the clientRect of
  19676. // the content element, we can determine how much the scroll value changed
  19677. // when we performed the scrollLeft subtraction above.
  19678. if (rightEdgeDelta === newScrollLeft) {
  19679. return new __WEBPACK_IMPORTED_MODULE_6__rtl_reverse_scroller__["a" /* default */](this.adapter_);
  19680. }
  19681. return new __WEBPACK_IMPORTED_MODULE_4__rtl_default_scroller__["a" /* default */](this.adapter_);
  19682. }
  19683. /**
  19684. * @return {boolean}
  19685. * @private
  19686. */
  19687. }, {
  19688. key: 'isRTL_',
  19689. value: function isRTL_() {
  19690. return this.adapter_.getScrollContentStyleValue('direction') === 'rtl';
  19691. }
  19692. }]);
  19693. return MDCTabScrollerFoundation;
  19694. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  19695. /* harmony default export */ __webpack_exports__["a"] = (MDCTabScrollerFoundation);
  19696. /***/ }),
  19697. /* 139 */
  19698. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19699. "use strict";
  19700. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__rtl_scroller__ = __webpack_require__(11);
  19701. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(5);
  19702. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  19703. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19704. 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; }
  19705. 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; }
  19706. /**
  19707. * @license
  19708. * Copyright 2018 Google Inc.
  19709. *
  19710. * Permission is hereby granted, free of charge, to any person obtaining a copy
  19711. * of this software and associated documentation files (the "Software"), to deal
  19712. * in the Software without restriction, including without limitation the rights
  19713. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  19714. * copies of the Software, and to permit persons to whom the Software is
  19715. * furnished to do so, subject to the following conditions:
  19716. *
  19717. * The above copyright notice and this permission notice shall be included in
  19718. * all copies or substantial portions of the Software.
  19719. *
  19720. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19721. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19722. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19723. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19724. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19725. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19726. * THE SOFTWARE.
  19727. */
  19728. /* eslint-disable no-unused-vars */
  19729. /* eslint-enable no-unused-vars */
  19730. /**
  19731. * @extends {MDCTabScrollerRTL}
  19732. * @final
  19733. */
  19734. var MDCTabScrollerRTLDefault = function (_MDCTabScrollerRTL) {
  19735. _inherits(MDCTabScrollerRTLDefault, _MDCTabScrollerRTL);
  19736. function MDCTabScrollerRTLDefault() {
  19737. _classCallCheck(this, MDCTabScrollerRTLDefault);
  19738. return _possibleConstructorReturn(this, (MDCTabScrollerRTLDefault.__proto__ || Object.getPrototypeOf(MDCTabScrollerRTLDefault)).apply(this, arguments));
  19739. }
  19740. _createClass(MDCTabScrollerRTLDefault, [{
  19741. key: 'getScrollPositionRTL',
  19742. /**
  19743. * @return {number}
  19744. */
  19745. value: function getScrollPositionRTL() {
  19746. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  19747. var _calculateScrollEdges = this.calculateScrollEdges_(),
  19748. right = _calculateScrollEdges.right;
  19749. // Scroll values on most browsers are ints instead of floats so we round
  19750. return Math.round(right - currentScrollLeft);
  19751. }
  19752. /**
  19753. * @param {number} scrollX
  19754. * @return {!MDCTabScrollerAnimation}
  19755. */
  19756. }, {
  19757. key: 'scrollToRTL',
  19758. value: function scrollToRTL(scrollX) {
  19759. var edges = this.calculateScrollEdges_();
  19760. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  19761. var clampedScrollLeft = this.clampScrollValue_(edges.right - scrollX);
  19762. return (/** @type {!MDCTabScrollerAnimation} */{
  19763. finalScrollPosition: clampedScrollLeft,
  19764. scrollDelta: clampedScrollLeft - currentScrollLeft
  19765. }
  19766. );
  19767. }
  19768. /**
  19769. * @param {number} scrollX
  19770. * @return {!MDCTabScrollerAnimation}
  19771. */
  19772. }, {
  19773. key: 'incrementScrollRTL',
  19774. value: function incrementScrollRTL(scrollX) {
  19775. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  19776. var clampedScrollLeft = this.clampScrollValue_(currentScrollLeft - scrollX);
  19777. return (/** @type {!MDCTabScrollerAnimation} */{
  19778. finalScrollPosition: clampedScrollLeft,
  19779. scrollDelta: clampedScrollLeft - currentScrollLeft
  19780. }
  19781. );
  19782. }
  19783. /**
  19784. * @param {number} scrollX
  19785. * @return {number}
  19786. */
  19787. }, {
  19788. key: 'getAnimatingScrollPosition',
  19789. value: function getAnimatingScrollPosition(scrollX) {
  19790. return scrollX;
  19791. }
  19792. /**
  19793. * @return {!MDCTabScrollerHorizontalEdges}
  19794. * @private
  19795. */
  19796. }, {
  19797. key: 'calculateScrollEdges_',
  19798. value: function calculateScrollEdges_() {
  19799. var contentWidth = this.adapter_.getScrollContentOffsetWidth();
  19800. var rootWidth = this.adapter_.getScrollAreaOffsetWidth();
  19801. return (/** @type {!MDCTabScrollerHorizontalEdges} */{
  19802. left: 0,
  19803. right: contentWidth - rootWidth
  19804. }
  19805. );
  19806. }
  19807. /**
  19808. * @param {number} scrollX
  19809. * @return {number}
  19810. * @private
  19811. */
  19812. }, {
  19813. key: 'clampScrollValue_',
  19814. value: function clampScrollValue_(scrollX) {
  19815. var edges = this.calculateScrollEdges_();
  19816. return Math.min(Math.max(edges.left, scrollX), edges.right);
  19817. }
  19818. }]);
  19819. return MDCTabScrollerRTLDefault;
  19820. }(__WEBPACK_IMPORTED_MODULE_0__rtl_scroller__["a" /* default */]);
  19821. /* harmony default export */ __webpack_exports__["a"] = (MDCTabScrollerRTLDefault);
  19822. /***/ }),
  19823. /* 140 */
  19824. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19825. "use strict";
  19826. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__rtl_scroller__ = __webpack_require__(11);
  19827. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(5);
  19828. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  19829. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19830. 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; }
  19831. 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; }
  19832. /**
  19833. * @license
  19834. * Copyright 2018 Google Inc.
  19835. *
  19836. * Permission is hereby granted, free of charge, to any person obtaining a copy
  19837. * of this software and associated documentation files (the "Software"), to deal
  19838. * in the Software without restriction, including without limitation the rights
  19839. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  19840. * copies of the Software, and to permit persons to whom the Software is
  19841. * furnished to do so, subject to the following conditions:
  19842. *
  19843. * The above copyright notice and this permission notice shall be included in
  19844. * all copies or substantial portions of the Software.
  19845. *
  19846. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19847. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19848. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19849. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19850. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19851. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19852. * THE SOFTWARE.
  19853. */
  19854. /* eslint-disable no-unused-vars */
  19855. /* eslint-enable no-unused-vars */
  19856. /**
  19857. * @extends {MDCTabScrollerRTL}
  19858. * @final
  19859. */
  19860. var MDCTabScrollerRTLNegative = function (_MDCTabScrollerRTL) {
  19861. _inherits(MDCTabScrollerRTLNegative, _MDCTabScrollerRTL);
  19862. function MDCTabScrollerRTLNegative() {
  19863. _classCallCheck(this, MDCTabScrollerRTLNegative);
  19864. return _possibleConstructorReturn(this, (MDCTabScrollerRTLNegative.__proto__ || Object.getPrototypeOf(MDCTabScrollerRTLNegative)).apply(this, arguments));
  19865. }
  19866. _createClass(MDCTabScrollerRTLNegative, [{
  19867. key: 'getScrollPositionRTL',
  19868. /**
  19869. * @param {number} translateX The current translateX position
  19870. * @return {number}
  19871. */
  19872. value: function getScrollPositionRTL(translateX) {
  19873. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  19874. return Math.round(translateX - currentScrollLeft);
  19875. }
  19876. /**
  19877. * @param {number} scrollX
  19878. * @return {!MDCTabScrollerAnimation}
  19879. */
  19880. }, {
  19881. key: 'scrollToRTL',
  19882. value: function scrollToRTL(scrollX) {
  19883. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  19884. var clampedScrollLeft = this.clampScrollValue_(-scrollX);
  19885. return (/** @type {!MDCTabScrollerAnimation} */{
  19886. finalScrollPosition: clampedScrollLeft,
  19887. scrollDelta: clampedScrollLeft - currentScrollLeft
  19888. }
  19889. );
  19890. }
  19891. /**
  19892. * @param {number} scrollX
  19893. * @return {!MDCTabScrollerAnimation}
  19894. */
  19895. }, {
  19896. key: 'incrementScrollRTL',
  19897. value: function incrementScrollRTL(scrollX) {
  19898. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  19899. var clampedScrollLeft = this.clampScrollValue_(currentScrollLeft - scrollX);
  19900. return (/** @type {!MDCTabScrollerAnimation} */{
  19901. finalScrollPosition: clampedScrollLeft,
  19902. scrollDelta: clampedScrollLeft - currentScrollLeft
  19903. }
  19904. );
  19905. }
  19906. /**
  19907. * @param {number} scrollX
  19908. * @param {number} translateX
  19909. * @return {number}
  19910. */
  19911. }, {
  19912. key: 'getAnimatingScrollPosition',
  19913. value: function getAnimatingScrollPosition(scrollX, translateX) {
  19914. return scrollX - translateX;
  19915. }
  19916. /**
  19917. * @return {!MDCTabScrollerHorizontalEdges}
  19918. * @private
  19919. */
  19920. }, {
  19921. key: 'calculateScrollEdges_',
  19922. value: function calculateScrollEdges_() {
  19923. var contentWidth = this.adapter_.getScrollContentOffsetWidth();
  19924. var rootWidth = this.adapter_.getScrollAreaOffsetWidth();
  19925. return (/** @type {!MDCTabScrollerHorizontalEdges} */{
  19926. left: rootWidth - contentWidth,
  19927. right: 0
  19928. }
  19929. );
  19930. }
  19931. /**
  19932. * @param {number} scrollX
  19933. * @return {number}
  19934. * @private
  19935. */
  19936. }, {
  19937. key: 'clampScrollValue_',
  19938. value: function clampScrollValue_(scrollX) {
  19939. var edges = this.calculateScrollEdges_();
  19940. return Math.max(Math.min(edges.right, scrollX), edges.left);
  19941. }
  19942. }]);
  19943. return MDCTabScrollerRTLNegative;
  19944. }(__WEBPACK_IMPORTED_MODULE_0__rtl_scroller__["a" /* default */]);
  19945. /* harmony default export */ __webpack_exports__["a"] = (MDCTabScrollerRTLNegative);
  19946. /***/ }),
  19947. /* 141 */
  19948. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19949. "use strict";
  19950. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__rtl_scroller__ = __webpack_require__(11);
  19951. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(5);
  19952. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  19953. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19954. 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; }
  19955. 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; }
  19956. /**
  19957. * @license
  19958. * Copyright 2018 Google Inc.
  19959. *
  19960. * Permission is hereby granted, free of charge, to any person obtaining a copy
  19961. * of this software and associated documentation files (the "Software"), to deal
  19962. * in the Software without restriction, including without limitation the rights
  19963. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  19964. * copies of the Software, and to permit persons to whom the Software is
  19965. * furnished to do so, subject to the following conditions:
  19966. *
  19967. * The above copyright notice and this permission notice shall be included in
  19968. * all copies or substantial portions of the Software.
  19969. *
  19970. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19971. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19972. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19973. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19974. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19975. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19976. * THE SOFTWARE.
  19977. */
  19978. /* eslint-disable no-unused-vars */
  19979. /* eslint-enable no-unused-vars */
  19980. /**
  19981. * @extends {MDCTabScrollerRTL}
  19982. * @final
  19983. */
  19984. var MDCTabScrollerRTLReverse = function (_MDCTabScrollerRTL) {
  19985. _inherits(MDCTabScrollerRTLReverse, _MDCTabScrollerRTL);
  19986. function MDCTabScrollerRTLReverse() {
  19987. _classCallCheck(this, MDCTabScrollerRTLReverse);
  19988. return _possibleConstructorReturn(this, (MDCTabScrollerRTLReverse.__proto__ || Object.getPrototypeOf(MDCTabScrollerRTLReverse)).apply(this, arguments));
  19989. }
  19990. _createClass(MDCTabScrollerRTLReverse, [{
  19991. key: 'getScrollPositionRTL',
  19992. /**
  19993. * @param {number} translateX
  19994. * @return {number}
  19995. */
  19996. value: function getScrollPositionRTL(translateX) {
  19997. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  19998. // Scroll values on most browsers are ints instead of floats so we round
  19999. return Math.round(currentScrollLeft - translateX);
  20000. }
  20001. /**
  20002. * @param {number} scrollX
  20003. * @return {!MDCTabScrollerAnimation}
  20004. */
  20005. }, {
  20006. key: 'scrollToRTL',
  20007. value: function scrollToRTL(scrollX) {
  20008. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  20009. var clampedScrollLeft = this.clampScrollValue_(scrollX);
  20010. return (/** @type {!MDCTabScrollerAnimation} */{
  20011. finalScrollPosition: clampedScrollLeft,
  20012. scrollDelta: currentScrollLeft - clampedScrollLeft
  20013. }
  20014. );
  20015. }
  20016. /**
  20017. * @param {number} scrollX
  20018. * @return {!MDCTabScrollerAnimation}
  20019. */
  20020. }, {
  20021. key: 'incrementScrollRTL',
  20022. value: function incrementScrollRTL(scrollX) {
  20023. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  20024. var clampedScrollLeft = this.clampScrollValue_(currentScrollLeft + scrollX);
  20025. return (/** @type {!MDCTabScrollerAnimation} */{
  20026. finalScrollPosition: clampedScrollLeft,
  20027. scrollDelta: currentScrollLeft - clampedScrollLeft
  20028. }
  20029. );
  20030. }
  20031. /**
  20032. * @param {number} scrollX
  20033. * @return {number}
  20034. */
  20035. }, {
  20036. key: 'getAnimatingScrollPosition',
  20037. value: function getAnimatingScrollPosition(scrollX, translateX) {
  20038. return scrollX + translateX;
  20039. }
  20040. /**
  20041. * @return {!MDCTabScrollerHorizontalEdges}
  20042. * @private
  20043. */
  20044. }, {
  20045. key: 'calculateScrollEdges_',
  20046. value: function calculateScrollEdges_() {
  20047. var contentWidth = this.adapter_.getScrollContentOffsetWidth();
  20048. var rootWidth = this.adapter_.getScrollAreaOffsetWidth();
  20049. return (/** @type {!MDCTabScrollerHorizontalEdges} */{
  20050. left: contentWidth - rootWidth,
  20051. right: 0
  20052. }
  20053. );
  20054. }
  20055. /**
  20056. * @param {number} scrollX
  20057. * @return {number}
  20058. * @private
  20059. */
  20060. }, {
  20061. key: 'clampScrollValue_',
  20062. value: function clampScrollValue_(scrollX) {
  20063. var edges = this.calculateScrollEdges_();
  20064. return Math.min(Math.max(edges.right, scrollX), edges.left);
  20065. }
  20066. }]);
  20067. return MDCTabScrollerRTLReverse;
  20068. }(__WEBPACK_IMPORTED_MODULE_0__rtl_scroller__["a" /* default */]);
  20069. /* harmony default export */ __webpack_exports__["a"] = (MDCTabScrollerRTLReverse);
  20070. /***/ }),
  20071. /* 142 */
  20072. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20073. "use strict";
  20074. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  20075. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "computeHorizontalScrollbarHeight", function() { return computeHorizontalScrollbarHeight; });
  20076. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getMatchesProperty", function() { return getMatchesProperty; });
  20077. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__constants__ = __webpack_require__(57);
  20078. /**
  20079. * @license
  20080. * Copyright 2018 Google Inc.
  20081. *
  20082. * Permission is hereby granted, free of charge, to any person obtaining a copy
  20083. * of this software and associated documentation files (the "Software"), to deal
  20084. * in the Software without restriction, including without limitation the rights
  20085. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  20086. * copies of the Software, and to permit persons to whom the Software is
  20087. * furnished to do so, subject to the following conditions:
  20088. *
  20089. * The above copyright notice and this permission notice shall be included in
  20090. * all copies or substantial portions of the Software.
  20091. *
  20092. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  20093. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  20094. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  20095. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20096. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20097. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  20098. * THE SOFTWARE.
  20099. */
  20100. /**
  20101. * Stores result from computeHorizontalScrollbarHeight to avoid redundant processing.
  20102. * @private {number|undefined}
  20103. */
  20104. var horizontalScrollbarHeight_ = void 0;
  20105. /**
  20106. * Computes the height of browser-rendered horizontal scrollbars using a self-created test element.
  20107. * May return 0 (e.g. on OS X browsers under default configuration).
  20108. * @param {!Document} documentObj
  20109. * @param {boolean=} shouldCacheResult
  20110. * @return {number}
  20111. */
  20112. function computeHorizontalScrollbarHeight(documentObj) {
  20113. var shouldCacheResult = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  20114. if (shouldCacheResult && typeof horizontalScrollbarHeight_ !== 'undefined') {
  20115. return horizontalScrollbarHeight_;
  20116. }
  20117. var el = documentObj.createElement('div');
  20118. el.classList.add(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].SCROLL_TEST);
  20119. documentObj.body.appendChild(el);
  20120. var horizontalScrollbarHeight = el.offsetHeight - el.clientHeight;
  20121. documentObj.body.removeChild(el);
  20122. if (shouldCacheResult) {
  20123. horizontalScrollbarHeight_ = horizontalScrollbarHeight;
  20124. }
  20125. return horizontalScrollbarHeight;
  20126. }
  20127. /**
  20128. * @param {!Object} HTMLElementPrototype
  20129. * @return {!Array<string>}
  20130. */
  20131. function getMatchesProperty(HTMLElementPrototype) {
  20132. return ['msMatchesSelector', 'matches'].filter(function (p) {
  20133. return p in HTMLElementPrototype;
  20134. }).pop();
  20135. }
  20136. /***/ }),
  20137. /* 143 */
  20138. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20139. "use strict";
  20140. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  20141. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(144);
  20142. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__adapter__ = __webpack_require__(58);
  20143. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_tab_adapter__ = __webpack_require__(10);
  20144. 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; };
  20145. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  20146. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20147. 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; }
  20148. 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; }
  20149. /**
  20150. * @license
  20151. * Copyright 2018 Google Inc.
  20152. *
  20153. * Permission is hereby granted, free of charge, to any person obtaining a copy
  20154. * of this software and associated documentation files (the "Software"), to deal
  20155. * in the Software without restriction, including without limitation the rights
  20156. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  20157. * copies of the Software, and to permit persons to whom the Software is
  20158. * furnished to do so, subject to the following conditions:
  20159. *
  20160. * The above copyright notice and this permission notice shall be included in
  20161. * all copies or substantial portions of the Software.
  20162. *
  20163. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  20164. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  20165. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  20166. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20167. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20168. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  20169. * THE SOFTWARE.
  20170. */
  20171. /* eslint-disable no-unused-vars */
  20172. /* eslint-enable no-unused-vars */
  20173. /**
  20174. * @type {Set<string>}
  20175. */
  20176. var ACCEPTABLE_KEYS = new Set();
  20177. // IE11 has no support for new Set with iterable so we need to initialize this by hand
  20178. ACCEPTABLE_KEYS.add(__WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].ARROW_LEFT_KEY);
  20179. ACCEPTABLE_KEYS.add(__WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].ARROW_RIGHT_KEY);
  20180. ACCEPTABLE_KEYS.add(__WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].END_KEY);
  20181. ACCEPTABLE_KEYS.add(__WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].HOME_KEY);
  20182. ACCEPTABLE_KEYS.add(__WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].ENTER_KEY);
  20183. ACCEPTABLE_KEYS.add(__WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].SPACE_KEY);
  20184. /**
  20185. * @type {Map<number, string>}
  20186. */
  20187. var KEYCODE_MAP = new Map();
  20188. // IE11 has no support for new Map with iterable so we need to initialize this by hand
  20189. KEYCODE_MAP.set(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].ARROW_LEFT_KEYCODE, __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].ARROW_LEFT_KEY);
  20190. KEYCODE_MAP.set(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].ARROW_RIGHT_KEYCODE, __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].ARROW_RIGHT_KEY);
  20191. KEYCODE_MAP.set(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].END_KEYCODE, __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].END_KEY);
  20192. KEYCODE_MAP.set(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].HOME_KEYCODE, __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].HOME_KEY);
  20193. KEYCODE_MAP.set(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].ENTER_KEYCODE, __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].ENTER_KEY);
  20194. KEYCODE_MAP.set(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].SPACE_KEYCODE, __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].SPACE_KEY);
  20195. /**
  20196. * @extends {MDCFoundation<!MDCTabBarAdapter>}
  20197. * @final
  20198. */
  20199. var MDCTabBarFoundation = function (_MDCFoundation) {
  20200. _inherits(MDCTabBarFoundation, _MDCFoundation);
  20201. _createClass(MDCTabBarFoundation, null, [{
  20202. key: 'strings',
  20203. /** @return enum {string} */
  20204. get: function get() {
  20205. return __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */];
  20206. }
  20207. /** @return enum {number} */
  20208. }, {
  20209. key: 'numbers',
  20210. get: function get() {
  20211. return __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */];
  20212. }
  20213. /**
  20214. * @see MDCTabBarAdapter for typing information
  20215. * @return {!MDCTabBarAdapter}
  20216. */
  20217. }, {
  20218. key: 'defaultAdapter',
  20219. get: function get() {
  20220. return (/** @type {!MDCTabBarAdapter} */{
  20221. scrollTo: function scrollTo() {},
  20222. incrementScroll: function incrementScroll() {},
  20223. getScrollPosition: function getScrollPosition() {},
  20224. getScrollContentWidth: function getScrollContentWidth() {},
  20225. getOffsetWidth: function getOffsetWidth() {},
  20226. isRTL: function isRTL() {},
  20227. setActiveTab: function setActiveTab() {},
  20228. activateTabAtIndex: function activateTabAtIndex() {},
  20229. deactivateTabAtIndex: function deactivateTabAtIndex() {},
  20230. focusTabAtIndex: function focusTabAtIndex() {},
  20231. getTabIndicatorClientRectAtIndex: function getTabIndicatorClientRectAtIndex() {},
  20232. getTabDimensionsAtIndex: function getTabDimensionsAtIndex() {},
  20233. getPreviousActiveTabIndex: function getPreviousActiveTabIndex() {},
  20234. getFocusedTabIndex: function getFocusedTabIndex() {},
  20235. getIndexOfTab: function getIndexOfTab() {},
  20236. getTabListLength: function getTabListLength() {},
  20237. notifyTabActivated: function notifyTabActivated() {}
  20238. }
  20239. );
  20240. }
  20241. /**
  20242. * @param {!MDCTabBarAdapter} adapter
  20243. * */
  20244. }]);
  20245. function MDCTabBarFoundation(adapter) {
  20246. _classCallCheck(this, MDCTabBarFoundation);
  20247. /** @private {boolean} */
  20248. var _this = _possibleConstructorReturn(this, (MDCTabBarFoundation.__proto__ || Object.getPrototypeOf(MDCTabBarFoundation)).call(this, _extends(MDCTabBarFoundation.defaultAdapter, adapter)));
  20249. _this.useAutomaticActivation_ = false;
  20250. return _this;
  20251. }
  20252. /**
  20253. * Switches between automatic and manual activation modes.
  20254. * See https://www.w3.org/TR/wai-aria-practices/#tabpanel for examples.
  20255. * @param {boolean} useAutomaticActivation
  20256. */
  20257. _createClass(MDCTabBarFoundation, [{
  20258. key: 'setUseAutomaticActivation',
  20259. value: function setUseAutomaticActivation(useAutomaticActivation) {
  20260. this.useAutomaticActivation_ = useAutomaticActivation;
  20261. }
  20262. /**
  20263. * Activates the tab at the given index
  20264. * @param {number} index
  20265. */
  20266. }, {
  20267. key: 'activateTab',
  20268. value: function activateTab(index) {
  20269. var previousActiveIndex = this.adapter_.getPreviousActiveTabIndex();
  20270. if (!this.indexIsInRange_(index) || index === previousActiveIndex) {
  20271. return;
  20272. }
  20273. this.adapter_.deactivateTabAtIndex(previousActiveIndex);
  20274. this.adapter_.activateTabAtIndex(index, this.adapter_.getTabIndicatorClientRectAtIndex(previousActiveIndex));
  20275. this.scrollIntoView(index);
  20276. this.adapter_.notifyTabActivated(index);
  20277. }
  20278. /**
  20279. * Handles the keydown event
  20280. * @param {!Event} evt
  20281. */
  20282. }, {
  20283. key: 'handleKeyDown',
  20284. value: function handleKeyDown(evt) {
  20285. // Get the key from the event
  20286. var key = this.getKeyFromEvent_(evt);
  20287. // Early exit if the event key isn't one of the keyboard navigation keys
  20288. if (key === undefined) {
  20289. return;
  20290. }
  20291. // Prevent default behavior for movement keys, but not for activation keys, since :active is used to apply ripple
  20292. if (!this.isActivationKey_(key)) {
  20293. evt.preventDefault();
  20294. }
  20295. if (this.useAutomaticActivation_) {
  20296. if (this.isActivationKey_(key)) {
  20297. return;
  20298. }
  20299. var index = this.determineTargetFromKey_(this.adapter_.getPreviousActiveTabIndex(), key);
  20300. this.adapter_.setActiveTab(index);
  20301. this.scrollIntoView(index);
  20302. } else {
  20303. var focusedTabIndex = this.adapter_.getFocusedTabIndex();
  20304. if (this.isActivationKey_(key)) {
  20305. this.adapter_.setActiveTab(focusedTabIndex);
  20306. } else {
  20307. var _index = this.determineTargetFromKey_(focusedTabIndex, key);
  20308. this.adapter_.focusTabAtIndex(_index);
  20309. this.scrollIntoView(_index);
  20310. }
  20311. }
  20312. }
  20313. /**
  20314. * Handles the MDCTab:interacted event
  20315. * @param {!Event} evt
  20316. */
  20317. }, {
  20318. key: 'handleTabInteraction',
  20319. value: function handleTabInteraction(evt) {
  20320. this.adapter_.setActiveTab(this.adapter_.getIndexOfTab(evt.detail.tab));
  20321. }
  20322. /**
  20323. * Scrolls the tab at the given index into view
  20324. * @param {number} index The tab index to make visible
  20325. */
  20326. }, {
  20327. key: 'scrollIntoView',
  20328. value: function scrollIntoView(index) {
  20329. // Early exit if the index is out of range
  20330. if (!this.indexIsInRange_(index)) {
  20331. return;
  20332. }
  20333. // Always scroll to 0 if scrolling to the 0th index
  20334. if (index === 0) {
  20335. return this.adapter_.scrollTo(0);
  20336. }
  20337. // Always scroll to the max value if scrolling to the Nth index
  20338. // MDCTabScroller.scrollTo() will never scroll past the max possible value
  20339. if (index === this.adapter_.getTabListLength() - 1) {
  20340. return this.adapter_.scrollTo(this.adapter_.getScrollContentWidth());
  20341. }
  20342. if (this.isRTL_()) {
  20343. return this.scrollIntoViewRTL_(index);
  20344. }
  20345. this.scrollIntoView_(index);
  20346. }
  20347. /**
  20348. * Private method for determining the index of the destination tab based on what key was pressed
  20349. * @param {number} origin The original index from which to determine the destination
  20350. * @param {string} key The name of the key
  20351. * @return {number}
  20352. * @private
  20353. */
  20354. }, {
  20355. key: 'determineTargetFromKey_',
  20356. value: function determineTargetFromKey_(origin, key) {
  20357. var isRTL = this.isRTL_();
  20358. var maxIndex = this.adapter_.getTabListLength() - 1;
  20359. var shouldGoToEnd = key === __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].END_KEY;
  20360. 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;
  20361. 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;
  20362. var index = origin;
  20363. if (shouldGoToEnd) {
  20364. index = maxIndex;
  20365. } else if (shouldDecrement) {
  20366. index -= 1;
  20367. } else if (shouldIncrement) {
  20368. index += 1;
  20369. } else {
  20370. index = 0;
  20371. }
  20372. if (index < 0) {
  20373. index = maxIndex;
  20374. } else if (index > maxIndex) {
  20375. index = 0;
  20376. }
  20377. return index;
  20378. }
  20379. /**
  20380. * Calculates the scroll increment that will make the tab at the given index visible
  20381. * @param {number} index The index of the tab
  20382. * @param {number} nextIndex The index of the next tab
  20383. * @param {number} scrollPosition The current scroll position
  20384. * @param {number} barWidth The width of the Tab Bar
  20385. * @return {number}
  20386. * @private
  20387. */
  20388. }, {
  20389. key: 'calculateScrollIncrement_',
  20390. value: function calculateScrollIncrement_(index, nextIndex, scrollPosition, barWidth) {
  20391. var nextTabDimensions = this.adapter_.getTabDimensionsAtIndex(nextIndex);
  20392. var relativeContentLeft = nextTabDimensions.contentLeft - scrollPosition - barWidth;
  20393. var relativeContentRight = nextTabDimensions.contentRight - scrollPosition;
  20394. var leftIncrement = relativeContentRight - __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].EXTRA_SCROLL_AMOUNT;
  20395. var rightIncrement = relativeContentLeft + __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].EXTRA_SCROLL_AMOUNT;
  20396. if (nextIndex < index) {
  20397. return Math.min(leftIncrement, 0);
  20398. }
  20399. return Math.max(rightIncrement, 0);
  20400. }
  20401. /**
  20402. * Calculates the scroll increment that will make the tab at the given index visible in RTL
  20403. * @param {number} index The index of the tab
  20404. * @param {number} nextIndex The index of the next tab
  20405. * @param {number} scrollPosition The current scroll position
  20406. * @param {number} barWidth The width of the Tab Bar
  20407. * @param {number} scrollContentWidth The width of the scroll content
  20408. * @return {number}
  20409. * @private
  20410. */
  20411. }, {
  20412. key: 'calculateScrollIncrementRTL_',
  20413. value: function calculateScrollIncrementRTL_(index, nextIndex, scrollPosition, barWidth, scrollContentWidth) {
  20414. var nextTabDimensions = this.adapter_.getTabDimensionsAtIndex(nextIndex);
  20415. var relativeContentLeft = scrollContentWidth - nextTabDimensions.contentLeft - scrollPosition;
  20416. var relativeContentRight = scrollContentWidth - nextTabDimensions.contentRight - scrollPosition - barWidth;
  20417. var leftIncrement = relativeContentRight + __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].EXTRA_SCROLL_AMOUNT;
  20418. var rightIncrement = relativeContentLeft - __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].EXTRA_SCROLL_AMOUNT;
  20419. if (nextIndex > index) {
  20420. return Math.max(leftIncrement, 0);
  20421. }
  20422. return Math.min(rightIncrement, 0);
  20423. }
  20424. /**
  20425. * Determines the index of the adjacent tab closest to either edge of the Tab Bar
  20426. * @param {number} index The index of the tab
  20427. * @param {!MDCTabDimensions} tabDimensions The dimensions of the tab
  20428. * @param {number} scrollPosition The current scroll position
  20429. * @param {number} barWidth The width of the tab bar
  20430. * @return {number}
  20431. * @private
  20432. */
  20433. }, {
  20434. key: 'findAdjacentTabIndexClosestToEdge_',
  20435. value: function findAdjacentTabIndexClosestToEdge_(index, tabDimensions, scrollPosition, barWidth) {
  20436. /**
  20437. * Tabs are laid out in the Tab Scroller like this:
  20438. *
  20439. * Scroll Position
  20440. * +---+
  20441. * | | Bar Width
  20442. * | +-----------------------------------+
  20443. * | | |
  20444. * | V V
  20445. * | +-----------------------------------+
  20446. * V | Tab Scroller |
  20447. * +------------+--------------+-------------------+
  20448. * | Tab | Tab | Tab |
  20449. * +------------+--------------+-------------------+
  20450. * | |
  20451. * +-----------------------------------+
  20452. *
  20453. * To determine the next adjacent index, we look at the Tab root left and
  20454. * Tab root right, both relative to the scroll position. If the Tab root
  20455. * left is less than 0, then we know it's out of view to the left. If the
  20456. * Tab root right minus the bar width is greater than 0, we know the Tab is
  20457. * out of view to the right. From there, we either increment or decrement
  20458. * the index.
  20459. */
  20460. var relativeRootLeft = tabDimensions.rootLeft - scrollPosition;
  20461. var relativeRootRight = tabDimensions.rootRight - scrollPosition - barWidth;
  20462. var relativeRootDelta = relativeRootLeft + relativeRootRight;
  20463. var leftEdgeIsCloser = relativeRootLeft < 0 || relativeRootDelta < 0;
  20464. var rightEdgeIsCloser = relativeRootRight > 0 || relativeRootDelta > 0;
  20465. if (leftEdgeIsCloser) {
  20466. return index - 1;
  20467. }
  20468. if (rightEdgeIsCloser) {
  20469. return index + 1;
  20470. }
  20471. return -1;
  20472. }
  20473. /**
  20474. * Determines the index of the adjacent tab closest to either edge of the Tab Bar in RTL
  20475. * @param {number} index The index of the tab
  20476. * @param {!MDCTabDimensions} tabDimensions The dimensions of the tab
  20477. * @param {number} scrollPosition The current scroll position
  20478. * @param {number} barWidth The width of the tab bar
  20479. * @param {number} scrollContentWidth The width of the scroller content
  20480. * @return {number}
  20481. * @private
  20482. */
  20483. }, {
  20484. key: 'findAdjacentTabIndexClosestToEdgeRTL_',
  20485. value: function findAdjacentTabIndexClosestToEdgeRTL_(index, tabDimensions, scrollPosition, barWidth, scrollContentWidth) {
  20486. var rootLeft = scrollContentWidth - tabDimensions.rootLeft - barWidth - scrollPosition;
  20487. var rootRight = scrollContentWidth - tabDimensions.rootRight - scrollPosition;
  20488. var rootDelta = rootLeft + rootRight;
  20489. var leftEdgeIsCloser = rootLeft > 0 || rootDelta > 0;
  20490. var rightEdgeIsCloser = rootRight < 0 || rootDelta < 0;
  20491. if (leftEdgeIsCloser) {
  20492. return index + 1;
  20493. }
  20494. if (rightEdgeIsCloser) {
  20495. return index - 1;
  20496. }
  20497. return -1;
  20498. }
  20499. /**
  20500. * Returns the key associated with a keydown event
  20501. * @param {!Event} evt The keydown event
  20502. * @return {string}
  20503. * @private
  20504. */
  20505. }, {
  20506. key: 'getKeyFromEvent_',
  20507. value: function getKeyFromEvent_(evt) {
  20508. if (ACCEPTABLE_KEYS.has(evt.key)) {
  20509. return evt.key;
  20510. }
  20511. return KEYCODE_MAP.get(evt.keyCode);
  20512. }
  20513. }, {
  20514. key: 'isActivationKey_',
  20515. value: function isActivationKey_(key) {
  20516. return key === __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].SPACE_KEY || key === __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].ENTER_KEY;
  20517. }
  20518. /**
  20519. * Returns whether a given index is inclusively between the ends
  20520. * @param {number} index The index to test
  20521. * @private
  20522. */
  20523. }, {
  20524. key: 'indexIsInRange_',
  20525. value: function indexIsInRange_(index) {
  20526. return index >= 0 && index < this.adapter_.getTabListLength();
  20527. }
  20528. /**
  20529. * Returns the view's RTL property
  20530. * @return {boolean}
  20531. * @private
  20532. */
  20533. }, {
  20534. key: 'isRTL_',
  20535. value: function isRTL_() {
  20536. return this.adapter_.isRTL();
  20537. }
  20538. /**
  20539. * Scrolls the tab at the given index into view for left-to-right useragents
  20540. * @param {number} index The index of the tab to scroll into view
  20541. * @private
  20542. */
  20543. }, {
  20544. key: 'scrollIntoView_',
  20545. value: function scrollIntoView_(index) {
  20546. var scrollPosition = this.adapter_.getScrollPosition();
  20547. var barWidth = this.adapter_.getOffsetWidth();
  20548. var tabDimensions = this.adapter_.getTabDimensionsAtIndex(index);
  20549. var nextIndex = this.findAdjacentTabIndexClosestToEdge_(index, tabDimensions, scrollPosition, barWidth);
  20550. if (!this.indexIsInRange_(nextIndex)) {
  20551. return;
  20552. }
  20553. var scrollIncrement = this.calculateScrollIncrement_(index, nextIndex, scrollPosition, barWidth);
  20554. this.adapter_.incrementScroll(scrollIncrement);
  20555. }
  20556. /**
  20557. * Scrolls the tab at the given index into view in RTL
  20558. * @param {number} index The tab index to make visible
  20559. * @private
  20560. */
  20561. }, {
  20562. key: 'scrollIntoViewRTL_',
  20563. value: function scrollIntoViewRTL_(index) {
  20564. var scrollPosition = this.adapter_.getScrollPosition();
  20565. var barWidth = this.adapter_.getOffsetWidth();
  20566. var tabDimensions = this.adapter_.getTabDimensionsAtIndex(index);
  20567. var scrollWidth = this.adapter_.getScrollContentWidth();
  20568. var nextIndex = this.findAdjacentTabIndexClosestToEdgeRTL_(index, tabDimensions, scrollPosition, barWidth, scrollWidth);
  20569. if (!this.indexIsInRange_(nextIndex)) {
  20570. return;
  20571. }
  20572. var scrollIncrement = this.calculateScrollIncrementRTL_(index, nextIndex, scrollPosition, barWidth, scrollWidth);
  20573. this.adapter_.incrementScroll(scrollIncrement);
  20574. }
  20575. }]);
  20576. return MDCTabBarFoundation;
  20577. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  20578. /* harmony default export */ __webpack_exports__["a"] = (MDCTabBarFoundation);
  20579. /***/ }),
  20580. /* 144 */
  20581. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20582. "use strict";
  20583. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return numbers; });
  20584. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  20585. /**
  20586. * @license
  20587. * Copyright 2018 Google Inc.
  20588. *
  20589. * Permission is hereby granted, free of charge, to any person obtaining a copy
  20590. * of this software and associated documentation files (the "Software"), to deal
  20591. * in the Software without restriction, including without limitation the rights
  20592. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  20593. * copies of the Software, and to permit persons to whom the Software is
  20594. * furnished to do so, subject to the following conditions:
  20595. *
  20596. * The above copyright notice and this permission notice shall be included in
  20597. * all copies or substantial portions of the Software.
  20598. *
  20599. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  20600. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  20601. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  20602. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20603. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20604. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  20605. * THE SOFTWARE.
  20606. */
  20607. /** @enum {string} */
  20608. var strings = {
  20609. TAB_ACTIVATED_EVENT: 'MDCTabBar:activated',
  20610. TAB_SCROLLER_SELECTOR: '.mdc-tab-scroller',
  20611. TAB_SELECTOR: '.mdc-tab',
  20612. ARROW_LEFT_KEY: 'ArrowLeft',
  20613. ARROW_RIGHT_KEY: 'ArrowRight',
  20614. END_KEY: 'End',
  20615. HOME_KEY: 'Home',
  20616. ENTER_KEY: 'Enter',
  20617. SPACE_KEY: 'Space'
  20618. };
  20619. /** @enum {number} */
  20620. var numbers = {
  20621. EXTRA_SCROLL_AMOUNT: 20,
  20622. ARROW_LEFT_KEYCODE: 37,
  20623. ARROW_RIGHT_KEYCODE: 39,
  20624. END_KEYCODE: 35,
  20625. HOME_KEYCODE: 36,
  20626. ENTER_KEYCODE: 13,
  20627. SPACE_KEYCODE: 32
  20628. };
  20629. /***/ }),
  20630. /* 145 */
  20631. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20632. "use strict";
  20633. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  20634. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTextField", function() { return MDCTextField; });
  20635. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  20636. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__ = __webpack_require__(2);
  20637. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_ripple_util__ = __webpack_require__(6);
  20638. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__constants__ = __webpack_require__(59);
  20639. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__adapter__ = __webpack_require__(60);
  20640. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__foundation__ = __webpack_require__(148);
  20641. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__material_line_ripple_index__ = __webpack_require__(18);
  20642. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__helper_text_index__ = __webpack_require__(149);
  20643. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__icon_index__ = __webpack_require__(150);
  20644. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__material_floating_label_index__ = __webpack_require__(17);
  20645. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__material_notched_outline_index__ = __webpack_require__(22);
  20646. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTextFieldFoundation", function() { return __WEBPACK_IMPORTED_MODULE_5__foundation__["a"]; });
  20647. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTextFieldHelperText", function() { return __WEBPACK_IMPORTED_MODULE_7__helper_text_index__["a"]; });
  20648. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTextFieldHelperTextFoundation", function() { return __WEBPACK_IMPORTED_MODULE_7__helper_text_index__["b"]; });
  20649. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTextFieldIcon", function() { return __WEBPACK_IMPORTED_MODULE_8__icon_index__["a"]; });
  20650. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTextFieldIconFoundation", function() { return __WEBPACK_IMPORTED_MODULE_8__icon_index__["b"]; });
  20651. 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; };
  20652. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  20653. 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); } };
  20654. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20655. 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; }
  20656. 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; }
  20657. /**
  20658. * @license
  20659. * Copyright 2016 Google Inc.
  20660. *
  20661. * Permission is hereby granted, free of charge, to any person obtaining a copy
  20662. * of this software and associated documentation files (the "Software"), to deal
  20663. * in the Software without restriction, including without limitation the rights
  20664. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  20665. * copies of the Software, and to permit persons to whom the Software is
  20666. * furnished to do so, subject to the following conditions:
  20667. *
  20668. * The above copyright notice and this permission notice shall be included in
  20669. * all copies or substantial portions of the Software.
  20670. *
  20671. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  20672. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  20673. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  20674. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20675. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20676. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  20677. * THE SOFTWARE.
  20678. */
  20679. /* eslint-disable no-unused-vars */
  20680. /* eslint-enable no-unused-vars */
  20681. /* eslint-disable no-unused-vars */
  20682. /* eslint-enable no-unused-vars */
  20683. /**
  20684. * @extends {MDCComponent<!MDCTextFieldFoundation>}
  20685. * @final
  20686. */
  20687. var MDCTextField = function (_MDCComponent) {
  20688. _inherits(MDCTextField, _MDCComponent);
  20689. /**
  20690. * @param {...?} args
  20691. */
  20692. function MDCTextField() {
  20693. var _ref;
  20694. _classCallCheck(this, MDCTextField);
  20695. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  20696. args[_key] = arguments[_key];
  20697. }
  20698. /** @private {?Element} */
  20699. var _this = _possibleConstructorReturn(this, (_ref = MDCTextField.__proto__ || Object.getPrototypeOf(MDCTextField)).call.apply(_ref, [this].concat(args)));
  20700. _this.input_;
  20701. /** @type {?MDCRipple} */
  20702. _this.ripple;
  20703. /** @private {?MDCLineRipple} */
  20704. _this.lineRipple_;
  20705. /** @private {?MDCTextFieldHelperText} */
  20706. _this.helperText_;
  20707. /** @private {?MDCTextFieldIcon} */
  20708. _this.leadingIcon_;
  20709. /** @private {?MDCTextFieldIcon} */
  20710. _this.trailingIcon_;
  20711. /** @private {?MDCFloatingLabel} */
  20712. _this.label_;
  20713. /** @private {?MDCNotchedOutline} */
  20714. _this.outline_;
  20715. return _this;
  20716. }
  20717. /**
  20718. * @param {!Element} root
  20719. * @return {!MDCTextField}
  20720. */
  20721. _createClass(MDCTextField, [{
  20722. key: 'initialize',
  20723. /**
  20724. * @param {(function(!Element): !MDCRipple)=} rippleFactory A function which
  20725. * creates a new MDCRipple.
  20726. * @param {(function(!Element): !MDCLineRipple)=} lineRippleFactory A function which
  20727. * creates a new MDCLineRipple.
  20728. * @param {(function(!Element): !MDCTextFieldHelperText)=} helperTextFactory A function which
  20729. * creates a new MDCTextFieldHelperText.
  20730. * @param {(function(!Element): !MDCTextFieldIcon)=} iconFactory A function which
  20731. * creates a new MDCTextFieldIcon.
  20732. * @param {(function(!Element): !MDCFloatingLabel)=} labelFactory A function which
  20733. * creates a new MDCFloatingLabel.
  20734. * @param {(function(!Element): !MDCNotchedOutline)=} outlineFactory A function which
  20735. * creates a new MDCNotchedOutline.
  20736. */
  20737. value: function initialize() {
  20738. var rippleFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (el, foundation) {
  20739. return new __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRipple"](el, foundation);
  20740. };
  20741. var lineRippleFactory = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (el) {
  20742. return new __WEBPACK_IMPORTED_MODULE_6__material_line_ripple_index__["MDCLineRipple"](el);
  20743. };
  20744. var helperTextFactory = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function (el) {
  20745. return new __WEBPACK_IMPORTED_MODULE_7__helper_text_index__["a" /* MDCTextFieldHelperText */](el);
  20746. };
  20747. var iconFactory = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : function (el) {
  20748. return new __WEBPACK_IMPORTED_MODULE_8__icon_index__["a" /* MDCTextFieldIcon */](el);
  20749. };
  20750. var _this2 = this;
  20751. var labelFactory = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : function (el) {
  20752. return new __WEBPACK_IMPORTED_MODULE_9__material_floating_label_index__["MDCFloatingLabel"](el);
  20753. };
  20754. var outlineFactory = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : function (el) {
  20755. return new __WEBPACK_IMPORTED_MODULE_10__material_notched_outline_index__["MDCNotchedOutline"](el);
  20756. };
  20757. this.input_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["e" /* strings */].INPUT_SELECTOR);
  20758. var labelElement = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["e" /* strings */].LABEL_SELECTOR);
  20759. if (labelElement) {
  20760. this.label_ = labelFactory(labelElement);
  20761. }
  20762. var lineRippleElement = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["e" /* strings */].LINE_RIPPLE_SELECTOR);
  20763. if (lineRippleElement) {
  20764. this.lineRipple_ = lineRippleFactory(lineRippleElement);
  20765. }
  20766. var outlineElement = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["e" /* strings */].OUTLINE_SELECTOR);
  20767. if (outlineElement) {
  20768. this.outline_ = outlineFactory(outlineElement);
  20769. }
  20770. if (this.input_.hasAttribute(__WEBPACK_IMPORTED_MODULE_3__constants__["e" /* strings */].ARIA_CONTROLS)) {
  20771. var helperTextElement = document.getElementById(this.input_.getAttribute(__WEBPACK_IMPORTED_MODULE_3__constants__["e" /* strings */].ARIA_CONTROLS));
  20772. if (helperTextElement) {
  20773. this.helperText_ = helperTextFactory(helperTextElement);
  20774. }
  20775. }
  20776. var iconElements = this.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_3__constants__["e" /* strings */].ICON_SELECTOR);
  20777. if (iconElements.length > 0) {
  20778. if (iconElements.length > 1) {
  20779. // Has both icons.
  20780. this.leadingIcon_ = iconFactory(iconElements[0]);
  20781. this.trailingIcon_ = iconFactory(iconElements[1]);
  20782. } else {
  20783. if (this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* cssClasses */].WITH_LEADING_ICON)) {
  20784. this.leadingIcon_ = iconFactory(iconElements[0]);
  20785. } else {
  20786. this.trailingIcon_ = iconFactory(iconElements[0]);
  20787. }
  20788. }
  20789. }
  20790. this.ripple = null;
  20791. 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)) {
  20792. var MATCHES = Object(__WEBPACK_IMPORTED_MODULE_2__material_ripple_util__["getMatchesProperty"])(HTMLElement.prototype);
  20793. var adapter = _extends(__WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRipple"].createAdapter( /** @type {!RippleCapableSurface} */this), {
  20794. isSurfaceActive: function isSurfaceActive() {
  20795. return _this2.input_[MATCHES](':active');
  20796. },
  20797. registerInteractionHandler: function registerInteractionHandler(type, handler) {
  20798. return _this2.input_.addEventListener(type, handler);
  20799. },
  20800. deregisterInteractionHandler: function deregisterInteractionHandler(type, handler) {
  20801. return _this2.input_.removeEventListener(type, handler);
  20802. }
  20803. });
  20804. var foundation = new __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRippleFoundation"](adapter);
  20805. this.ripple = rippleFactory(this.root_, foundation);
  20806. }
  20807. }
  20808. }, {
  20809. key: 'destroy',
  20810. value: function destroy() {
  20811. if (this.ripple) {
  20812. this.ripple.destroy();
  20813. }
  20814. if (this.lineRipple_) {
  20815. this.lineRipple_.destroy();
  20816. }
  20817. if (this.helperText_) {
  20818. this.helperText_.destroy();
  20819. }
  20820. if (this.leadingIcon_) {
  20821. this.leadingIcon_.destroy();
  20822. }
  20823. if (this.trailingIcon_) {
  20824. this.trailingIcon_.destroy();
  20825. }
  20826. if (this.label_) {
  20827. this.label_.destroy();
  20828. }
  20829. if (this.outline_) {
  20830. this.outline_.destroy();
  20831. }
  20832. _get(MDCTextField.prototype.__proto__ || Object.getPrototypeOf(MDCTextField.prototype), 'destroy', this).call(this);
  20833. }
  20834. /**
  20835. * Initiliazes the Text Field's internal state based on the environment's
  20836. * state.
  20837. */
  20838. }, {
  20839. key: 'initialSyncWithDom',
  20840. value: function initialSyncWithDom() {
  20841. this.disabled = this.input_.disabled;
  20842. }
  20843. /**
  20844. * @return {string} The value of the input.
  20845. */
  20846. }, {
  20847. key: 'layout',
  20848. /**
  20849. * Recomputes the outline SVG path for the outline element.
  20850. */
  20851. value: function layout() {
  20852. var openNotch = this.foundation_.shouldFloat;
  20853. this.foundation_.notchOutline(openNotch);
  20854. }
  20855. /**
  20856. * @return {!MDCTextFieldFoundation}
  20857. */
  20858. }, {
  20859. key: 'getDefaultFoundation',
  20860. value: function getDefaultFoundation() {
  20861. var _this3 = this;
  20862. return new __WEBPACK_IMPORTED_MODULE_5__foundation__["a" /* default */](
  20863. /** @type {!MDCTextFieldAdapter} */_extends({
  20864. addClass: function addClass(className) {
  20865. return _this3.root_.classList.add(className);
  20866. },
  20867. removeClass: function removeClass(className) {
  20868. return _this3.root_.classList.remove(className);
  20869. },
  20870. hasClass: function hasClass(className) {
  20871. return _this3.root_.classList.contains(className);
  20872. },
  20873. registerTextFieldInteractionHandler: function registerTextFieldInteractionHandler(evtType, handler) {
  20874. return _this3.root_.addEventListener(evtType, handler);
  20875. },
  20876. deregisterTextFieldInteractionHandler: function deregisterTextFieldInteractionHandler(evtType, handler) {
  20877. return _this3.root_.removeEventListener(evtType, handler);
  20878. },
  20879. registerValidationAttributeChangeHandler: function registerValidationAttributeChangeHandler(handler) {
  20880. var getAttributesList = function getAttributesList(mutationsList) {
  20881. return mutationsList.map(function (mutation) {
  20882. return mutation.attributeName;
  20883. });
  20884. };
  20885. var observer = new MutationObserver(function (mutationsList) {
  20886. return handler(getAttributesList(mutationsList));
  20887. });
  20888. var targetNode = _this3.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["e" /* strings */].INPUT_SELECTOR);
  20889. var config = { attributes: true };
  20890. observer.observe(targetNode, config);
  20891. return observer;
  20892. },
  20893. deregisterValidationAttributeChangeHandler: function deregisterValidationAttributeChangeHandler(observer) {
  20894. return observer.disconnect();
  20895. },
  20896. isFocused: function isFocused() {
  20897. return document.activeElement === _this3.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["e" /* strings */].INPUT_SELECTOR);
  20898. },
  20899. isRtl: function isRtl() {
  20900. return window.getComputedStyle(_this3.root_).getPropertyValue('direction') === 'rtl';
  20901. }
  20902. }, this.getInputAdapterMethods_(), this.getLabelAdapterMethods_(), this.getLineRippleAdapterMethods_(), this.getOutlineAdapterMethods_()), this.getFoundationMap_());
  20903. }
  20904. /**
  20905. * @return {!{
  20906. * shakeLabel: function(boolean): undefined,
  20907. * floatLabel: function(boolean): undefined,
  20908. * hasLabel: function(): boolean,
  20909. * getLabelWidth: function(): number,
  20910. * }}
  20911. */
  20912. }, {
  20913. key: 'getLabelAdapterMethods_',
  20914. value: function getLabelAdapterMethods_() {
  20915. var _this4 = this;
  20916. return {
  20917. shakeLabel: function shakeLabel(shouldShake) {
  20918. return _this4.label_.shake(shouldShake);
  20919. },
  20920. floatLabel: function floatLabel(shouldFloat) {
  20921. return _this4.label_.float(shouldFloat);
  20922. },
  20923. hasLabel: function hasLabel() {
  20924. return !!_this4.label_;
  20925. },
  20926. getLabelWidth: function getLabelWidth() {
  20927. return _this4.label_.getWidth();
  20928. }
  20929. };
  20930. }
  20931. /**
  20932. * @return {!{
  20933. * activateLineRipple: function(): undefined,
  20934. * deactivateLineRipple: function(): undefined,
  20935. * setLineRippleTransformOrigin: function(number): undefined,
  20936. * }}
  20937. */
  20938. }, {
  20939. key: 'getLineRippleAdapterMethods_',
  20940. value: function getLineRippleAdapterMethods_() {
  20941. var _this5 = this;
  20942. return {
  20943. activateLineRipple: function activateLineRipple() {
  20944. if (_this5.lineRipple_) {
  20945. _this5.lineRipple_.activate();
  20946. }
  20947. },
  20948. deactivateLineRipple: function deactivateLineRipple() {
  20949. if (_this5.lineRipple_) {
  20950. _this5.lineRipple_.deactivate();
  20951. }
  20952. },
  20953. setLineRippleTransformOrigin: function setLineRippleTransformOrigin(normalizedX) {
  20954. if (_this5.lineRipple_) {
  20955. _this5.lineRipple_.setRippleCenter(normalizedX);
  20956. }
  20957. }
  20958. };
  20959. }
  20960. /**
  20961. * @return {!{
  20962. * notchOutline: function(number, boolean): undefined,
  20963. * hasOutline: function(): boolean,
  20964. * }}
  20965. */
  20966. }, {
  20967. key: 'getOutlineAdapterMethods_',
  20968. value: function getOutlineAdapterMethods_() {
  20969. var _this6 = this;
  20970. return {
  20971. notchOutline: function notchOutline(labelWidth, isRtl) {
  20972. return _this6.outline_.notch(labelWidth, isRtl);
  20973. },
  20974. closeOutline: function closeOutline() {
  20975. return _this6.outline_.closeNotch();
  20976. },
  20977. hasOutline: function hasOutline() {
  20978. return !!_this6.outline_;
  20979. }
  20980. };
  20981. }
  20982. /**
  20983. * @return {!{
  20984. * registerInputInteractionHandler: function(string, function()): undefined,
  20985. * deregisterInputInteractionHandler: function(string, function()): undefined,
  20986. * getNativeInput: function(): ?Element,
  20987. * }}
  20988. */
  20989. }, {
  20990. key: 'getInputAdapterMethods_',
  20991. value: function getInputAdapterMethods_() {
  20992. var _this7 = this;
  20993. return {
  20994. registerInputInteractionHandler: function registerInputInteractionHandler(evtType, handler) {
  20995. return _this7.input_.addEventListener(evtType, handler);
  20996. },
  20997. deregisterInputInteractionHandler: function deregisterInputInteractionHandler(evtType, handler) {
  20998. return _this7.input_.removeEventListener(evtType, handler);
  20999. },
  21000. getNativeInput: function getNativeInput() {
  21001. return _this7.input_;
  21002. }
  21003. };
  21004. }
  21005. /**
  21006. * Returns a map of all subcomponents to subfoundations.
  21007. * @return {!FoundationMapType}
  21008. */
  21009. }, {
  21010. key: 'getFoundationMap_',
  21011. value: function getFoundationMap_() {
  21012. return {
  21013. helperText: this.helperText_ ? this.helperText_.foundation : undefined,
  21014. leadingIcon: this.leadingIcon_ ? this.leadingIcon_.foundation : undefined,
  21015. trailingIcon: this.trailingIcon_ ? this.trailingIcon_.foundation : undefined
  21016. };
  21017. }
  21018. }, {
  21019. key: 'value',
  21020. get: function get() {
  21021. return this.foundation_.getValue();
  21022. }
  21023. /**
  21024. * @param {string} value The value to set on the input.
  21025. */
  21026. ,
  21027. set: function set(value) {
  21028. this.foundation_.setValue(value);
  21029. }
  21030. /**
  21031. * @return {boolean} True if the Text Field is disabled.
  21032. */
  21033. }, {
  21034. key: 'disabled',
  21035. get: function get() {
  21036. return this.foundation_.isDisabled();
  21037. }
  21038. /**
  21039. * @param {boolean} disabled Sets the Text Field disabled or enabled.
  21040. */
  21041. ,
  21042. set: function set(disabled) {
  21043. this.foundation_.setDisabled(disabled);
  21044. }
  21045. /**
  21046. * @return {boolean} valid True if the Text Field is valid.
  21047. */
  21048. }, {
  21049. key: 'valid',
  21050. get: function get() {
  21051. return this.foundation_.isValid();
  21052. }
  21053. /**
  21054. * @param {boolean} valid Sets the Text Field valid or invalid.
  21055. */
  21056. ,
  21057. set: function set(valid) {
  21058. this.foundation_.setValid(valid);
  21059. }
  21060. /**
  21061. * @return {boolean} True if the Text Field is required.
  21062. */
  21063. }, {
  21064. key: 'required',
  21065. get: function get() {
  21066. return this.input_.required;
  21067. }
  21068. /**
  21069. * @param {boolean} required Sets the Text Field to required.
  21070. */
  21071. ,
  21072. set: function set(required) {
  21073. this.input_.required = required;
  21074. }
  21075. /**
  21076. * @return {string} The input element's validation pattern.
  21077. */
  21078. }, {
  21079. key: 'pattern',
  21080. get: function get() {
  21081. return this.input_.pattern;
  21082. }
  21083. /**
  21084. * @param {string} pattern Sets the input element's validation pattern.
  21085. */
  21086. ,
  21087. set: function set(pattern) {
  21088. this.input_.pattern = pattern;
  21089. }
  21090. /**
  21091. * @return {number} The input element's minLength.
  21092. */
  21093. }, {
  21094. key: 'minLength',
  21095. get: function get() {
  21096. return this.input_.minLength;
  21097. }
  21098. /**
  21099. * @param {number} minLength Sets the input element's minLength.
  21100. */
  21101. ,
  21102. set: function set(minLength) {
  21103. this.input_.minLength = minLength;
  21104. }
  21105. /**
  21106. * @return {number} The input element's maxLength.
  21107. */
  21108. }, {
  21109. key: 'maxLength',
  21110. get: function get() {
  21111. return this.input_.maxLength;
  21112. }
  21113. /**
  21114. * @param {number} maxLength Sets the input element's maxLength.
  21115. */
  21116. ,
  21117. set: function set(maxLength) {
  21118. // Chrome throws exception if maxLength is set < 0
  21119. if (maxLength < 0) {
  21120. this.input_.removeAttribute('maxLength');
  21121. } else {
  21122. this.input_.maxLength = maxLength;
  21123. }
  21124. }
  21125. /**
  21126. * @return {string} The input element's min.
  21127. */
  21128. }, {
  21129. key: 'min',
  21130. get: function get() {
  21131. return this.input_.min;
  21132. }
  21133. /**
  21134. * @param {string} min Sets the input element's min.
  21135. */
  21136. ,
  21137. set: function set(min) {
  21138. this.input_.min = min;
  21139. }
  21140. /**
  21141. * @return {string} The input element's max.
  21142. */
  21143. }, {
  21144. key: 'max',
  21145. get: function get() {
  21146. return this.input_.max;
  21147. }
  21148. /**
  21149. * @param {string} max Sets the input element's max.
  21150. */
  21151. ,
  21152. set: function set(max) {
  21153. this.input_.max = max;
  21154. }
  21155. /**
  21156. * @return {string} The input element's step.
  21157. */
  21158. }, {
  21159. key: 'step',
  21160. get: function get() {
  21161. return this.input_.step;
  21162. }
  21163. /**
  21164. * @param {string} step Sets the input element's step.
  21165. */
  21166. ,
  21167. set: function set(step) {
  21168. this.input_.step = step;
  21169. }
  21170. /**
  21171. * Sets the helper text element content.
  21172. * @param {string} content
  21173. */
  21174. }, {
  21175. key: 'helperTextContent',
  21176. set: function set(content) {
  21177. this.foundation_.setHelperTextContent(content);
  21178. }
  21179. /**
  21180. * Sets the aria label of the leading icon.
  21181. * @param {string} label
  21182. */
  21183. }, {
  21184. key: 'leadingIconAriaLabel',
  21185. set: function set(label) {
  21186. this.foundation_.setLeadingIconAriaLabel(label);
  21187. }
  21188. /**
  21189. * Sets the text content of the leading icon.
  21190. * @param {string} content
  21191. */
  21192. }, {
  21193. key: 'leadingIconContent',
  21194. set: function set(content) {
  21195. this.foundation_.setLeadingIconContent(content);
  21196. }
  21197. /**
  21198. * Sets the aria label of the trailing icon.
  21199. * @param {string} label
  21200. */
  21201. }, {
  21202. key: 'trailingIconAriaLabel',
  21203. set: function set(label) {
  21204. this.foundation_.setTrailingIconAriaLabel(label);
  21205. }
  21206. /**
  21207. * Sets the text content of the trailing icon.
  21208. * @param {string} content
  21209. */
  21210. }, {
  21211. key: 'trailingIconContent',
  21212. set: function set(content) {
  21213. this.foundation_.setTrailingIconContent(content);
  21214. }
  21215. /**
  21216. * Enables or disables the use of native validation. Use this for custom validation.
  21217. * @param {boolean} useNativeValidation Set this to false to ignore native input validation.
  21218. */
  21219. }, {
  21220. key: 'useNativeValidation',
  21221. set: function set(useNativeValidation) {
  21222. this.foundation_.setUseNativeValidation(useNativeValidation);
  21223. }
  21224. }], [{
  21225. key: 'attachTo',
  21226. value: function attachTo(root) {
  21227. return new MDCTextField(root);
  21228. }
  21229. }]);
  21230. return MDCTextField;
  21231. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  21232. /***/ }),
  21233. /* 146 */
  21234. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  21235. "use strict";
  21236. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  21237. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  21238. /**
  21239. * @license
  21240. * Copyright 2016 Google Inc.
  21241. *
  21242. * Permission is hereby granted, free of charge, to any person obtaining a copy
  21243. * of this software and associated documentation files (the "Software"), to deal
  21244. * in the Software without restriction, including without limitation the rights
  21245. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  21246. * copies of the Software, and to permit persons to whom the Software is
  21247. * furnished to do so, subject to the following conditions:
  21248. *
  21249. * The above copyright notice and this permission notice shall be included in
  21250. * all copies or substantial portions of the Software.
  21251. *
  21252. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  21253. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  21254. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  21255. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  21256. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  21257. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  21258. * THE SOFTWARE.
  21259. */
  21260. /** @enum {string} */
  21261. var strings = {
  21262. ARIA_HIDDEN: 'aria-hidden',
  21263. ROLE: 'role'
  21264. };
  21265. /** @enum {string} */
  21266. var cssClasses = {
  21267. HELPER_TEXT_PERSISTENT: 'mdc-text-field-helper-text--persistent',
  21268. HELPER_TEXT_VALIDATION_MSG: 'mdc-text-field-helper-text--validation-msg'
  21269. };
  21270. /***/ }),
  21271. /* 147 */
  21272. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  21273. "use strict";
  21274. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return strings; });
  21275. /**
  21276. * @license
  21277. * Copyright 2016 Google Inc.
  21278. *
  21279. * Permission is hereby granted, free of charge, to any person obtaining a copy
  21280. * of this software and associated documentation files (the "Software"), to deal
  21281. * in the Software without restriction, including without limitation the rights
  21282. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  21283. * copies of the Software, and to permit persons to whom the Software is
  21284. * furnished to do so, subject to the following conditions:
  21285. *
  21286. * The above copyright notice and this permission notice shall be included in
  21287. * all copies or substantial portions of the Software.
  21288. *
  21289. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  21290. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  21291. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  21292. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  21293. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  21294. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  21295. * THE SOFTWARE.
  21296. */
  21297. /** @enum {string} */
  21298. var strings = {
  21299. ICON_EVENT: 'MDCTextField:icon',
  21300. ICON_ROLE: 'button'
  21301. };
  21302. /***/ }),
  21303. /* 148 */
  21304. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  21305. "use strict";
  21306. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  21307. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__helper_text_foundation__ = __webpack_require__(27);
  21308. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__icon_foundation__ = __webpack_require__(28);
  21309. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__adapter__ = __webpack_require__(60);
  21310. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__constants__ = __webpack_require__(59);
  21311. 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; };
  21312. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  21313. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21314. 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; }
  21315. 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; }
  21316. /**
  21317. * @license
  21318. * Copyright 2016 Google Inc.
  21319. *
  21320. * Permission is hereby granted, free of charge, to any person obtaining a copy
  21321. * of this software and associated documentation files (the "Software"), to deal
  21322. * in the Software without restriction, including without limitation the rights
  21323. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  21324. * copies of the Software, and to permit persons to whom the Software is
  21325. * furnished to do so, subject to the following conditions:
  21326. *
  21327. * The above copyright notice and this permission notice shall be included in
  21328. * all copies or substantial portions of the Software.
  21329. *
  21330. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  21331. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  21332. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  21333. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  21334. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  21335. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  21336. * THE SOFTWARE.
  21337. */
  21338. /* eslint-disable no-unused-vars */
  21339. /* eslint-enable no-unused-vars */
  21340. /**
  21341. * @extends {MDCFoundation<!MDCTextFieldAdapter>}
  21342. * @final
  21343. */
  21344. var MDCTextFieldFoundation = function (_MDCFoundation) {
  21345. _inherits(MDCTextFieldFoundation, _MDCFoundation);
  21346. _createClass(MDCTextFieldFoundation, [{
  21347. key: 'shouldShake',
  21348. /** @return {boolean} */
  21349. get: function get() {
  21350. return !this.isValid() && !this.isFocused_ && !!this.getValue();
  21351. }
  21352. /**
  21353. * @return {boolean}
  21354. * @private
  21355. */
  21356. }, {
  21357. key: 'shouldAlwaysFloat_',
  21358. get: function get() {
  21359. var type = this.getNativeInput_().type;
  21360. return __WEBPACK_IMPORTED_MODULE_4__constants__["a" /* ALWAYS_FLOAT_TYPES */].indexOf(type) >= 0;
  21361. }
  21362. /** @return {boolean} */
  21363. }, {
  21364. key: 'shouldFloat',
  21365. get: function get() {
  21366. return this.shouldAlwaysFloat_ || this.isFocused_ || !!this.getValue() || this.isBadInput_();
  21367. }
  21368. /**
  21369. * {@see MDCTextFieldAdapter} for typing information on parameters and return
  21370. * types.
  21371. * @return {!MDCTextFieldAdapter}
  21372. */
  21373. }], [{
  21374. key: 'cssClasses',
  21375. /** @return enum {string} */
  21376. get: function get() {
  21377. return __WEBPACK_IMPORTED_MODULE_4__constants__["c" /* cssClasses */];
  21378. }
  21379. /** @return enum {string} */
  21380. }, {
  21381. key: 'strings',
  21382. get: function get() {
  21383. return __WEBPACK_IMPORTED_MODULE_4__constants__["e" /* strings */];
  21384. }
  21385. /** @return enum {string} */
  21386. }, {
  21387. key: 'numbers',
  21388. get: function get() {
  21389. return __WEBPACK_IMPORTED_MODULE_4__constants__["d" /* numbers */];
  21390. }
  21391. }, {
  21392. key: 'defaultAdapter',
  21393. get: function get() {
  21394. return (/** @type {!MDCTextFieldAdapter} */{
  21395. addClass: function addClass() {},
  21396. removeClass: function removeClass() {},
  21397. hasClass: function hasClass() {},
  21398. registerTextFieldInteractionHandler: function registerTextFieldInteractionHandler() {},
  21399. deregisterTextFieldInteractionHandler: function deregisterTextFieldInteractionHandler() {},
  21400. registerInputInteractionHandler: function registerInputInteractionHandler() {},
  21401. deregisterInputInteractionHandler: function deregisterInputInteractionHandler() {},
  21402. registerValidationAttributeChangeHandler: function registerValidationAttributeChangeHandler() {},
  21403. deregisterValidationAttributeChangeHandler: function deregisterValidationAttributeChangeHandler() {},
  21404. getNativeInput: function getNativeInput() {},
  21405. isFocused: function isFocused() {},
  21406. isRtl: function isRtl() {},
  21407. activateLineRipple: function activateLineRipple() {},
  21408. deactivateLineRipple: function deactivateLineRipple() {},
  21409. setLineRippleTransformOrigin: function setLineRippleTransformOrigin() {},
  21410. shakeLabel: function shakeLabel() {},
  21411. floatLabel: function floatLabel() {},
  21412. hasLabel: function hasLabel() {},
  21413. getLabelWidth: function getLabelWidth() {},
  21414. hasOutline: function hasOutline() {},
  21415. notchOutline: function notchOutline() {},
  21416. closeOutline: function closeOutline() {}
  21417. }
  21418. );
  21419. }
  21420. /**
  21421. * @param {!MDCTextFieldAdapter} adapter
  21422. * @param {!FoundationMapType=} foundationMap Map from subcomponent names to their subfoundations.
  21423. */
  21424. }]);
  21425. function MDCTextFieldFoundation(adapter) {
  21426. var foundationMap = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : /** @type {!FoundationMapType} */{};
  21427. _classCallCheck(this, MDCTextFieldFoundation);
  21428. /** @type {!MDCTextFieldHelperTextFoundation|undefined} */
  21429. var _this = _possibleConstructorReturn(this, (MDCTextFieldFoundation.__proto__ || Object.getPrototypeOf(MDCTextFieldFoundation)).call(this, _extends(MDCTextFieldFoundation.defaultAdapter, adapter)));
  21430. _this.helperText_ = foundationMap.helperText;
  21431. /** @type {!MDCTextFieldIconFoundation|undefined} */
  21432. _this.leadingIcon_ = foundationMap.leadingIcon;
  21433. /** @type {!MDCTextFieldIconFoundation|undefined} */
  21434. _this.trailingIcon_ = foundationMap.trailingIcon;
  21435. /** @private {boolean} */
  21436. _this.isFocused_ = false;
  21437. /** @private {boolean} */
  21438. _this.receivedUserInput_ = false;
  21439. /** @private {boolean} */
  21440. _this.useCustomValidityChecking_ = false;
  21441. /** @private {boolean} */
  21442. _this.isValid_ = true;
  21443. /** @private {boolean} */
  21444. _this.useNativeValidation_ = true;
  21445. /** @private {function(): undefined} */
  21446. _this.inputFocusHandler_ = function () {
  21447. return _this.activateFocus();
  21448. };
  21449. /** @private {function(): undefined} */
  21450. _this.inputBlurHandler_ = function () {
  21451. return _this.deactivateFocus();
  21452. };
  21453. /** @private {function(): undefined} */
  21454. _this.inputInputHandler_ = function () {
  21455. return _this.autoCompleteFocus();
  21456. };
  21457. /** @private {function(!Event): undefined} */
  21458. _this.setPointerXOffset_ = function (evt) {
  21459. return _this.setTransformOrigin(evt);
  21460. };
  21461. /** @private {function(!Event): undefined} */
  21462. _this.textFieldInteractionHandler_ = function () {
  21463. return _this.handleTextFieldInteraction();
  21464. };
  21465. /** @private {function(!Array): undefined} */
  21466. _this.validationAttributeChangeHandler_ = function (attributesList) {
  21467. return _this.handleValidationAttributeChange(attributesList);
  21468. };
  21469. /** @private {!MutationObserver} */
  21470. _this.validationObserver_;
  21471. return _this;
  21472. }
  21473. _createClass(MDCTextFieldFoundation, [{
  21474. key: 'init',
  21475. value: function init() {
  21476. var _this2 = this;
  21477. if (this.adapter_.isFocused()) {
  21478. this.inputFocusHandler_();
  21479. } else if (this.adapter_.hasLabel() && this.shouldFloat) {
  21480. this.notchOutline(true);
  21481. this.adapter_.floatLabel(true);
  21482. }
  21483. this.adapter_.registerInputInteractionHandler('focus', this.inputFocusHandler_);
  21484. this.adapter_.registerInputInteractionHandler('blur', this.inputBlurHandler_);
  21485. this.adapter_.registerInputInteractionHandler('input', this.inputInputHandler_);
  21486. ['mousedown', 'touchstart'].forEach(function (evtType) {
  21487. _this2.adapter_.registerInputInteractionHandler(evtType, _this2.setPointerXOffset_);
  21488. });
  21489. ['click', 'keydown'].forEach(function (evtType) {
  21490. _this2.adapter_.registerTextFieldInteractionHandler(evtType, _this2.textFieldInteractionHandler_);
  21491. });
  21492. this.validationObserver_ = this.adapter_.registerValidationAttributeChangeHandler(this.validationAttributeChangeHandler_);
  21493. }
  21494. }, {
  21495. key: 'destroy',
  21496. value: function destroy() {
  21497. var _this3 = this;
  21498. this.adapter_.deregisterInputInteractionHandler('focus', this.inputFocusHandler_);
  21499. this.adapter_.deregisterInputInteractionHandler('blur', this.inputBlurHandler_);
  21500. this.adapter_.deregisterInputInteractionHandler('input', this.inputInputHandler_);
  21501. ['mousedown', 'touchstart'].forEach(function (evtType) {
  21502. _this3.adapter_.deregisterInputInteractionHandler(evtType, _this3.setPointerXOffset_);
  21503. });
  21504. ['click', 'keydown'].forEach(function (evtType) {
  21505. _this3.adapter_.deregisterTextFieldInteractionHandler(evtType, _this3.textFieldInteractionHandler_);
  21506. });
  21507. this.adapter_.deregisterValidationAttributeChangeHandler(this.validationObserver_);
  21508. }
  21509. /**
  21510. * Handles user interactions with the Text Field.
  21511. */
  21512. }, {
  21513. key: 'handleTextFieldInteraction',
  21514. value: function handleTextFieldInteraction() {
  21515. if (this.adapter_.getNativeInput().disabled) {
  21516. return;
  21517. }
  21518. this.receivedUserInput_ = true;
  21519. }
  21520. /**
  21521. * Handles validation attribute changes
  21522. * @param {!Array<string>} attributesList
  21523. */
  21524. }, {
  21525. key: 'handleValidationAttributeChange',
  21526. value: function handleValidationAttributeChange(attributesList) {
  21527. var _this4 = this;
  21528. attributesList.some(function (attributeName) {
  21529. if (__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* VALIDATION_ATTR_WHITELIST */].indexOf(attributeName) > -1) {
  21530. _this4.styleValidity_(true);
  21531. return true;
  21532. }
  21533. });
  21534. }
  21535. /**
  21536. * Opens/closes the notched outline.
  21537. * @param {boolean} openNotch
  21538. */
  21539. }, {
  21540. key: 'notchOutline',
  21541. value: function notchOutline(openNotch) {
  21542. if (!this.adapter_.hasOutline()) {
  21543. return;
  21544. }
  21545. if (openNotch) {
  21546. var isDense = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_4__constants__["c" /* cssClasses */].DENSE);
  21547. var labelScale = isDense ? __WEBPACK_IMPORTED_MODULE_4__constants__["d" /* numbers */].DENSE_LABEL_SCALE : __WEBPACK_IMPORTED_MODULE_4__constants__["d" /* numbers */].LABEL_SCALE;
  21548. var labelWidth = this.adapter_.getLabelWidth() * labelScale;
  21549. var isRtl = this.adapter_.isRtl();
  21550. this.adapter_.notchOutline(labelWidth, isRtl);
  21551. } else {
  21552. this.adapter_.closeOutline();
  21553. }
  21554. }
  21555. /**
  21556. * Activates the text field focus state.
  21557. */
  21558. }, {
  21559. key: 'activateFocus',
  21560. value: function activateFocus() {
  21561. this.isFocused_ = true;
  21562. this.styleFocused_(this.isFocused_);
  21563. this.adapter_.activateLineRipple();
  21564. if (this.adapter_.hasLabel()) {
  21565. this.notchOutline(this.shouldFloat);
  21566. this.adapter_.floatLabel(this.shouldFloat);
  21567. this.adapter_.shakeLabel(this.shouldShake);
  21568. }
  21569. if (this.helperText_) {
  21570. this.helperText_.showToScreenReader();
  21571. }
  21572. }
  21573. /**
  21574. * Sets the line ripple's transform origin, so that the line ripple activate
  21575. * animation will animate out from the user's click location.
  21576. * @param {!Event} evt
  21577. */
  21578. }, {
  21579. key: 'setTransformOrigin',
  21580. value: function setTransformOrigin(evt) {
  21581. var targetClientRect = evt.target.getBoundingClientRect();
  21582. var evtCoords = { x: evt.clientX, y: evt.clientY };
  21583. var normalizedX = evtCoords.x - targetClientRect.left;
  21584. this.adapter_.setLineRippleTransformOrigin(normalizedX);
  21585. }
  21586. /**
  21587. * Activates the Text Field's focus state in cases when the input value
  21588. * changes without user input (e.g. programatically).
  21589. */
  21590. }, {
  21591. key: 'autoCompleteFocus',
  21592. value: function autoCompleteFocus() {
  21593. if (!this.receivedUserInput_) {
  21594. this.activateFocus();
  21595. }
  21596. }
  21597. /**
  21598. * Deactivates the Text Field's focus state.
  21599. */
  21600. }, {
  21601. key: 'deactivateFocus',
  21602. value: function deactivateFocus() {
  21603. this.isFocused_ = false;
  21604. this.adapter_.deactivateLineRipple();
  21605. var isValid = this.isValid();
  21606. this.styleValidity_(isValid);
  21607. this.styleFocused_(this.isFocused_);
  21608. if (this.adapter_.hasLabel()) {
  21609. this.notchOutline(this.shouldFloat);
  21610. this.adapter_.floatLabel(this.shouldFloat);
  21611. this.adapter_.shakeLabel(this.shouldShake);
  21612. }
  21613. if (!this.shouldFloat) {
  21614. this.receivedUserInput_ = false;
  21615. }
  21616. }
  21617. /**
  21618. * @return {string} The value of the input Element.
  21619. */
  21620. }, {
  21621. key: 'getValue',
  21622. value: function getValue() {
  21623. return this.getNativeInput_().value;
  21624. }
  21625. /**
  21626. * @param {string} value The value to set on the input Element.
  21627. */
  21628. }, {
  21629. key: 'setValue',
  21630. value: function setValue(value) {
  21631. this.getNativeInput_().value = value;
  21632. var isValid = this.isValid();
  21633. this.styleValidity_(isValid);
  21634. if (this.adapter_.hasLabel()) {
  21635. this.notchOutline(this.shouldFloat);
  21636. this.adapter_.floatLabel(this.shouldFloat);
  21637. this.adapter_.shakeLabel(this.shouldShake);
  21638. }
  21639. }
  21640. /**
  21641. * @return {boolean} If a custom validity is set, returns that value.
  21642. * Otherwise, returns the result of native validity checks.
  21643. */
  21644. }, {
  21645. key: 'isValid',
  21646. value: function isValid() {
  21647. return this.useNativeValidation_ ? this.isNativeInputValid_() : this.isValid_;
  21648. }
  21649. /**
  21650. * @param {boolean} isValid Sets the validity state of the Text Field.
  21651. */
  21652. }, {
  21653. key: 'setValid',
  21654. value: function setValid(isValid) {
  21655. this.isValid_ = isValid;
  21656. this.styleValidity_(isValid);
  21657. var shouldShake = !isValid && !this.isFocused_;
  21658. if (this.adapter_.hasLabel()) {
  21659. this.adapter_.shakeLabel(shouldShake);
  21660. }
  21661. }
  21662. /**
  21663. * Enables or disables the use of native validation. Use this for custom validation.
  21664. * @param {boolean} useNativeValidation Set this to false to ignore native input validation.
  21665. */
  21666. }, {
  21667. key: 'setUseNativeValidation',
  21668. value: function setUseNativeValidation(useNativeValidation) {
  21669. this.useNativeValidation_ = useNativeValidation;
  21670. }
  21671. /**
  21672. * @return {boolean} True if the Text Field is disabled.
  21673. */
  21674. }, {
  21675. key: 'isDisabled',
  21676. value: function isDisabled() {
  21677. return this.getNativeInput_().disabled;
  21678. }
  21679. /**
  21680. * @param {boolean} disabled Sets the text-field disabled or enabled.
  21681. */
  21682. }, {
  21683. key: 'setDisabled',
  21684. value: function setDisabled(disabled) {
  21685. this.getNativeInput_().disabled = disabled;
  21686. this.styleDisabled_(disabled);
  21687. }
  21688. /**
  21689. * @param {string} content Sets the content of the helper text.
  21690. */
  21691. }, {
  21692. key: 'setHelperTextContent',
  21693. value: function setHelperTextContent(content) {
  21694. if (this.helperText_) {
  21695. this.helperText_.setContent(content);
  21696. }
  21697. }
  21698. /**
  21699. * Sets the aria label of the leading icon.
  21700. * @param {string} label
  21701. */
  21702. }, {
  21703. key: 'setLeadingIconAriaLabel',
  21704. value: function setLeadingIconAriaLabel(label) {
  21705. if (this.leadingIcon_) {
  21706. this.leadingIcon_.setAriaLabel(label);
  21707. }
  21708. }
  21709. /**
  21710. * Sets the text content of the leading icon.
  21711. * @param {string} content
  21712. */
  21713. }, {
  21714. key: 'setLeadingIconContent',
  21715. value: function setLeadingIconContent(content) {
  21716. if (this.leadingIcon_) {
  21717. this.leadingIcon_.setContent(content);
  21718. }
  21719. }
  21720. /**
  21721. * Sets the aria label of the trailing icon.
  21722. * @param {string} label
  21723. */
  21724. }, {
  21725. key: 'setTrailingIconAriaLabel',
  21726. value: function setTrailingIconAriaLabel(label) {
  21727. if (this.trailingIcon_) {
  21728. this.trailingIcon_.setAriaLabel(label);
  21729. }
  21730. }
  21731. /**
  21732. * Sets the text content of the trailing icon.
  21733. * @param {string} content
  21734. */
  21735. }, {
  21736. key: 'setTrailingIconContent',
  21737. value: function setTrailingIconContent(content) {
  21738. if (this.trailingIcon_) {
  21739. this.trailingIcon_.setContent(content);
  21740. }
  21741. }
  21742. /**
  21743. * @return {boolean} True if the Text Field input fails in converting the
  21744. * user-supplied value.
  21745. * @private
  21746. */
  21747. }, {
  21748. key: 'isBadInput_',
  21749. value: function isBadInput_() {
  21750. return this.getNativeInput_().validity.badInput;
  21751. }
  21752. /**
  21753. * @return {boolean} The result of native validity checking
  21754. * (ValidityState.valid).
  21755. */
  21756. }, {
  21757. key: 'isNativeInputValid_',
  21758. value: function isNativeInputValid_() {
  21759. return this.getNativeInput_().validity.valid;
  21760. }
  21761. /**
  21762. * Styles the component based on the validity state.
  21763. * @param {boolean} isValid
  21764. * @private
  21765. */
  21766. }, {
  21767. key: 'styleValidity_',
  21768. value: function styleValidity_(isValid) {
  21769. var INVALID = MDCTextFieldFoundation.cssClasses.INVALID;
  21770. if (isValid) {
  21771. this.adapter_.removeClass(INVALID);
  21772. } else {
  21773. this.adapter_.addClass(INVALID);
  21774. }
  21775. if (this.helperText_) {
  21776. this.helperText_.setValidity(isValid);
  21777. }
  21778. }
  21779. /**
  21780. * Styles the component based on the focused state.
  21781. * @param {boolean} isFocused
  21782. * @private
  21783. */
  21784. }, {
  21785. key: 'styleFocused_',
  21786. value: function styleFocused_(isFocused) {
  21787. var FOCUSED = MDCTextFieldFoundation.cssClasses.FOCUSED;
  21788. if (isFocused) {
  21789. this.adapter_.addClass(FOCUSED);
  21790. } else {
  21791. this.adapter_.removeClass(FOCUSED);
  21792. }
  21793. }
  21794. /**
  21795. * Styles the component based on the disabled state.
  21796. * @param {boolean} isDisabled
  21797. * @private
  21798. */
  21799. }, {
  21800. key: 'styleDisabled_',
  21801. value: function styleDisabled_(isDisabled) {
  21802. var _MDCTextFieldFoundati = MDCTextFieldFoundation.cssClasses,
  21803. DISABLED = _MDCTextFieldFoundati.DISABLED,
  21804. INVALID = _MDCTextFieldFoundati.INVALID;
  21805. if (isDisabled) {
  21806. this.adapter_.addClass(DISABLED);
  21807. this.adapter_.removeClass(INVALID);
  21808. } else {
  21809. this.adapter_.removeClass(DISABLED);
  21810. }
  21811. if (this.leadingIcon_) {
  21812. this.leadingIcon_.setDisabled(isDisabled);
  21813. }
  21814. if (this.trailingIcon_) {
  21815. this.trailingIcon_.setDisabled(isDisabled);
  21816. }
  21817. }
  21818. /**
  21819. * @return {!Element|!NativeInputType} The native text input from the
  21820. * host environment, or a dummy if none exists.
  21821. * @private
  21822. */
  21823. }, {
  21824. key: 'getNativeInput_',
  21825. value: function getNativeInput_() {
  21826. return this.adapter_.getNativeInput() ||
  21827. /** @type {!NativeInputType} */{
  21828. value: '',
  21829. disabled: false,
  21830. validity: {
  21831. badInput: false,
  21832. valid: true
  21833. }
  21834. };
  21835. }
  21836. }]);
  21837. return MDCTextFieldFoundation;
  21838. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  21839. /* harmony default export */ __webpack_exports__["a"] = (MDCTextFieldFoundation);
  21840. /***/ }),
  21841. /* 149 */
  21842. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  21843. "use strict";
  21844. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCTextFieldHelperText; });
  21845. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  21846. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(61);
  21847. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(27);
  21848. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  21849. 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; };
  21850. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  21851. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21852. 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; }
  21853. 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; }
  21854. /**
  21855. * @license
  21856. * Copyright 2017 Google Inc.
  21857. *
  21858. * Permission is hereby granted, free of charge, to any person obtaining a copy
  21859. * of this software and associated documentation files (the "Software"), to deal
  21860. * in the Software without restriction, including without limitation the rights
  21861. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  21862. * copies of the Software, and to permit persons to whom the Software is
  21863. * furnished to do so, subject to the following conditions:
  21864. *
  21865. * The above copyright notice and this permission notice shall be included in
  21866. * all copies or substantial portions of the Software.
  21867. *
  21868. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  21869. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  21870. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  21871. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  21872. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  21873. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  21874. * THE SOFTWARE.
  21875. */
  21876. /**
  21877. * @extends {MDCComponent<!MDCTextFieldHelperTextFoundation>}
  21878. * @final
  21879. */
  21880. var MDCTextFieldHelperText = function (_MDCComponent) {
  21881. _inherits(MDCTextFieldHelperText, _MDCComponent);
  21882. function MDCTextFieldHelperText() {
  21883. _classCallCheck(this, MDCTextFieldHelperText);
  21884. return _possibleConstructorReturn(this, (MDCTextFieldHelperText.__proto__ || Object.getPrototypeOf(MDCTextFieldHelperText)).apply(this, arguments));
  21885. }
  21886. _createClass(MDCTextFieldHelperText, [{
  21887. key: 'getDefaultFoundation',
  21888. /**
  21889. * @return {!MDCTextFieldHelperTextFoundation}
  21890. */
  21891. value: function getDefaultFoundation() {
  21892. var _this2 = this;
  21893. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]( /** @type {!MDCTextFieldHelperTextAdapter} */_extends({
  21894. addClass: function addClass(className) {
  21895. return _this2.root_.classList.add(className);
  21896. },
  21897. removeClass: function removeClass(className) {
  21898. return _this2.root_.classList.remove(className);
  21899. },
  21900. hasClass: function hasClass(className) {
  21901. return _this2.root_.classList.contains(className);
  21902. },
  21903. setAttr: function setAttr(attr, value) {
  21904. return _this2.root_.setAttribute(attr, value);
  21905. },
  21906. removeAttr: function removeAttr(attr) {
  21907. return _this2.root_.removeAttribute(attr);
  21908. },
  21909. setContent: function setContent(content) {
  21910. _this2.root_.textContent = content;
  21911. }
  21912. }));
  21913. }
  21914. }, {
  21915. key: 'foundation',
  21916. /**
  21917. * @return {!MDCTextFieldHelperTextFoundation}
  21918. */
  21919. get: function get() {
  21920. return this.foundation_;
  21921. }
  21922. }], [{
  21923. key: 'attachTo',
  21924. /**
  21925. * @param {!Element} root
  21926. * @return {!MDCTextFieldHelperText}
  21927. */
  21928. value: function attachTo(root) {
  21929. return new MDCTextFieldHelperText(root);
  21930. }
  21931. }]);
  21932. return MDCTextFieldHelperText;
  21933. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  21934. /***/ }),
  21935. /* 150 */
  21936. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  21937. "use strict";
  21938. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCTextFieldIcon; });
  21939. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  21940. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(62);
  21941. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(28);
  21942. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  21943. 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; };
  21944. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  21945. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21946. 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; }
  21947. 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; }
  21948. /**
  21949. * @license
  21950. * Copyright 2017 Google Inc.
  21951. *
  21952. * Permission is hereby granted, free of charge, to any person obtaining a copy
  21953. * of this software and associated documentation files (the "Software"), to deal
  21954. * in the Software without restriction, including without limitation the rights
  21955. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  21956. * copies of the Software, and to permit persons to whom the Software is
  21957. * furnished to do so, subject to the following conditions:
  21958. *
  21959. * The above copyright notice and this permission notice shall be included in
  21960. * all copies or substantial portions of the Software.
  21961. *
  21962. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  21963. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  21964. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  21965. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  21966. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  21967. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  21968. * THE SOFTWARE.
  21969. */
  21970. /**
  21971. * @extends {MDCComponent<!MDCTextFieldIconFoundation>}
  21972. * @final
  21973. */
  21974. var MDCTextFieldIcon = function (_MDCComponent) {
  21975. _inherits(MDCTextFieldIcon, _MDCComponent);
  21976. function MDCTextFieldIcon() {
  21977. _classCallCheck(this, MDCTextFieldIcon);
  21978. return _possibleConstructorReturn(this, (MDCTextFieldIcon.__proto__ || Object.getPrototypeOf(MDCTextFieldIcon)).apply(this, arguments));
  21979. }
  21980. _createClass(MDCTextFieldIcon, [{
  21981. key: 'getDefaultFoundation',
  21982. /**
  21983. * @return {!MDCTextFieldIconFoundation}
  21984. */
  21985. value: function getDefaultFoundation() {
  21986. var _this2 = this;
  21987. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]( /** @type {!MDCTextFieldIconAdapter} */_extends({
  21988. getAttr: function getAttr(attr) {
  21989. return _this2.root_.getAttribute(attr);
  21990. },
  21991. setAttr: function setAttr(attr, value) {
  21992. return _this2.root_.setAttribute(attr, value);
  21993. },
  21994. removeAttr: function removeAttr(attr) {
  21995. return _this2.root_.removeAttribute(attr);
  21996. },
  21997. setContent: function setContent(content) {
  21998. _this2.root_.textContent = content;
  21999. },
  22000. registerInteractionHandler: function registerInteractionHandler(evtType, handler) {
  22001. return _this2.root_.addEventListener(evtType, handler);
  22002. },
  22003. deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) {
  22004. return _this2.root_.removeEventListener(evtType, handler);
  22005. },
  22006. notifyIconAction: function notifyIconAction() {
  22007. return _this2.emit(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.ICON_EVENT, {} /* evtData */, true /* shouldBubble */);
  22008. }
  22009. }));
  22010. }
  22011. }, {
  22012. key: 'foundation',
  22013. /**
  22014. * @return {!MDCTextFieldIconFoundation}
  22015. */
  22016. get: function get() {
  22017. return this.foundation_;
  22018. }
  22019. }], [{
  22020. key: 'attachTo',
  22021. /**
  22022. * @param {!Element} root
  22023. * @return {!MDCTextFieldIcon}
  22024. */
  22025. value: function attachTo(root) {
  22026. return new MDCTextFieldIcon(root);
  22027. }
  22028. }]);
  22029. return MDCTextFieldIcon;
  22030. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  22031. /***/ }),
  22032. /* 151 */
  22033. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22034. "use strict";
  22035. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  22036. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCToolbar", function() { return MDCToolbar; });
  22037. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_index__ = __webpack_require__(3);
  22038. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__ = __webpack_require__(2);
  22039. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(152);
  22040. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCToolbarFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  22041. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  22042. 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); } };
  22043. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22044. 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; }
  22045. 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; }
  22046. /**
  22047. * @license
  22048. * Copyright 2017 Google Inc.
  22049. *
  22050. * Permission is hereby granted, free of charge, to any person obtaining a copy
  22051. * of this software and associated documentation files (the "Software"), to deal
  22052. * in the Software without restriction, including without limitation the rights
  22053. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  22054. * copies of the Software, and to permit persons to whom the Software is
  22055. * furnished to do so, subject to the following conditions:
  22056. *
  22057. * The above copyright notice and this permission notice shall be included in
  22058. * all copies or substantial portions of the Software.
  22059. *
  22060. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  22061. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  22062. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  22063. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  22064. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  22065. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  22066. * THE SOFTWARE.
  22067. */
  22068. var MDCToolbar = function (_MDCComponent) {
  22069. _inherits(MDCToolbar, _MDCComponent);
  22070. function MDCToolbar() {
  22071. _classCallCheck(this, MDCToolbar);
  22072. return _possibleConstructorReturn(this, (MDCToolbar.__proto__ || Object.getPrototypeOf(MDCToolbar)).apply(this, arguments));
  22073. }
  22074. _createClass(MDCToolbar, [{
  22075. key: 'initialize',
  22076. value: function initialize() {
  22077. this.ripples_ = [].map.call(this.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.ICON_SELECTOR), function (icon) {
  22078. var ripple = __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRipple"].attachTo(icon);
  22079. ripple.unbounded = true;
  22080. return ripple;
  22081. });
  22082. }
  22083. }, {
  22084. key: 'destroy',
  22085. value: function destroy() {
  22086. this.ripples_.forEach(function (ripple) {
  22087. ripple.destroy();
  22088. });
  22089. _get(MDCToolbar.prototype.__proto__ || Object.getPrototypeOf(MDCToolbar.prototype), 'destroy', this).call(this);
  22090. }
  22091. }, {
  22092. key: 'getDefaultFoundation',
  22093. value: function getDefaultFoundation() {
  22094. var _this2 = this;
  22095. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]({
  22096. hasClass: function hasClass(className) {
  22097. return _this2.root_.classList.contains(className);
  22098. },
  22099. addClass: function addClass(className) {
  22100. return _this2.root_.classList.add(className);
  22101. },
  22102. removeClass: function removeClass(className) {
  22103. return _this2.root_.classList.remove(className);
  22104. },
  22105. registerScrollHandler: function registerScrollHandler(handler) {
  22106. return window.addEventListener('scroll', handler);
  22107. },
  22108. deregisterScrollHandler: function deregisterScrollHandler(handler) {
  22109. return window.removeEventListener('scroll', handler);
  22110. },
  22111. registerResizeHandler: function registerResizeHandler(handler) {
  22112. return window.addEventListener('resize', handler);
  22113. },
  22114. deregisterResizeHandler: function deregisterResizeHandler(handler) {
  22115. return window.removeEventListener('resize', handler);
  22116. },
  22117. getViewportWidth: function getViewportWidth() {
  22118. return window.innerWidth;
  22119. },
  22120. getViewportScrollY: function getViewportScrollY() {
  22121. return window.pageYOffset;
  22122. },
  22123. getOffsetHeight: function getOffsetHeight() {
  22124. return _this2.root_.offsetHeight;
  22125. },
  22126. getFirstRowElementOffsetHeight: function getFirstRowElementOffsetHeight() {
  22127. return _this2.firstRowElement_.offsetHeight;
  22128. },
  22129. notifyChange: function notifyChange(evtData) {
  22130. return _this2.emit(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.CHANGE_EVENT, evtData);
  22131. },
  22132. setStyle: function setStyle(property, value) {
  22133. return _this2.root_.style.setProperty(property, value);
  22134. },
  22135. setStyleForTitleElement: function setStyleForTitleElement(property, value) {
  22136. return _this2.titleElement_.style.setProperty(property, value);
  22137. },
  22138. setStyleForFlexibleRowElement: function setStyleForFlexibleRowElement(property, value) {
  22139. return _this2.firstRowElement_.style.setProperty(property, value);
  22140. },
  22141. setStyleForFixedAdjustElement: function setStyleForFixedAdjustElement(property, value) {
  22142. if (_this2.fixedAdjustElement) {
  22143. _this2.fixedAdjustElement.style.setProperty(property, value);
  22144. }
  22145. }
  22146. });
  22147. }
  22148. }, {
  22149. key: 'firstRowElement_',
  22150. get: function get() {
  22151. return this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.FIRST_ROW_SELECTOR);
  22152. }
  22153. }, {
  22154. key: 'titleElement_',
  22155. get: function get() {
  22156. return this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.TITLE_SELECTOR);
  22157. }
  22158. }, {
  22159. key: 'fixedAdjustElement',
  22160. set: function set(fixedAdjustElement) {
  22161. this.fixedAdjustElement_ = fixedAdjustElement;
  22162. this.foundation_.updateAdjustElementStyles();
  22163. },
  22164. get: function get() {
  22165. return this.fixedAdjustElement_;
  22166. }
  22167. }], [{
  22168. key: 'attachTo',
  22169. value: function attachTo(root) {
  22170. return new MDCToolbar(root);
  22171. }
  22172. }]);
  22173. return MDCToolbar;
  22174. }(__WEBPACK_IMPORTED_MODULE_0__material_base_index__["MDCComponent"]);
  22175. /***/ }),
  22176. /* 152 */
  22177. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22178. "use strict";
  22179. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  22180. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(153);
  22181. 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; };
  22182. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  22183. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22184. 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; }
  22185. 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; }
  22186. /**
  22187. * @license
  22188. * Copyright 2017 Google Inc.
  22189. *
  22190. * Permission is hereby granted, free of charge, to any person obtaining a copy
  22191. * of this software and associated documentation files (the "Software"), to deal
  22192. * in the Software without restriction, including without limitation the rights
  22193. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  22194. * copies of the Software, and to permit persons to whom the Software is
  22195. * furnished to do so, subject to the following conditions:
  22196. *
  22197. * The above copyright notice and this permission notice shall be included in
  22198. * all copies or substantial portions of the Software.
  22199. *
  22200. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  22201. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  22202. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  22203. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  22204. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  22205. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  22206. * THE SOFTWARE.
  22207. */
  22208. var MDCToolbarFoundation = function (_MDCFoundation) {
  22209. _inherits(MDCToolbarFoundation, _MDCFoundation);
  22210. _createClass(MDCToolbarFoundation, null, [{
  22211. key: 'cssClasses',
  22212. get: function get() {
  22213. return __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */];
  22214. }
  22215. }, {
  22216. key: 'strings',
  22217. get: function get() {
  22218. return __WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */];
  22219. }
  22220. }, {
  22221. key: 'numbers',
  22222. get: function get() {
  22223. return __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* numbers */];
  22224. }
  22225. }, {
  22226. key: 'defaultAdapter',
  22227. get: function get() {
  22228. return {
  22229. hasClass: function hasClass() {
  22230. return (/* className: string */ /* boolean */false
  22231. );
  22232. },
  22233. addClass: function addClass() /* className: string */{},
  22234. removeClass: function removeClass() /* className: string */{},
  22235. registerScrollHandler: function registerScrollHandler() /* handler: EventListener */{},
  22236. deregisterScrollHandler: function deregisterScrollHandler() /* handler: EventListener */{},
  22237. registerResizeHandler: function registerResizeHandler() /* handler: EventListener */{},
  22238. deregisterResizeHandler: function deregisterResizeHandler() /* handler: EventListener */{},
  22239. getViewportWidth: function getViewportWidth() {
  22240. return (/* number */0
  22241. );
  22242. },
  22243. getViewportScrollY: function getViewportScrollY() {
  22244. return (/* number */0
  22245. );
  22246. },
  22247. getOffsetHeight: function getOffsetHeight() {
  22248. return (/* number */0
  22249. );
  22250. },
  22251. getFirstRowElementOffsetHeight: function getFirstRowElementOffsetHeight() {
  22252. return (/* number */0
  22253. );
  22254. },
  22255. notifyChange: function notifyChange() /* evtData: {flexibleExpansionRatio: number} */{},
  22256. setStyle: function setStyle() /* property: string, value: string */{},
  22257. setStyleForTitleElement: function setStyleForTitleElement() /* property: string, value: string */{},
  22258. setStyleForFlexibleRowElement: function setStyleForFlexibleRowElement() /* property: string, value: string */{},
  22259. setStyleForFixedAdjustElement: function setStyleForFixedAdjustElement() /* property: string, value: string */{}
  22260. };
  22261. }
  22262. }]);
  22263. function MDCToolbarFoundation(adapter) {
  22264. _classCallCheck(this, MDCToolbarFoundation);
  22265. var _this = _possibleConstructorReturn(this, (MDCToolbarFoundation.__proto__ || Object.getPrototypeOf(MDCToolbarFoundation)).call(this, _extends(MDCToolbarFoundation.defaultAdapter, adapter)));
  22266. _this.resizeHandler_ = function () {
  22267. return _this.checkRowHeight_();
  22268. };
  22269. _this.scrollHandler_ = function () {
  22270. return _this.updateToolbarStyles_();
  22271. };
  22272. _this.checkRowHeightFrame_ = 0;
  22273. _this.scrollFrame_ = 0;
  22274. _this.executedLastChange_ = false;
  22275. _this.calculations_ = {
  22276. toolbarRowHeight: 0,
  22277. // Calculated Height ratio. We use ratio to calculate corresponding heights in resize event.
  22278. toolbarRatio: 0, // The ratio of toolbar height to row height
  22279. flexibleExpansionRatio: 0, // The ratio of flexible space height to row height
  22280. maxTranslateYRatio: 0, // The ratio of max toolbar move up distance to row height
  22281. scrollThresholdRatio: 0, // The ratio of max scrollTop that we should listen to to row height
  22282. // Derived Heights based on the above key ratios.
  22283. toolbarHeight: 0,
  22284. flexibleExpansionHeight: 0, // Flexible row minus toolbar height (derived)
  22285. maxTranslateYDistance: 0, // When toolbar only fix last row (derived)
  22286. scrollThreshold: 0
  22287. };
  22288. // Toolbar fixed behavior
  22289. // If toolbar is fixed
  22290. _this.fixed_ = false;
  22291. // If fixed is targeted only at the last row
  22292. _this.fixedLastrow_ = false;
  22293. // Toolbar flexible behavior
  22294. // If the first row is flexible
  22295. _this.hasFlexibleRow_ = false;
  22296. // If use the default behavior
  22297. _this.useFlexDefaultBehavior_ = false;
  22298. return _this;
  22299. }
  22300. _createClass(MDCToolbarFoundation, [{
  22301. key: 'init',
  22302. value: function init() {
  22303. this.fixed_ = this.adapter_.hasClass(MDCToolbarFoundation.cssClasses.FIXED);
  22304. this.fixedLastrow_ = this.adapter_.hasClass(MDCToolbarFoundation.cssClasses.FIXED_LASTROW) & this.fixed_;
  22305. this.hasFlexibleRow_ = this.adapter_.hasClass(MDCToolbarFoundation.cssClasses.TOOLBAR_ROW_FLEXIBLE);
  22306. if (this.hasFlexibleRow_) {
  22307. this.useFlexDefaultBehavior_ = this.adapter_.hasClass(MDCToolbarFoundation.cssClasses.FLEXIBLE_DEFAULT_BEHAVIOR);
  22308. }
  22309. this.initKeyRatio_();
  22310. this.setKeyHeights_();
  22311. this.adapter_.registerResizeHandler(this.resizeHandler_);
  22312. this.adapter_.registerScrollHandler(this.scrollHandler_);
  22313. }
  22314. }, {
  22315. key: 'destroy',
  22316. value: function destroy() {
  22317. this.adapter_.deregisterResizeHandler(this.resizeHandler_);
  22318. this.adapter_.deregisterScrollHandler(this.scrollHandler_);
  22319. }
  22320. }, {
  22321. key: 'updateAdjustElementStyles',
  22322. value: function updateAdjustElementStyles() {
  22323. if (this.fixed_) {
  22324. this.adapter_.setStyleForFixedAdjustElement('margin-top', this.calculations_.toolbarHeight + 'px');
  22325. }
  22326. }
  22327. }, {
  22328. key: 'getFlexibleExpansionRatio_',
  22329. value: function getFlexibleExpansionRatio_(scrollTop) {
  22330. // To prevent division by zero when there is no flexibleExpansionHeight
  22331. var delta = 0.0001;
  22332. return Math.max(0, 1 - scrollTop / (this.calculations_.flexibleExpansionHeight + delta));
  22333. }
  22334. }, {
  22335. key: 'checkRowHeight_',
  22336. value: function checkRowHeight_() {
  22337. var _this2 = this;
  22338. cancelAnimationFrame(this.checkRowHeightFrame_);
  22339. this.checkRowHeightFrame_ = requestAnimationFrame(function () {
  22340. return _this2.setKeyHeights_();
  22341. });
  22342. }
  22343. }, {
  22344. key: 'setKeyHeights_',
  22345. value: function setKeyHeights_() {
  22346. var newToolbarRowHeight = this.getRowHeight_();
  22347. if (newToolbarRowHeight !== this.calculations_.toolbarRowHeight) {
  22348. this.calculations_.toolbarRowHeight = newToolbarRowHeight;
  22349. this.calculations_.toolbarHeight = this.calculations_.toolbarRatio * this.calculations_.toolbarRowHeight;
  22350. this.calculations_.flexibleExpansionHeight = this.calculations_.flexibleExpansionRatio * this.calculations_.toolbarRowHeight;
  22351. this.calculations_.maxTranslateYDistance = this.calculations_.maxTranslateYRatio * this.calculations_.toolbarRowHeight;
  22352. this.calculations_.scrollThreshold = this.calculations_.scrollThresholdRatio * this.calculations_.toolbarRowHeight;
  22353. this.updateAdjustElementStyles();
  22354. this.updateToolbarStyles_();
  22355. }
  22356. }
  22357. }, {
  22358. key: 'updateToolbarStyles_',
  22359. value: function updateToolbarStyles_() {
  22360. var _this3 = this;
  22361. cancelAnimationFrame(this.scrollFrame_);
  22362. this.scrollFrame_ = requestAnimationFrame(function () {
  22363. var scrollTop = _this3.adapter_.getViewportScrollY();
  22364. var hasScrolledOutOfThreshold = _this3.scrolledOutOfThreshold_(scrollTop);
  22365. if (hasScrolledOutOfThreshold && _this3.executedLastChange_) {
  22366. return;
  22367. }
  22368. var flexibleExpansionRatio = _this3.getFlexibleExpansionRatio_(scrollTop);
  22369. _this3.updateToolbarFlexibleState_(flexibleExpansionRatio);
  22370. if (_this3.fixedLastrow_) {
  22371. _this3.updateToolbarFixedState_(scrollTop);
  22372. }
  22373. if (_this3.hasFlexibleRow_) {
  22374. _this3.updateFlexibleRowElementStyles_(flexibleExpansionRatio);
  22375. }
  22376. _this3.executedLastChange_ = hasScrolledOutOfThreshold;
  22377. _this3.adapter_.notifyChange({ flexibleExpansionRatio: flexibleExpansionRatio });
  22378. });
  22379. }
  22380. }, {
  22381. key: 'scrolledOutOfThreshold_',
  22382. value: function scrolledOutOfThreshold_(scrollTop) {
  22383. return scrollTop > this.calculations_.scrollThreshold;
  22384. }
  22385. }, {
  22386. key: 'initKeyRatio_',
  22387. value: function initKeyRatio_() {
  22388. var toolbarRowHeight = this.getRowHeight_();
  22389. var firstRowMaxRatio = this.adapter_.getFirstRowElementOffsetHeight() / toolbarRowHeight;
  22390. this.calculations_.toolbarRatio = this.adapter_.getOffsetHeight() / toolbarRowHeight;
  22391. this.calculations_.flexibleExpansionRatio = firstRowMaxRatio - 1;
  22392. this.calculations_.maxTranslateYRatio = this.fixedLastrow_ ? this.calculations_.toolbarRatio - firstRowMaxRatio : 0;
  22393. this.calculations_.scrollThresholdRatio = (this.fixedLastrow_ ? this.calculations_.toolbarRatio : firstRowMaxRatio) - 1;
  22394. }
  22395. }, {
  22396. key: 'getRowHeight_',
  22397. value: function getRowHeight_() {
  22398. var breakpoint = MDCToolbarFoundation.numbers.TOOLBAR_MOBILE_BREAKPOINT;
  22399. return this.adapter_.getViewportWidth() < breakpoint ? MDCToolbarFoundation.numbers.TOOLBAR_ROW_MOBILE_HEIGHT : MDCToolbarFoundation.numbers.TOOLBAR_ROW_HEIGHT;
  22400. }
  22401. }, {
  22402. key: 'updateToolbarFlexibleState_',
  22403. value: function updateToolbarFlexibleState_(flexibleExpansionRatio) {
  22404. this.adapter_.removeClass(MDCToolbarFoundation.cssClasses.FLEXIBLE_MAX);
  22405. this.adapter_.removeClass(MDCToolbarFoundation.cssClasses.FLEXIBLE_MIN);
  22406. if (flexibleExpansionRatio === 1) {
  22407. this.adapter_.addClass(MDCToolbarFoundation.cssClasses.FLEXIBLE_MAX);
  22408. } else if (flexibleExpansionRatio === 0) {
  22409. this.adapter_.addClass(MDCToolbarFoundation.cssClasses.FLEXIBLE_MIN);
  22410. }
  22411. }
  22412. }, {
  22413. key: 'updateToolbarFixedState_',
  22414. value: function updateToolbarFixedState_(scrollTop) {
  22415. var translateDistance = Math.max(0, Math.min(scrollTop - this.calculations_.flexibleExpansionHeight, this.calculations_.maxTranslateYDistance));
  22416. this.adapter_.setStyle('transform', 'translateY(' + -translateDistance + 'px)');
  22417. if (translateDistance === this.calculations_.maxTranslateYDistance) {
  22418. this.adapter_.addClass(MDCToolbarFoundation.cssClasses.FIXED_AT_LAST_ROW);
  22419. } else {
  22420. this.adapter_.removeClass(MDCToolbarFoundation.cssClasses.FIXED_AT_LAST_ROW);
  22421. }
  22422. }
  22423. }, {
  22424. key: 'updateFlexibleRowElementStyles_',
  22425. value: function updateFlexibleRowElementStyles_(flexibleExpansionRatio) {
  22426. if (this.fixed_) {
  22427. var height = this.calculations_.flexibleExpansionHeight * flexibleExpansionRatio;
  22428. this.adapter_.setStyleForFlexibleRowElement('height', height + this.calculations_.toolbarRowHeight + 'px');
  22429. }
  22430. if (this.useFlexDefaultBehavior_) {
  22431. this.updateElementStylesDefaultBehavior_(flexibleExpansionRatio);
  22432. }
  22433. }
  22434. }, {
  22435. key: 'updateElementStylesDefaultBehavior_',
  22436. value: function updateElementStylesDefaultBehavior_(flexibleExpansionRatio) {
  22437. var maxTitleSize = MDCToolbarFoundation.numbers.MAX_TITLE_SIZE;
  22438. var minTitleSize = MDCToolbarFoundation.numbers.MIN_TITLE_SIZE;
  22439. var currentTitleSize = (maxTitleSize - minTitleSize) * flexibleExpansionRatio + minTitleSize;
  22440. this.adapter_.setStyleForTitleElement('font-size', currentTitleSize + 'rem');
  22441. }
  22442. }]);
  22443. return MDCToolbarFoundation;
  22444. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  22445. /* harmony default export */ __webpack_exports__["a"] = (MDCToolbarFoundation);
  22446. /***/ }),
  22447. /* 153 */
  22448. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22449. "use strict";
  22450. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  22451. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; });
  22452. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; });
  22453. /**
  22454. * @license
  22455. * Copyright 2017 Google Inc.
  22456. *
  22457. * Permission is hereby granted, free of charge, to any person obtaining a copy
  22458. * of this software and associated documentation files (the "Software"), to deal
  22459. * in the Software without restriction, including without limitation the rights
  22460. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  22461. * copies of the Software, and to permit persons to whom the Software is
  22462. * furnished to do so, subject to the following conditions:
  22463. *
  22464. * The above copyright notice and this permission notice shall be included in
  22465. * all copies or substantial portions of the Software.
  22466. *
  22467. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  22468. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  22469. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  22470. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  22471. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  22472. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  22473. * THE SOFTWARE.
  22474. */
  22475. var cssClasses = {
  22476. FIXED: 'mdc-toolbar--fixed',
  22477. FIXED_LASTROW: 'mdc-toolbar--fixed-lastrow-only',
  22478. FIXED_AT_LAST_ROW: 'mdc-toolbar--fixed-at-last-row',
  22479. TOOLBAR_ROW_FLEXIBLE: 'mdc-toolbar--flexible',
  22480. FLEXIBLE_DEFAULT_BEHAVIOR: 'mdc-toolbar--flexible-default-behavior',
  22481. FLEXIBLE_MAX: 'mdc-toolbar--flexible-space-maximized',
  22482. FLEXIBLE_MIN: 'mdc-toolbar--flexible-space-minimized'
  22483. };
  22484. var strings = {
  22485. TITLE_SELECTOR: '.mdc-toolbar__title',
  22486. ICON_SELECTOR: '.mdc-toolbar__icon',
  22487. FIRST_ROW_SELECTOR: '.mdc-toolbar__row:first-child',
  22488. CHANGE_EVENT: 'MDCToolbar:change'
  22489. };
  22490. var numbers = {
  22491. MAX_TITLE_SIZE: 2.125,
  22492. MIN_TITLE_SIZE: 1.25,
  22493. TOOLBAR_ROW_HEIGHT: 64,
  22494. TOOLBAR_ROW_MOBILE_HEIGHT: 56,
  22495. TOOLBAR_MOBILE_BREAKPOINT: 600
  22496. };
  22497. /***/ }),
  22498. /* 154 */
  22499. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22500. "use strict";
  22501. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  22502. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTopAppBar", function() { return MDCTopAppBar; });
  22503. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__adapter__ = __webpack_require__(7);
  22504. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_component__ = __webpack_require__(1);
  22505. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_ripple_index__ = __webpack_require__(2);
  22506. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__constants__ = __webpack_require__(8);
  22507. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation__ = __webpack_require__(12);
  22508. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__fixed_foundation__ = __webpack_require__(155);
  22509. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__short_foundation__ = __webpack_require__(156);
  22510. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__standard_foundation__ = __webpack_require__(157);
  22511. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTopAppBarBaseFoundation", function() { return __WEBPACK_IMPORTED_MODULE_4__foundation__["a"]; });
  22512. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTopAppBarFoundation", function() { return __WEBPACK_IMPORTED_MODULE_7__standard_foundation__["a"]; });
  22513. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCFixedTopAppBarFoundation", function() { return __WEBPACK_IMPORTED_MODULE_5__fixed_foundation__["a"]; });
  22514. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCShortTopAppBarFoundation", function() { return __WEBPACK_IMPORTED_MODULE_6__short_foundation__["a"]; });
  22515. 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; };
  22516. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  22517. 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); } };
  22518. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22519. 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; }
  22520. 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; }
  22521. /**
  22522. * @license
  22523. * Copyright 2018 Google Inc.
  22524. *
  22525. * Permission is hereby granted, free of charge, to any person obtaining a copy
  22526. * of this software and associated documentation files (the "Software"), to deal
  22527. * in the Software without restriction, including without limitation the rights
  22528. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  22529. * copies of the Software, and to permit persons to whom the Software is
  22530. * furnished to do so, subject to the following conditions:
  22531. *
  22532. * The above copyright notice and this permission notice shall be included in
  22533. * all copies or substantial portions of the Software.
  22534. *
  22535. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  22536. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  22537. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  22538. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  22539. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  22540. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  22541. * THE SOFTWARE.
  22542. */
  22543. /**
  22544. * @extends {MDCComponent<!MDCTopAppBarBaseFoundation>}
  22545. * @final
  22546. */
  22547. var MDCTopAppBar = function (_MDCComponent) {
  22548. _inherits(MDCTopAppBar, _MDCComponent);
  22549. /**
  22550. * @param {...?} args
  22551. */
  22552. function MDCTopAppBar() {
  22553. var _ref;
  22554. _classCallCheck(this, MDCTopAppBar);
  22555. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  22556. args[_key] = arguments[_key];
  22557. }
  22558. /** @private {?Element} */
  22559. var _this = _possibleConstructorReturn(this, (_ref = MDCTopAppBar.__proto__ || Object.getPrototypeOf(MDCTopAppBar)).call.apply(_ref, [this].concat(args)));
  22560. _this.navIcon_;
  22561. /** @type {?Array<MDCRipple>} */
  22562. _this.iconRipples_;
  22563. /** @type {Object} */
  22564. _this.scrollTarget_;
  22565. return _this;
  22566. }
  22567. _createClass(MDCTopAppBar, [{
  22568. key: 'initialize',
  22569. value: function initialize() {
  22570. var rippleFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (el) {
  22571. return __WEBPACK_IMPORTED_MODULE_2__material_ripple_index__["MDCRipple"].attachTo(el);
  22572. };
  22573. this.navIcon_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].NAVIGATION_ICON_SELECTOR);
  22574. // Get all icons in the toolbar and instantiate the ripples
  22575. var icons = [].slice.call(this.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].ACTION_ITEM_SELECTOR));
  22576. if (this.navIcon_) {
  22577. icons.push(this.navIcon_);
  22578. }
  22579. this.iconRipples_ = icons.map(function (icon) {
  22580. var ripple = rippleFactory(icon);
  22581. ripple.unbounded = true;
  22582. return ripple;
  22583. });
  22584. }
  22585. }, {
  22586. key: 'destroy',
  22587. value: function destroy() {
  22588. this.iconRipples_.forEach(function (iconRipple) {
  22589. return iconRipple.destroy();
  22590. });
  22591. _get(MDCTopAppBar.prototype.__proto__ || Object.getPrototypeOf(MDCTopAppBar.prototype), 'destroy', this).call(this);
  22592. }
  22593. }, {
  22594. key: 'setScrollTarget',
  22595. value: function setScrollTarget(target) {
  22596. this.foundation_.destroyScrollHandler();
  22597. this.scrollTarget_ = target;
  22598. this.foundation_.initScrollHandler();
  22599. }
  22600. /**
  22601. * @param {!Element} root
  22602. * @return {!MDCTopAppBar}
  22603. */
  22604. }, {
  22605. key: 'getDefaultFoundation',
  22606. /**
  22607. * @return {!MDCTopAppBarBaseFoundation}
  22608. */
  22609. value: function getDefaultFoundation() {
  22610. var _this2 = this;
  22611. /** @type {!MDCTopAppBarAdapter} */
  22612. var adapter = /** @type {!MDCTopAppBarAdapter} */_extends({
  22613. hasClass: function hasClass(className) {
  22614. return _this2.root_.classList.contains(className);
  22615. },
  22616. addClass: function addClass(className) {
  22617. return _this2.root_.classList.add(className);
  22618. },
  22619. removeClass: function removeClass(className) {
  22620. return _this2.root_.classList.remove(className);
  22621. },
  22622. setStyle: function setStyle(property, value) {
  22623. return _this2.root_.style.setProperty(property, value);
  22624. },
  22625. getTopAppBarHeight: function getTopAppBarHeight() {
  22626. return _this2.root_.clientHeight;
  22627. },
  22628. registerNavigationIconInteractionHandler: function registerNavigationIconInteractionHandler(evtType, handler) {
  22629. if (_this2.navIcon_) {
  22630. _this2.navIcon_.addEventListener(evtType, handler);
  22631. }
  22632. },
  22633. deregisterNavigationIconInteractionHandler: function deregisterNavigationIconInteractionHandler(evtType, handler) {
  22634. if (_this2.navIcon_) {
  22635. _this2.navIcon_.removeEventListener(evtType, handler);
  22636. }
  22637. },
  22638. notifyNavigationIconClicked: function notifyNavigationIconClicked() {
  22639. _this2.emit(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].NAVIGATION_EVENT, {});
  22640. },
  22641. registerScrollHandler: function registerScrollHandler(handler) {
  22642. return _this2.scrollTarget_.addEventListener('scroll', handler);
  22643. },
  22644. deregisterScrollHandler: function deregisterScrollHandler(handler) {
  22645. return _this2.scrollTarget_.removeEventListener('scroll', handler);
  22646. },
  22647. registerResizeHandler: function registerResizeHandler(handler) {
  22648. return window.addEventListener('resize', handler);
  22649. },
  22650. deregisterResizeHandler: function deregisterResizeHandler(handler) {
  22651. return window.removeEventListener('resize', handler);
  22652. },
  22653. getViewportScrollY: function getViewportScrollY() {
  22654. return _this2.scrollTarget_[_this2.scrollTarget_ === window ? 'pageYOffset' : 'scrollTop'];
  22655. },
  22656. getTotalActionItems: function getTotalActionItems() {
  22657. return _this2.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].ACTION_ITEM_SELECTOR).length;
  22658. }
  22659. });
  22660. this.scrollTarget_ = window;
  22661. /** @type {!MDCTopAppBarBaseFoundation} */
  22662. var foundation = void 0;
  22663. if (this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].SHORT_CLASS)) {
  22664. foundation = new __WEBPACK_IMPORTED_MODULE_6__short_foundation__["a" /* default */](adapter);
  22665. } else if (this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].FIXED_CLASS)) {
  22666. foundation = new __WEBPACK_IMPORTED_MODULE_5__fixed_foundation__["a" /* default */](adapter);
  22667. } else {
  22668. foundation = new __WEBPACK_IMPORTED_MODULE_7__standard_foundation__["a" /* default */](adapter);
  22669. }
  22670. return foundation;
  22671. }
  22672. }], [{
  22673. key: 'attachTo',
  22674. value: function attachTo(root) {
  22675. return new MDCTopAppBar(root);
  22676. }
  22677. }]);
  22678. return MDCTopAppBar;
  22679. }(__WEBPACK_IMPORTED_MODULE_1__material_base_component__["a" /* default */]);
  22680. /***/ }),
  22681. /* 155 */
  22682. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22683. "use strict";
  22684. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__constants__ = __webpack_require__(8);
  22685. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(7);
  22686. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(12);
  22687. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  22688. 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); } };
  22689. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22690. 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; }
  22691. 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; }
  22692. /**
  22693. * @license
  22694. * Copyright 2018 Google Inc.
  22695. *
  22696. * Permission is hereby granted, free of charge, to any person obtaining a copy
  22697. * of this software and associated documentation files (the "Software"), to deal
  22698. * in the Software without restriction, including without limitation the rights
  22699. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  22700. * copies of the Software, and to permit persons to whom the Software is
  22701. * furnished to do so, subject to the following conditions:
  22702. *
  22703. * The above copyright notice and this permission notice shall be included in
  22704. * all copies or substantial portions of the Software.
  22705. *
  22706. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  22707. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  22708. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  22709. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  22710. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  22711. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  22712. * THE SOFTWARE.
  22713. */
  22714. /**
  22715. * @extends {MDCTopAppBarFoundation<!MDCFixedTopAppBarFoundation>}
  22716. * @final
  22717. */
  22718. var MDCFixedTopAppBarFoundation = function (_MDCTopAppBarFoundati) {
  22719. _inherits(MDCFixedTopAppBarFoundation, _MDCTopAppBarFoundati);
  22720. /**
  22721. * @param {!MDCTopAppBarAdapter} adapter
  22722. */
  22723. function MDCFixedTopAppBarFoundation(adapter) {
  22724. _classCallCheck(this, MDCFixedTopAppBarFoundation);
  22725. /** State variable for the previous scroll iteration top app bar state */
  22726. var _this = _possibleConstructorReturn(this, (MDCFixedTopAppBarFoundation.__proto__ || Object.getPrototypeOf(MDCFixedTopAppBarFoundation)).call(this, adapter));
  22727. _this.wasScrolled_ = false;
  22728. _this.scrollHandler_ = function () {
  22729. return _this.fixedScrollHandler_();
  22730. };
  22731. return _this;
  22732. }
  22733. _createClass(MDCFixedTopAppBarFoundation, [{
  22734. key: 'init',
  22735. value: function init() {
  22736. _get(MDCFixedTopAppBarFoundation.prototype.__proto__ || Object.getPrototypeOf(MDCFixedTopAppBarFoundation.prototype), 'init', this).call(this);
  22737. this.adapter_.registerScrollHandler(this.scrollHandler_);
  22738. }
  22739. }, {
  22740. key: 'destroy',
  22741. value: function destroy() {
  22742. _get(MDCFixedTopAppBarFoundation.prototype.__proto__ || Object.getPrototypeOf(MDCFixedTopAppBarFoundation.prototype), 'destroy', this).call(this);
  22743. this.adapter_.deregisterScrollHandler(this.scrollHandler_);
  22744. }
  22745. /**
  22746. * Scroll handler for applying/removing the modifier class
  22747. * on the fixed top app bar.
  22748. */
  22749. }, {
  22750. key: 'fixedScrollHandler_',
  22751. value: function fixedScrollHandler_() {
  22752. var currentScroll = this.adapter_.getViewportScrollY();
  22753. if (currentScroll <= 0) {
  22754. if (this.wasScrolled_) {
  22755. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].FIXED_SCROLLED_CLASS);
  22756. this.wasScrolled_ = false;
  22757. }
  22758. } else {
  22759. if (!this.wasScrolled_) {
  22760. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].FIXED_SCROLLED_CLASS);
  22761. this.wasScrolled_ = true;
  22762. }
  22763. }
  22764. }
  22765. }]);
  22766. return MDCFixedTopAppBarFoundation;
  22767. }(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]);
  22768. /* harmony default export */ __webpack_exports__["a"] = (MDCFixedTopAppBarFoundation);
  22769. /***/ }),
  22770. /* 156 */
  22771. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22772. "use strict";
  22773. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__adapter__ = __webpack_require__(7);
  22774. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(12);
  22775. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(8);
  22776. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  22777. 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); } };
  22778. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22779. 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; }
  22780. 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; }
  22781. /**
  22782. * @license
  22783. * Copyright 2018 Google Inc.
  22784. *
  22785. * Permission is hereby granted, free of charge, to any person obtaining a copy
  22786. * of this software and associated documentation files (the "Software"), to deal
  22787. * in the Software without restriction, including without limitation the rights
  22788. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  22789. * copies of the Software, and to permit persons to whom the Software is
  22790. * furnished to do so, subject to the following conditions:
  22791. *
  22792. * The above copyright notice and this permission notice shall be included in
  22793. * all copies or substantial portions of the Software.
  22794. *
  22795. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  22796. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  22797. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  22798. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  22799. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  22800. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  22801. * THE SOFTWARE.
  22802. */
  22803. /**
  22804. * @extends {MDCTopAppBarBaseFoundation<!MDCShortTopAppBarFoundation>}
  22805. * @final
  22806. */
  22807. var MDCShortTopAppBarFoundation = function (_MDCTopAppBarBaseFoun) {
  22808. _inherits(MDCShortTopAppBarFoundation, _MDCTopAppBarBaseFoun);
  22809. /**
  22810. * @param {!MDCTopAppBarAdapter} adapter
  22811. */
  22812. function MDCShortTopAppBarFoundation(adapter) {
  22813. _classCallCheck(this, MDCShortTopAppBarFoundation);
  22814. // State variable for the current top app bar state
  22815. var _this = _possibleConstructorReturn(this, (MDCShortTopAppBarFoundation.__proto__ || Object.getPrototypeOf(MDCShortTopAppBarFoundation)).call(this, adapter));
  22816. _this.isCollapsed = false;
  22817. _this.scrollHandler_ = function () {
  22818. return _this.shortAppBarScrollHandler_();
  22819. };
  22820. return _this;
  22821. }
  22822. _createClass(MDCShortTopAppBarFoundation, [{
  22823. key: 'init',
  22824. value: function init() {
  22825. _get(MDCShortTopAppBarFoundation.prototype.__proto__ || Object.getPrototypeOf(MDCShortTopAppBarFoundation.prototype), 'init', this).call(this);
  22826. var isAlwaysCollapsed = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SHORT_COLLAPSED_CLASS);
  22827. if (this.adapter_.getTotalActionItems() > 0) {
  22828. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SHORT_HAS_ACTION_ITEM_CLASS);
  22829. }
  22830. if (!isAlwaysCollapsed) {
  22831. this.adapter_.registerScrollHandler(this.scrollHandler_);
  22832. this.shortAppBarScrollHandler_();
  22833. }
  22834. }
  22835. }, {
  22836. key: 'destroy',
  22837. value: function destroy() {
  22838. _get(MDCShortTopAppBarFoundation.prototype.__proto__ || Object.getPrototypeOf(MDCShortTopAppBarFoundation.prototype), 'destroy', this).call(this);
  22839. this.adapter_.deregisterScrollHandler(this.scrollHandler_);
  22840. }
  22841. /**
  22842. * Scroll handler for applying/removing the collapsed modifier class
  22843. * on the short top app bar.
  22844. * @private
  22845. */
  22846. }, {
  22847. key: 'shortAppBarScrollHandler_',
  22848. value: function shortAppBarScrollHandler_() {
  22849. var currentScroll = this.adapter_.getViewportScrollY();
  22850. if (currentScroll <= 0) {
  22851. if (this.isCollapsed) {
  22852. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SHORT_COLLAPSED_CLASS);
  22853. this.isCollapsed = false;
  22854. }
  22855. } else {
  22856. if (!this.isCollapsed) {
  22857. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SHORT_COLLAPSED_CLASS);
  22858. this.isCollapsed = true;
  22859. }
  22860. }
  22861. }
  22862. }]);
  22863. return MDCShortTopAppBarFoundation;
  22864. }(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]);
  22865. /* harmony default export */ __webpack_exports__["a"] = (MDCShortTopAppBarFoundation);
  22866. /***/ }),
  22867. /* 157 */
  22868. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22869. "use strict";
  22870. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__adapter__ = __webpack_require__(7);
  22871. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(12);
  22872. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(8);
  22873. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  22874. 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); } };
  22875. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22876. 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; }
  22877. 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; }
  22878. /**
  22879. * @license
  22880. * Copyright 2018 Google Inc.
  22881. *
  22882. * Permission is hereby granted, free of charge, to any person obtaining a copy
  22883. * of this software and associated documentation files (the "Software"), to deal
  22884. * in the Software without restriction, including without limitation the rights
  22885. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  22886. * copies of the Software, and to permit persons to whom the Software is
  22887. * furnished to do so, subject to the following conditions:
  22888. *
  22889. * The above copyright notice and this permission notice shall be included in
  22890. * all copies or substantial portions of the Software.
  22891. *
  22892. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  22893. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  22894. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  22895. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  22896. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  22897. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  22898. * THE SOFTWARE.
  22899. */
  22900. var INITIAL_VALUE = 0;
  22901. /**
  22902. * @extends {MDCTopAppBarBaseFoundation<!MDCTopAppBarFoundation>}
  22903. * @final
  22904. */
  22905. var MDCTopAppBarFoundation = function (_MDCTopAppBarBaseFoun) {
  22906. _inherits(MDCTopAppBarFoundation, _MDCTopAppBarBaseFoun);
  22907. /**
  22908. * @param {!MDCTopAppBarAdapter} adapter
  22909. */
  22910. function MDCTopAppBarFoundation(adapter) {
  22911. _classCallCheck(this, MDCTopAppBarFoundation);
  22912. /**
  22913. * Used for diffs of current scroll position vs previous scroll position
  22914. * @private {number}
  22915. */
  22916. var _this = _possibleConstructorReturn(this, (MDCTopAppBarFoundation.__proto__ || Object.getPrototypeOf(MDCTopAppBarFoundation)).call(this, adapter));
  22917. _this.lastScrollPosition_ = _this.adapter_.getViewportScrollY();
  22918. /**
  22919. * Used to verify when the top app bar is completely showing or completely hidden
  22920. * @private {number}
  22921. */
  22922. _this.topAppBarHeight_ = _this.adapter_.getTopAppBarHeight();
  22923. /**
  22924. * wasDocked_ is used to indicate if the top app bar was docked in the previous
  22925. * scroll handler iteration.
  22926. * @private {boolean}
  22927. */
  22928. _this.wasDocked_ = true;
  22929. /**
  22930. * isDockedShowing_ is used to indicate if the top app bar is docked in the fully
  22931. * shown position.
  22932. * @private {boolean}
  22933. */
  22934. _this.isDockedShowing_ = true;
  22935. /**
  22936. * Variable for current scroll position of the top app bar
  22937. * @private {number}
  22938. */
  22939. _this.currentAppBarOffsetTop_ = 0;
  22940. /**
  22941. * Used to prevent the top app bar from being scrolled out of view during resize events
  22942. * @private {boolean} */
  22943. _this.isCurrentlyBeingResized_ = false;
  22944. /**
  22945. * The timeout that's used to throttle the resize events
  22946. * @private {number}
  22947. */
  22948. _this.resizeThrottleId_ = INITIAL_VALUE;
  22949. /**
  22950. * The timeout that's used to debounce toggling the isCurrentlyBeingResized_ variable after a resize
  22951. * @private {number}
  22952. */
  22953. _this.resizeDebounceId_ = INITIAL_VALUE;
  22954. _this.scrollHandler_ = function () {
  22955. return _this.topAppBarScrollHandler_();
  22956. };
  22957. _this.resizeHandler_ = function () {
  22958. return _this.topAppBarResizeHandler_();
  22959. };
  22960. return _this;
  22961. }
  22962. _createClass(MDCTopAppBarFoundation, [{
  22963. key: 'init',
  22964. value: function init() {
  22965. _get(MDCTopAppBarFoundation.prototype.__proto__ || Object.getPrototypeOf(MDCTopAppBarFoundation.prototype), 'init', this).call(this);
  22966. this.adapter_.registerScrollHandler(this.scrollHandler_);
  22967. this.adapter_.registerResizeHandler(this.resizeHandler_);
  22968. }
  22969. }, {
  22970. key: 'destroy',
  22971. value: function destroy() {
  22972. _get(MDCTopAppBarFoundation.prototype.__proto__ || Object.getPrototypeOf(MDCTopAppBarFoundation.prototype), 'destroy', this).call(this);
  22973. this.adapter_.deregisterScrollHandler(this.scrollHandler_);
  22974. this.adapter_.deregisterResizeHandler(this.resizeHandler_);
  22975. this.adapter_.setStyle('top', '');
  22976. }
  22977. /**
  22978. * Function to determine if the DOM needs to update.
  22979. * @return {boolean}
  22980. * @private
  22981. */
  22982. }, {
  22983. key: 'checkForUpdate_',
  22984. value: function checkForUpdate_() {
  22985. var offscreenBoundaryTop = -this.topAppBarHeight_;
  22986. var hasAnyPixelsOffscreen = this.currentAppBarOffsetTop_ < 0;
  22987. var hasAnyPixelsOnscreen = this.currentAppBarOffsetTop_ > offscreenBoundaryTop;
  22988. var partiallyShowing = hasAnyPixelsOffscreen && hasAnyPixelsOnscreen;
  22989. // If it's partially showing, it can't be docked.
  22990. if (partiallyShowing) {
  22991. this.wasDocked_ = false;
  22992. } else {
  22993. // Not previously docked and not partially showing, it's now docked.
  22994. if (!this.wasDocked_) {
  22995. this.wasDocked_ = true;
  22996. return true;
  22997. } else if (this.isDockedShowing_ !== hasAnyPixelsOnscreen) {
  22998. this.isDockedShowing_ = hasAnyPixelsOnscreen;
  22999. return true;
  23000. }
  23001. }
  23002. return partiallyShowing;
  23003. }
  23004. /**
  23005. * Function to move the top app bar if needed.
  23006. * @private
  23007. */
  23008. }, {
  23009. key: 'moveTopAppBar_',
  23010. value: function moveTopAppBar_() {
  23011. if (this.checkForUpdate_()) {
  23012. // Once the top app bar is fully hidden we use the max potential top app bar height as our offset
  23013. // so the top app bar doesn't show if the window resizes and the new height > the old height.
  23014. var offset = this.currentAppBarOffsetTop_;
  23015. if (Math.abs(offset) >= this.topAppBarHeight_) {
  23016. offset = -__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].MAX_TOP_APP_BAR_HEIGHT;
  23017. }
  23018. this.adapter_.setStyle('top', offset + 'px');
  23019. }
  23020. }
  23021. /**
  23022. * Scroll handler for the default scroll behavior of the top app bar.
  23023. * @private
  23024. */
  23025. }, {
  23026. key: 'topAppBarScrollHandler_',
  23027. value: function topAppBarScrollHandler_() {
  23028. var currentScrollPosition = Math.max(this.adapter_.getViewportScrollY(), 0);
  23029. var diff = currentScrollPosition - this.lastScrollPosition_;
  23030. this.lastScrollPosition_ = currentScrollPosition;
  23031. // If the window is being resized the lastScrollPosition_ needs to be updated but the
  23032. // current scroll of the top app bar should stay in the same position.
  23033. if (!this.isCurrentlyBeingResized_) {
  23034. this.currentAppBarOffsetTop_ -= diff;
  23035. if (this.currentAppBarOffsetTop_ > 0) {
  23036. this.currentAppBarOffsetTop_ = 0;
  23037. } else if (Math.abs(this.currentAppBarOffsetTop_) > this.topAppBarHeight_) {
  23038. this.currentAppBarOffsetTop_ = -this.topAppBarHeight_;
  23039. }
  23040. this.moveTopAppBar_();
  23041. }
  23042. }
  23043. /**
  23044. * Top app bar resize handler that throttle/debounce functions that execute updates.
  23045. * @private
  23046. */
  23047. }, {
  23048. key: 'topAppBarResizeHandler_',
  23049. value: function topAppBarResizeHandler_() {
  23050. var _this2 = this;
  23051. // Throttle resize events 10 p/s
  23052. if (!this.resizeThrottleId_) {
  23053. this.resizeThrottleId_ = setTimeout(function () {
  23054. _this2.resizeThrottleId_ = INITIAL_VALUE;
  23055. _this2.throttledResizeHandler_();
  23056. }, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].DEBOUNCE_THROTTLE_RESIZE_TIME_MS);
  23057. }
  23058. this.isCurrentlyBeingResized_ = true;
  23059. if (this.resizeDebounceId_) {
  23060. clearTimeout(this.resizeDebounceId_);
  23061. }
  23062. this.resizeDebounceId_ = setTimeout(function () {
  23063. _this2.topAppBarScrollHandler_();
  23064. _this2.isCurrentlyBeingResized_ = false;
  23065. _this2.resizeDebounceId_ = INITIAL_VALUE;
  23066. }, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].DEBOUNCE_THROTTLE_RESIZE_TIME_MS);
  23067. }
  23068. /**
  23069. * Throttled function that updates the top app bar scrolled values if the
  23070. * top app bar height changes.
  23071. * @private
  23072. */
  23073. }, {
  23074. key: 'throttledResizeHandler_',
  23075. value: function throttledResizeHandler_() {
  23076. var currentHeight = this.adapter_.getTopAppBarHeight();
  23077. if (this.topAppBarHeight_ !== currentHeight) {
  23078. this.wasDocked_ = false;
  23079. // Since the top app bar has a different height depending on the screen width, this
  23080. // will ensure that the top app bar remains in the correct location if
  23081. // completely hidden and a resize makes the top app bar a different height.
  23082. this.currentAppBarOffsetTop_ -= this.topAppBarHeight_ - currentHeight;
  23083. this.topAppBarHeight_ = currentHeight;
  23084. }
  23085. this.topAppBarScrollHandler_();
  23086. }
  23087. }]);
  23088. return MDCTopAppBarFoundation;
  23089. }(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]);
  23090. /* harmony default export */ __webpack_exports__["a"] = (MDCTopAppBarFoundation);
  23091. /***/ })
  23092. /******/ ]);
  23093. });
  23094. //# sourceMappingURL=material-components-web.js.map